Skip to content
Sign inJoin waitlist

Design — Semono Astro

The look of this Astro template comes from a small set of tokens: change one and nearly every page, component and state follows.

So you rarely need to touch a component. This guide covers the colours, the logo, the fonts, the text styles, the spacing, the motion (the page change included), the components and the icons.

Run npm run dev and open http://localhost:4321/style-guide. It shows the colours, the text styles, the buttons and links, the logo and the icons, the menu button, the layout constants, the springs, the cards, the video card, the figures, the patterns (rows that open, lists that load on scroll, the closing quote, rich text) and the forms with their states, each with its name. When you want to know what a change will affect, look there.

The style guide page: the colours and text styles, then every component with its name

src/design-system/theme.css:

@theme {
--color-ink: #000000; /* headings and text, the black buttons and cards, the footer */
--color-soft: #616161; /* leads, descriptions, labels, meta, list dots */
--color-grey: #ebebeb; /* hairlines, the chip above a page title, field borders, the footer's links */
--color-lime: #e4fe00; /* the accent: buttons, label dots, chips, tags, arrow circles */
--color-green: #0f3d3a; /* text and icons on lime */
--color-background: #f7f7f7; /* the page, the form fields, the header once it turns light */
--color-white: #ffffff; /* cards, white buttons, text over photos */
--color-red: #ff0000; /* the asterisk of a required field, the error label of a form's button */
--color-error-fill: rgba(255, 34, 68, 0.15); /* the button's fill after a failed send */
--color-spinner: #999999; /* the ring of the loading spinner */
}

Each name becomes a Tailwind class: bg-lime, text-soft, border-grey. Swap the hex values for your own palette and the site changes. Lime is the accent and Green is the colour that sits on it, so change them as a pair. In the demo Green on Lime reads at about 10.6 : 1 and Black on Lime at 18.5 : 1, but White on Lime only at 1.1 : 1: a lighter accent needs dark text and a darker one light text. Keep text on its background at 4.5 : 1 or more, or the site becomes hard to read. Soft on Background is 5.8 : 1 in the demo; the placeholders of the fields (Black at 50 %) are about 3.9 : 1, so a darker value reads better there.

Faded colours are opacity modifiers on a token: ink/50 is the dark layer over the photos of the Home hero, the photo band and the 404 page and the placeholder of the fields, ink/25 the veil over a video before it plays and the border of a focused field, white/20 the hairlines of the footer. They follow the palette when you change the colour.

A few colours sit outside the tokens, so change them too when you change a colour:

Colour Where
The logo files: white (logo.svg) and black (logo-black.svg); the client logos are drawn in Soft (#616161) src/assets/images/*.svg
The browser icon: a black square with a white monogram, reversed in a dark browser theme public/icon.svg
The swatches of the style guide repeat the hex values as text src/components/style-guide/tokens.ts

The colours that the scripts animate (the process tabs, the plus and minus marks, the arrow circles, the footer’s links) read the tokens as CSS variables (var(--color-lime)), so they follow a changed token as well.

The Semono wordmark, with its ™ mark, is drawn as SVG paths in src/design-system/components/brand/Logo.astro, in the current text colour. That’s why it is white over the Home and 404 photos, in the footer and on the black card, and black on the light header. Its ™ is a third path, mark, filled with var(--logo-mark, currentColor): the header (over a photo), the footer and the black card set --logo-mark to Lime, as in the original design; delete mark if your logo has none. To use your own:

  • As an SVG: replace the strings in fills with your logo’s path data, and set the viewBox="0 0 386 75" and the aspect-[386/75] class to your artwork’s size.
  • As an image file: put it in public/ and replace the <svg> with an <img> of it. An image keeps its own colours, also over the photos and in the footer, so pick one that reads on both light and dark backgrounds.

It is 102 × 20 px everywhere, and 93 × 18 in the header of a phone: change w-[102px] and w-[93px] in Logo.astro to fit your proportions. Its name for screen readers is site.name. The same artwork is in src/assets/images/logo.svg (white) and src/assets/images/logo-black.svg (black) for use elsewhere; the site itself draws the logo from Logo.astro.

The browser icons are public/icon.svg (the monogram on a black square; it turns white in a dark browser theme) and public/apple-icon.png (180 × 180).

The template loads Inter with the Astro Fonts API, in astro.config.mjs:

fonts: [
{
provider: fontProviders.google(),
name: "Inter",
cssVariable: "--font-inter",
weights: ["100 900"],
styles: ["normal"],
subsets: ["latin"],
fallbacks: ["sans-serif"],
options: { experimental: { variableAxis: { opsz: [["14", "32"]] } } },
},
],

Inter is one variable font here: every weight and its optical-size axis (variableAxis, from 14 to 32). The text styles pin that axis, which gives two looks from one file: 32 for the headings (the “Inter Display” cut) and 14 for everything else, written as [font-variation-settings:'opsz'_32] in src/design-system/tokens/text.ts. The <Font> line in src/layouts/Layout.astro loads it on every page, and theme.css makes --font-inter the site font (--font-sans). Only Inter’s upright style is loaded: an italic mark in a post (the demo’s texts have none) is the browser’s slanted version of the regular text; add "italic" to styles to load the real italic.

To use another Google font, change name and keep cssVariable:

name: "Manrope",
cssVariable: "--font-inter",
weights: ["200 800"],
styles: ["normal"],

Leave out options unless the new font has an optical-size axis: Google Fonts refuses the request otherwise, and the build warns No data found for font family … and leaves the site on the fallback font. Without the axis, the font-variation-settings in the text styles simply do nothing. Everything is set in weight 500 (the text typed into a form field in 400): give a variable font its own range (["200 800"] for Manrope), or list ["400", "500"] for a font that isn’t variable. For a font you have licensed yourself, use fontProviders.local() with your files, for example in src/assets/fonts/ (see the Astro fonts guide). Astro downloads the font when the site builds and serves it from your own domain either way, so there is no request to Google at runtime.

src/design-system/tokens/text.ts holds the sizes, weights and line heights, named as in the original design:

Style Phone Tablet (md:) Desktop (lg:) Used for
display 48 59 74 The Home hero’s title
h1 42 48 54 Page titles and the big figures
h2 34 38 42 Section titles, post headings
h3 28 32 36 The Contact and FAQ titles, legal headings, the title of a black card
h4 24 26 28 The quote beside a closing line, a story’s results
h5 20 22 24 Results on cards, the career sections’ titles
h6 18 19 20 Card, row, tab and accordion titles
big 18 18 18 The hero’s lead, quotes on cards
paragraph 16 16 16 Leads, descriptions, rich text
small 14 14 14 Labels, chips, card text
menu 16 16 16 The header’s links
button 15 15 15 Button labels
tiny 12 12 12 Roles, the footer’s taglines and legal links

Everything is Inter at weight 500 (400 for the text typed into a field) with −0.03em letter spacing (−0.04em for menu and button). The headings have a line height of 1.1 and the other styles 1.2. Change the numbers in text.ts rather than in the components, and text stays consistent across the site. Use a style as class={text.h2} or combine: class={cn(text.h6, "text-white")}.

Three sizes, set in theme.css:

Width Tailwind prefix
Phone below 810 px (none)
Tablet 810–1199 px md:
Desktop 1200 px and up lg:

Content is at most 1400 px wide. The side padding is 15 px on phones, 20 px on tablets and 30 px on desktops, and most sections have 60 / 80 / 100 px above and below and 50 / 60 / 80 px between their blocks (sectionGutters, sectionPadding and sectionGap in src/design-system/components/layout/section.ts). The fixed header is 58 px tall on phones and 82 px from tablets up; src/layouts/Layout.astro pads <main> by that, except under a cover (Pages and sections).

src/design-system/tokens/motion.ts holds five springs. The scripts in src/design-system/scripts/ (and the header’s, src/components/site/header.ts) play them with Motion:

Token Values Used for
spring (A) no bounce, 0.4 s Every hover and look change: the buttons’ rolling label and arrow, the links, the accordion and FAQ rows, the phone menu opening
springSoft (B) bounce 0.2, 0.4 s The menu button’s lines turning into a cross, the plus and minus marks, the team cards’ LinkedIn button, the video card, the fill of the process tabs
revealSpring, revealDistance (C) stiffness 200, damping 30; 40 px Blocks rising into view (<Reveal>), once
wordSpring (D) stiffness 200, damping 40 The words of titles rising one after the other, 0.05 s apart (<WordReveal>), once
introSpring (E) stiffness 250, damping 55, mass 2.9 (about a second) The header and the Home hero rising 60 px as the page loads (<Intro>)

theme.css holds the same springs as CSS curves for what runs without a script (--ease-spring-a, -b and -e; the page-load rise is a CSS animation, so it starts before any script has loaded), and three tweens measured on the original: --ease-row-hover (the service rows’ hover, 0.4 s), --ease-form (the colours of a form’s button, 0.2 s, and the spinner’s fade, 0.3 s) and --ease-page-change (the page change, 0.6 s). Lower a spring’s duration for a snappier feel, or raise bounce for a livelier one.

Hovers are attributes in the markup, played by src/design-system/scripts/hover.ts: data-hover marks the element you point at, data-motion gives each part that changes its two states (rest and hover), and data-transition names the token it moves with (spring or soft). A part without data-transition moves with spring, so a state change never falls back on Motion’s own, bouncier default.

Effect Where to change it
The client logos move 20 px a second, 60 / 50 / 30 px apart speed={20} and gapClass on <Ticker> in src/components/sections/ClientsRow.astro
Services and Testimonial load four items at a time pageSize={4} on <LoadOnScroll> in ServicesListSection.astro and TestimonialsMainSection.astro
The Blog loads six cards at a time on desktop, four on tablets and phones pageSize in src/components/sections/BlogList.astro
Blocks rise as they scroll into view <Reveal> in the sections (delay, and amount, the share of the block that must show); a plain element with the same class shows at once
Words of titles rise one after the other <WordReveal> (stagger, 0.05 s by default); a plain <h2> with the same class shows at once
The header and the hero rise 60 px as the page loads the intro keyframes in theme.css; delay on <Intro>
The header fades between transparent and light in 0.37 s duration-[366ms] ease-spring-a in src/components/site/Header.astro
The “Why Choose” accordion starts with its first row open defaultOpen on <Accordion> in WhyChooseSection.astro (a row’s number from 0, or null for none; 0 when left out)
The questions of the Contact page start with the first one open defaultOpen on <FaqList> in ContactSection.astro (a list of numbers, [] for none; [0] when left out)
The Home hero and the 404 photo are as tall as the window (90 % on phones, 85 % on tablets) h-[90vh] md:h-[85vh] lg:h-screen in HomeHeroSection.astro and NotFoundSection.astro

On a click on a link to another page of the site, the whole screen, header and footer included, moves as one picture: the old page rises 30 % while it fades out (0.6 s), and the new one fades in from 30 % lower (0.6 s, starting 0.5 s after the first). Every page is its own HTML file, so the browser does it: a cross-document view transition, switched on by the @view-transition rule and animated by ::view-transition-old(root) and ::view-transition-new(root) in src/styles/page-change.css. src/layouts/Layout.astro writes that file inline into the <head> of every page, which is where the browser looks for it. A browser without cross-document view transitions, a visitor who prefers reduced motion, a click with a modifier key, a link that opens elsewhere, a reload and a link to another site simply navigate as they always do; a link to the page you are on doesn’t play it (a small script in the layout’s <head> skips it).

To change it, edit the durations, the delay and the 30% distances in page-change.css. To switch it off, delete the @view-transition rule there: the other rules then do nothing. Look at the result with npm run build and npm run preview, as a visitor gets it.

The header’s page-load rise plays once per visit: on the first page a visitor opens, and on a reload. A page reached from another page of the site shows the header at once, so the header stays still while the pages change (a script in the layout’s <head> marks such a page, and the last rule of page-change.css switches the rise off).

With “reduce motion” switched on in the visitor’s system, movement is left out: blocks and words fade in where they stand instead of rising, the page-load rise becomes a fade, the page change swaps the pages without animation, the logo ticker and the loading spinners stand still, the photos of the post cards and the service rows change on hover without a transition, and the rows that open do so at once. Fades and colour changes stay. play() in src/design-system/utils/play.ts, which every script animates through, makes moves, turns and sizes jump; the intro, the page change, the ticker, the spinners and the hover transitions check the setting in CSS.

Corners are 5 px on buttons, cards, photos, form fields and the video, and 3 px on the grey chips (the label above a page title, the place and type of a position). Dots, the arrow circles, portraits and the play button are round. There are no drop shadows. Spacing is Tailwind classes on the components (gap-5, p-3, gap-[50px]). Tailwind’s scale is 4 px per step, so gap-5 is 20 px. Change them where you see them; the style guide shows the result immediately.

src/design-system/components/ holds the buttons and links, the logo and the icons, the block and word reveals, the page-load intro, the menu button, the section layout and the page title, the cards (service row, post, testimonial, icon, team and “more”), the images and the video card, the figures, rich text, the card columns, the ticker, the accordion and the FAQ, the lists that load on scroll, the closing quote and the form parts. Their behaviour is in src/design-system/scripts/: each component with state calls an init*() function from its own <script>. The README lists every component with its props and where it is used, and every script with what it does. The sections that make up a page are one level up, in src/components/sections/, and are listed in Pages and sections.

The 17 icons (the Phosphor shapes and the LinkedIn mark) are stored as path data in src/design-system/components/icons/paths.ts; <Icon name="arrow-right" /> draws one in the current text colour. To add one:

  1. Open the icon on phosphoricons.com and copy the SVG.

  2. Take the d="…" of its <path>.

  3. Add a line to iconPaths:

    "my-icon": "M128,24A104,104,0,1,0,…",

Then use <Icon name="my-icon" class="size-5" />. Paths use a 256 × 256 grid, which is what Phosphor exports. Two things to know:

  • If you keep the style guide, add the new name to icons in src/components/style-guide/tokens.ts too: that list is exhaustive on purpose, so npm run check reports it until you do.
  • The four icons of the cards on Home and About and the four of the Careers cards are chosen by name in src/content/pages/home.json, about.json and careers.json: use any name of paths.ts. npm run check doesn’t check those names (the pages read them under a type assertion), so a name that doesn’t exist only shows up when the page is rendered: the build stops on it.