Resources

Style guide

Colors, type and the base components every site starts from.

[ Colors - Tokens ]

CSS custom properties set on the root. The light theme overrides them with data-theme on html, so use the variable and never a fixed color.

Available props:

  • --color-bg The page background.
  • --color-surface Cards, panels and other raised areas.
  • --color-text Body text.
  • --color-text-muted Supporting text such as descriptions.
  • --color-border Borders and dividers.
  • --color-accent The brand color for fills and borders.
  • --color-accent-text The brand color when used as text. Darker in the light theme so it stays readable.
  • --color-secondary A secondary brand color.
  • --color-tertiary A tertiary brand color.
  • --color-error Error messages.
  • --color-glass The translucent tint behind glass surfaces such as the header.
  • --color-bg
  • --color-surface
  • --color-text
  • --color-text-muted
  • --color-border
  • --color-accent
  • --color-accent-text
  • --color-secondary
  • --color-tertiary
  • --color-error

[ Theme Surfaces - Tokens ]

Add one class to a section or any wrapper and everything inside follows its own theme: the background, text, borders and buttons all flip together. Use theme-invert for a band that is always the opposite of the page, so it is light while you work in dark and dark when a visitor switches to light.

Available props:

  • .theme-dark Dark colors inside this element, on any page theme.
  • .theme-light Light colors inside this element, on any page theme.
  • .theme-invert The opposite of the page theme: light on a dark page, dark on a light one. Flips with the theme toggle.
  • dark-tokens, light-tokens SCSS mixins in base/variables that set every themed token. Use them to build a surface of your own.

theme-invert (opposite of the page)

Text, muted text and borders come from the same tokens.

Tag
A raised surface

theme-light

Text, muted text and borders come from the same tokens.

Tag
A raised surface

theme-dark

Text, muted text and borders come from the same tokens.

Tag
A raised surface
<section class="theme-invert">…</section>

.promo {
	@use 'base/variables';
	@include variables.light-tokens;
	background: var(--color-bg);
}

Canvas backgrounds that read data-theme follow the page theme, not the surface.

[ Typography - Tokens ]

Headings take their styles from the element, or from a .h1 to .h6 class on any element, so size and heading level can differ.

Available props:

  • --font-heading The heading font.
  • --font-body The body font.
  • --font-mono The mono-spaced font.
  • .h1 to .h6 Heading styles for any element, so the visual size and the heading level can differ.
  • .body, .body-large, .body-small Body text sizes.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

Body large. The quick brown fox jumps over the lazy dog.

Body. The quick brown fox jumps over the lazy dog.

Body small. The quick brown fox jumps over the lazy dog.

A text link

[ Button - Component ]

A link or a button, depending on whether it has a url. Accepts attachments directly.

Available props:

  • text A string. Leave it out for an icon-only button and give it a textDescription.
  • textDescription A string, the accessible name for screen readers.
  • url A string. With a url the button is a link (/page, #id, mailto: or a full URL); without one it is a <button>.
  • newTab A boolean. Opens in a new tab and tells screen readers it does.
  • type solid | outline | underline | text. Defaults to solid.
  • htmlType button | submit | reset. For the <button> version. Defaults to button.
  • size sm | md | lg. Defaults to md.
  • disabled A boolean.
  • current A boolean. Marks the link as the current page (aria-current).
  • expanded A boolean, for buttons that open something (aria-expanded). The end icon flips when true.
  • controls A string, the id of what the button opens (aria-controls).
  • iconStart An icon name from static/icons, shown before the text.
  • iconEnd An icon name from static/icons, shown after the text.
  • iconCircle A boolean. Draws a ring around the end icon on hover. Defaults to false.
  • iconEndAttach An attachment for the end icon alone, such as magnet({ x: 1, y: 1 }), so only the icon follows the mouse.
  • class A string of extra classes.
  • onclick A click handler for the <button> version.
  • ...rest Any other attribute, including attachments: <Button {@attach magnet()} />.

Mixed with attachments

Solid custom 2
Outline custom
  • underline() draws a line under the label that slides away on hover, the same effect as the underline Button type, for mixing into other types. It uses the label's text color and takes no options.
  • buttonJump({ scale, duration }) pops the button up and back once when the mouse enters or the keyboard focuses it. scale is the peak size as a multiple (default 1.1), duration is milliseconds (default 300).
  • bgFollow() fills the button with color from the pointer outward on hover and back in to where it leaves. Set --bg-follow-color to change the color.

[ CTA Group - Component ]

A primary and an optional secondary button side by side.

Available props:

  • primary An object of Button props (without type). Shown as a solid button. Required.
  • secondary An object of Button props (without type). Shown as an outline button.
  • justify start | center. Defaults to start.

[ Eyebrow - Component ]

The small label above a title, with an optional icon.

Available props:

  • text A string. The small label above a title.
  • icon An icon name from static/icons, shown before the text.
  • direction row | column. How the icon and text sit together. Defaults to row.
  • dot false | true | pulse | sonar. A green status dot before the text, for something like "available for freelance". pulse (and true) softly fades in and out; sonar sends two rings outward like a signal. Uses --color-success. Defaults to false.
Text only
With icon
Available for freelance
Available for freelance

[ Form Components - Component ]

The pieces a form is built from. Fields come in two looks, an underline and a full border, set with variant on each field or once on a whole Form. Checkboxes, radios and switches look the same everywhere. All of them work with the keyboard and screen readers.

Form Field

One label and one control, covering every text-like input, a textarea and a select.

Available props:

  • name A string, the field's name, sent with the form. Required.
  • label A string. It rests inside the field and moves above it once the field is used. Required.
  • type text | email | tel | number | password | search | url | date | time | textarea | select. Defaults to text. A tel field keeps digits only.
  • variant underline | outline. A line under the field, or a full border. Defaults to underline.
  • required A boolean. Defaults to true; screen readers are told when a field is required.
  • disabled A boolean.
  • hint A string of helper text under the field.
  • error A string of error text under the field. It also marks the field invalid.
  • maxLength A number. Limits a textarea and shows how many characters are left.
  • options An array for a select: strings, { value, label, disabled }, or { group, options } for an optgroup.
  • datalist An array of strings, native suggestions for a text field.
  • autocomplete A string, the browser autofill hint such as email.
  • inputmode text | numeric | tel | email. Which keyboard a phone shows.
  • value A string, bindable.
  • class A string of extra classes. Fields in a flex row share the width.

Underline

We never share your email.

Enter a valid email address.

Outline

We never share your email.

Enter a valid email address.

Form Choice

A checkbox, a radio or a switch with its label. Clicking the label toggles it.

Available props:

  • name A string, sent with the form. Required.
  • label A string. Required.
  • type checkbox | radio | switch. Defaults to checkbox.
  • value A string, what is sent when it is on. A radio needs one. Defaults to on.
  • checked A boolean, bindable, for a checkbox or switch.
  • group A string, bindable. For radios sharing a name: the selected value.
  • disabled A boolean.
  • required A boolean.
Checkboxes
Radios
Switches

Form Group

A fieldset and legend around related choices, so a screen reader announces what the options belong to. It is the heading above each group of choices here.

Available props:

  • legend A string, the name of the group for screen readers, shown above it. Required.
  • direction column | row. How the choices sit. Defaults to column.
  • disabled A boolean. Disables everything inside.
  • children A snippet with the choices inside. Required.
Contact me by

Form Control

The controls that are not text: a range, a color picker, a file input, a progress bar and a meter.

Available props:

  • type range | color | file | progress | meter. Required.
  • label A string. Required.
  • name A string, sent with the form.
  • value A number or string, bindable. For progress and meter a number from min to max.
  • min A number. Defaults to 0.
  • max A number. Defaults to 100.
  • step A number, for a range.
  • multiple A boolean, for a file input.
  • accept A string of file types, for a file input.
  • disabled A boolean.
70
65

[ Icon - Component ]

Draws an SVG from static/icons in the current text color, so it follows themes and hover states.

Available props:

  • name A string, the icon file name in static/icons without .svg, or a path starting with / to any single-color image (e.g. a CMS upload). Required.
  • label A string. Gives the icon an accessible name. Without it the icon is hidden from screen readers.
  • size sm | md | lg. The icon is 1em by default (md), so it scales with its text.
  • class A string of extra classes.
  • ...rest Any other attribute for the <span>, such as style.
  • check
  • chevron-right
  • arrow-tr
  • new-tab
  • copy
  • x
  • mail
  • social-x

[ Logo - Component ]

An image, text, or both, optionally linked.

Available props:

  • src A string, the path to one image used in both themes.
  • srcLight A string, the image for the light theme. Use with srcDark; the right one shows for the theme, and a wide logo keeps its shape (set --logo-height).
  • srcDark A string, the image for the dark theme.
  • text A string shown beside the image.
  • alt A string. The accessible name when there is no text.
  • url A string. Wraps the logo in a link.
  • tint A boolean. For single-color SVGs: draws the image in the text color so it follows light and dark themes.

[ Menu Links - Component ]

A list of links with dropdowns: popovers in a row, accordions in a column. The header and footer use it.

Available props:

  • links An array of Button props. Add a links array (also Button props) to an item to make it a dropdown. Required.
  • label A string, the accessible name of the navigation. Required.
  • type A Button type for every link. Defaults to underline.
  • direction row | column. In a column, dropdowns open as accordions instead of popovers. Defaults to row.
  • landmark A boolean. Render a <nav>. Turn off inside something that is already a <nav>. Defaults to true.
  • class A string of extra classes.

[ Section Copy - Component ]

The eyebrow, title, description and buttons that open most sections. Spacing comes from --space-eyebrow-title, --space-title-paragraph and --space-paragraph-cta-group.

Available props:

  • eyebrowText A string for the eyebrow.
  • eyebrowIcon An icon name for the eyebrow.
  • eyebrowDirection row | column. Defaults to row.
  • eyebrowDot false | true | pulse | sonar. A green status dot before the eyebrow. Defaults to false.
  • title A string.
  • titleAttach An attachment for the title heading, e.g. textIntro() for a heading that plays on load.
  • descriptionAttach An attachment for the description, e.g. textReveal({ from: 'top' }) for a description that reveals later.
  • level 1 | 2 | 3 | 4 | 5 | 6. The heading level of the title. A page hero is 1, other sections 2. Defaults to 2.
  • titleStyle h1 | h2 | h3 | h4 | h5 | h6. Looks like another heading size without changing the level.
  • description A string, or a snippet for rich content such as links.
  • cta An object with a primary and optional secondary Button (see CTA Group).
  • layout column | row. row puts the description beside the eyebrow and title and stacks below the md breakpoint. Defaults to column.
  • align start | center. Defaults to start.
  • rowAlign start | center | end. How the two sides line up in a row layout. Defaults to start.
  • showEyebrow A boolean. Defaults to true.
  • showTitle A boolean. Defaults to true.
  • showDescription A boolean. Defaults to true.
  • showCta A boolean. Defaults to true.

Show and hide

Eyebrow

A title for the section

A short description that supports the title and tells the visitor what to expect next.

Centered

Eyebrow

A title for the section

A short description that supports the title and tells the visitor what to expect next.

Row: description beside the title

Eyebrow

A title for the section

A short description that supports the title and tells the visitor what to expect next.

Row, lined up at the bottom

Eyebrow

A title for the section

A short description that supports the title and tells the visitor what to expect next.

[ Site Nav Button - Component ]

The button that opens the mobile navigation. Click the toggle to see the open state.

Available props:

  • symbol burger | oreo | stairs | chocolate | kebab. Two lines, two lines with rounded outer corners that twirl into the X, three stepped lines (short, long, short) that form the X, nine dots, or three vertical dots that turn into an X of five. Defaults to burger.
  • shape square | round. Defaults to square.
  • type icon | button. button puts the symbol in a bordered box. Defaults to icon.
  • text A string shown beside the symbol, e.g. menu.
  • expanded A boolean. The open state; the burger turns into an X.
  • controls A string, the id of the navigation it opens (aria-controls).
  • ...rest Any other button attribute, such as onclick.

[ Smooth Scroll - Component ]

Smooth scrolling with Lenis. It takes no props: mount it once in the site layout. Add data-lenis-prevent to anything that must scroll natively, such as a modal. To remove it, delete the component, its tag in the layout, and run bun remove lenis.

[ Social Links - Component ]

A row of icon links to social profiles, each opening in a new tab.

Available props:

  • links An array of { title, url, icon }. The icon is a name from static/icons or an image path such as /uploads/social-x.svg. Required.
  • label A string, the accessible name of the list. Defaults to Social media.
  • solid A boolean. Puts each icon in a box in the solid Button style: the accent color with the on-accent icon, emptying to an outline on hover. Defaults to false.

[ Tag - Component ]

A small pill for labels and status.

Available props:

  • text A string. Required.
  • icon An icon name from static/icons, shown before the text.
  • type solid | outline | glass. Defaults to solid.
  • class A string of extra classes.
Solid Outline Glass With icon

[ Toggle Slider - Attachment ]

A slider that glides behind the selected one of a row of options: tabs, links, buttons or radio labels. The attachment adds the slider itself and follows whichever option is selected, by aria-selected, aria-current, a checked radio or a click. The Theme Toggle and the Tabs combo use it, so it mixes with other concepts. With trigger: 'hover' the slider also follows the pointer and returns when it leaves.

Available props:

  • variant solid | underline. A block behind the selected option (with a frame around the row), or a line under it. Defaults to solid.
  • trigger click | hover. click moves the slider to the option that becomes selected. hover also follows the pointer and keyboard focus, and goes back to the selected option when it leaves. Defaults to click.
  • options A string, a selector for the options inside the element. Defaults to its direct children, except a <legend>.

Solid, moves on click Tab key

Underline, with links Tab key

Solid, following the pointer Tab key

Radio labels Arrow keys

Size