Design — Kendi 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 components and the icons.
See everything first
Section titled “See everything first”Run npm run dev and open http://localhost:4321/style-guide. It shows the colours, the text styles, the logo, the
buttons and links, the menu parts, the meta line, every post card, the category, team, Instagram and ad cards, the
slideshows, the forms with their states and rich text, each with its name. When you want to know what a change will
affect, look there.

Colours
Section titled “Colours”src/design-system/theme.css:
@theme { --color-black: #000000; /* headings, links, buttons */ --color-grey: #3d3d3d; /* body copy, meta, labels, the hover colour of titles and menu links */ --color-white: #ffffff; /* cards, the header */ --color-paper: #f5f5f5; /* the page background, the newsletter band */ --color-line: #dedede; /* hairlines: fields, the footer rule, the menu divider, the checkbox */ --color-charcoal: #333333; /* the submit button's hover and pressed fill */ --color-error: #ff2244; /* "Something went wrong" (its fill is the same red at 15 %) */ --color-focus: #5a5a5a; /* the hairline of a focused form field */ --color-spinner: #999999; /* the ring of the loader on Articles */}Each name becomes a Tailwind class: bg-paper, text-grey, border-line. Swap the hex values for your own palette and
the site changes. Kendi is black and white by design: a brand colour usually goes into black (buttons, pills, links)
or the page background paper. Faded colours are opacity modifiers on a token: black/50 is the veil on the category
tiles, black/30 and black/80 the veils on photos with text. They follow the palette when you change the colour.
Keep body text on its background at 4.5 : 1 or more: Grey on Paper is about 10 : 1 in the demo.
A few colours sit outside the tokens, so change them too when you change a colour:
| Colour | Where |
|---|---|
| The logo, a black wordmark | src/assets/images/logo.svg |
| The browser icon | public/icon.svg, public/apple-icon.png |
The logo is an image file, src/assets/images/logo.svg (340 × 100), named in logo in src/content/site.json and drawn by
src/design-system/components/brand/Logo.astro at 85 × 25 px in the header and the sidebar, and 102 × 30 in the footer
(size="lg"). To use your own, replace the file (an SVG or a PNG twice the size shown) and keep its proportions, or
change the sizes in Logo.astro. The logo sits on white and on the light grey page, so a dark logo reads everywhere. Its
name for screen readers is logo.alt.
The template ships Inter as one variable font file, src/assets/fonts/inter-latin-variable.woff2 (every weight and its
optical-size axis), loaded with the Astro Fonts API in astro.config.mjs:
fonts: [ { provider: fontProviders.local(), name: "Inter", cssVariable: "--font-inter", options: { variants: [{ weight: "100 900", style: "normal", src: ["./src/assets/fonts/inter-latin-variable.woff2"] }] }, fallbacks: ["Inter Fallback", "sans-serif"], optimizedFallbacks: false, },],src/layouts/Layout.astro puts it in every page’s head, and “Inter Fallback” (Arial adjusted to Inter’s metrics, in
theme.css) keeps the page from shifting while it loads. The text styles pin that axis at 14, the text
cut of Inter, for every size (written as [font-variation-settings:'opsz'_14] in src/design-system/tokens/text.ts),
so big headings don’t switch to the display cut. theme.css makes --font-inter the site font (--font-sans). The
template uses the weights 500 (text and buttons) and 600 (headings and the menu).
To use another font, put its file in src/assets/fonts/ and change name and src (keep cssVariable), or use a
Google font with provider: fontProviders.google() and name: "Manrope" (Astro downloads it when the site builds). A
font that isn’t variable needs one variant per weight (500 and 600). Without an optical-size axis, the
font-variation-settings in the text styles simply do nothing. Astro serves the font from your own domain either way;
remove the “Inter Fallback” @font-face from theme.css or adjust it to the new font.
Text styles
Section titled “Text styles”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 |
|---|---|---|---|---|
h1 |
48 | 58 | 72 | The Home hero’s title |
h2 |
28 | 32 | 34 | Block titles (“Editor’s pick”, “Meet the Team”) |
h3 |
30 | 36 | 42 | Every page title but Home’s, “Related Post” |
rich |
24 | 26 | 28 | Headings in a post or a legal text |
h4 |
22 | 22 | 24 | Large card titles, a post’s level-3 headings |
h5 |
18 | 18 | 18 | Card titles |
h6 |
16 | 16 | 16 | Small card titles, the sidebar’s titles |
menu |
15 | 15 | 15 | The header’s links |
button |
15 | 15 | 15 | Buttons |
body |
16 | 16 | 16 | Leads, paragraphs, rich text |
small |
14 | 14 | 14 | Card text, the meta line, the breadcrumb, labels |
tiny |
12 | 12 | 12 | The consent line, the ad’s label |
Headings and the menu are weight 600 with −0.03em letter spacing, buttons 500 at −0.03em, the paragraph styles 500 at
−0.02em. Change the numbers in text.ts rather than in the components, and text stays consistent across the site. Use
a style as className={text.h2} or combine: className={cn(text.small, "text-grey")}.
Breakpoints and spacing
Section titled “Breakpoints and spacing”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 1200 px wide. The side padding is 15 px on phones, 20 px on tablets and 30 px on desktops, and most
sections have 30 / 40 / 50 px above and below (sectionGutters and sectionPadding in
src/design-system/components/layout/Section.astro). On desktops, Home and the post pages put a 350 px sidebar 50 px
beside the main column (WithSidebar); it stays in view as you scroll, 120 px from the top. Below 1200 px the sidebar
follows the column. The header is fixed at the top, 65 px tall on phones and 82 px from tablets up
(Pages and sections).
Motion
Section titled “Motion”src/design-system/tokens/motion.ts holds the transitions, for Motion:
| Token | Values | Used for |
|---|---|---|
spring |
no bounce, 0.4 s | Every hover and state change: photos growing, labels rolling up, arrows, underlines |
springBounce |
bounce 0.2, 0.4 s | The Categories menu panel, the hamburger’s lines, the social icons’ fade |
slideSpring |
stiffness 200, damping 40 | The hero slideshow and the Inspiration carousel stepping |
slideInterval |
8 s | How often both slideshows turn by themselves |
menuColumns, menuColumnsOffset |
tween 0.4 s, from 20 px left | The Categories menu’s two columns sliding in |
formTween |
0.2 s | The submit button’s fill and label |
theme.css holds the same curves as CSS for what runs without Motion (--ease-spring, --ease-spring-bounce,
--ease-spring-slow for the newsletter band’s photos, --ease-spring-long for the footer’s photo grid,
--ease-framer); hovers run in CSS with them. The scripts in src/design-system/scripts/ (the menus, the slideshows, the forms) read the
tokens of motion.ts.
| Effect | Where to change it |
|---|---|
| The slideshows turn every 8 s | slideInterval in tokens/motion.ts |
| The Categories menu opens on hover (desktop) | src/components/site/Header.astro and header.ts, CategoriesMenu.astro in navigation/ |
| Articles loads six posts at a time | list.pageSize in src/content/pages/blog.json |
| The sidebar stays in view on desktop | WithSidebar in src/design-system/components/layout/ |
| The newsletter band’s photos straighten on hover | PhotoStack.astro in src/design-system/components/media/ |
Reduced motion
Section titled “Reduced motion”With “reduce motion” switched on in the visitor’s system, movement is left out: the slideshows don’t turn by themselves,
the scripts skip their animations, and the hover movements are switched off in CSS
(motion-reduce:transition-none). Colour changes stay.
Corners, shadows, spacing
Section titled “Corners, shadows, spacing”Corners are 10 px on cards and photos, 5 px on buttons, pills and fields, and 2 px on the checkbox. Author photos are
round. One shadow, --shadow-menu in theme.css, lifts the Categories menu. Spacing is Tailwind classes on the
components (gap-5, p-5, gap-[50px]); Tailwind’s scale is 4 px per step, so gap-5 is 20 px.
Components
Section titled “Components”src/design-system/components/ holds the logo, the buttons and links, the menu parts and the Categories menu, the
breadcrumb, the section layout and the sidebar layout, the meta line and social icons, the post cards (five looks), the
category, team, Instagram and ad cards, the slideshow and the photo stack, the forms, rich text and the loader of
Articles. Its README lists every component with its props and where it is used. The
sections that make up a page are one level up, in src/components/sections/, and are listed in
Pages and sections.
The arrows, the carets and the calendar are Phosphor path data in
src/design-system/components/icons/paths.ts; the X, Instagram and Facebook marks are drawn there too. <Icon name="arrowRight" /> (Icon.astro) draws one in the current text colour.
To add an icon:
-
Open the icon on phosphoricons.com and copy the SVG.
-
Take the
d="…"of its<path>. -
Add a line to
iconPaths:bookmark: "M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,…",
Then use <Icon name="bookmark" className="size-5" />. Phosphor paths use a 256 × 256 grid. The style guide shows the
icons in use.