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-bgThe page background.--color-surfaceCards, panels and other raised areas.--color-textBody text.--color-text-mutedSupporting text such as descriptions.--color-borderBorders and dividers.--color-accentThe brand color for fills and borders.--color-accent-textThe brand color when used as text. Darker in the light theme so it stays readable.--color-secondaryA secondary brand color.--color-tertiaryA tertiary brand color.--color-errorError messages.--color-glassThe 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-darkDark colors inside this element, on any page theme..theme-lightLight colors inside this element, on any page theme..theme-invertThe opposite of the page theme: light on a dark page, dark on a light one. Flips with the theme toggle.dark-tokens, light-tokensSCSS mixins inbase/variablesthat 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.
theme-light
Text, muted text and borders come from the same tokens.
theme-dark
Text, muted text and borders come from the same tokens.
<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-headingThe heading font.--font-bodyThe body font.--font-monoThe mono-spaced font..h1 to .h6Heading styles for any element, so the visual size and the heading level can differ..body, .body-large, .body-smallBody 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.
[ Button - Component ]
A link or a button, depending on whether it has a url. Accepts attachments directly.
Available props:
textA string. Leave it out for an icon-only button and give it atextDescription.textDescriptionA string, the accessible name for screen readers.urlA string. With a url the button is a link (/page,#id,mailto:or a full URL); without one it is a<button>.newTabA boolean. Opens in a new tab and tells screen readers it does.typesolid | outline | underline | text. Defaults tosolid.htmlTypebutton | submit | reset. For the<button>version. Defaults tobutton.sizesm | md | lg. Defaults tomd.disabledA boolean.currentA boolean. Marks the link as the current page (aria-current).expandedA boolean, for buttons that open something (aria-expanded). The end icon flips when true.controlsA string, the id of what the button opens (aria-controls).iconStartAn icon name fromstatic/icons, shown before the text.iconEndAn icon name fromstatic/icons, shown after the text.iconCircleA boolean. Draws a ring around the end icon on hover. Defaults tofalse.iconEndAttachAn attachment for the end icon alone, such asmagnet({ x: 1, y: 1 }), so only the icon follows the mouse.classA string of extra classes.onclickA click handler for the<button>version....restAny other attribute, including attachments:<Button {@attach magnet()} />.
Mixed with attachments
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.scaleis the peak size as a multiple (default1.1),durationis milliseconds (default300).bgFollow()fills the button with color from the pointer outward on hover and back in to where it leaves. Set--bg-follow-colorto change the color.
[ CTA Group - Component ]
A primary and an optional secondary button side by side.
Available props:
primaryAn object of Button props (withouttype). Shown as a solid button. Required.secondaryAn object of Button props (withouttype). Shown as an outline button.justifystart | center. Defaults tostart.
[ Eyebrow - Component ]
The small label above a title, with an optional icon.
Available props:
textA string. The small label above a title.iconAn icon name fromstatic/icons, shown before the text.directionrow | column. How the icon and text sit together. Defaults torow.dotfalse | true | pulse | sonar. A green status dot before the text, for something like "available for freelance".pulse(andtrue) softly fades in and out;sonarsends two rings outward like a signal. Uses--color-success. Defaults tofalse.
[ 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:
nameA string, the field's name, sent with the form. Required.labelA string. It rests inside the field and moves above it once the field is used. Required.typetext | email | tel | number | password | search | url | date | time | textarea | select. Defaults totext. Atelfield keeps digits only.variantunderline | outline. A line under the field, or a full border. Defaults tounderline.requiredA boolean. Defaults totrue; screen readers are told when a field is required.disabledA boolean.hintA string of helper text under the field.errorA string of error text under the field. It also marks the field invalid.maxLengthA number. Limits a textarea and shows how many characters are left.optionsAn array for aselect: strings,{ value, label, disabled }, or{ group, options }for anoptgroup.datalistAn array of strings, native suggestions for a text field.autocompleteA string, the browser autofill hint such asemail.inputmodetext | numeric | tel | email. Which keyboard a phone shows.valueA string, bindable.classA string of extra classes. Fields in a flex row share the width.
Underline
Outline
Form Choice
A checkbox, a radio or a switch with its label. Clicking the label toggles it.
Available props:
nameA string, sent with the form. Required.labelA string. Required.typecheckbox | radio | switch. Defaults tocheckbox.valueA string, what is sent when it is on. A radio needs one. Defaults toon.checkedA boolean, bindable, for a checkbox or switch.groupA string, bindable. For radios sharing aname: the selectedvalue.disabledA boolean.requiredA boolean.
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:
legendA string, the name of the group for screen readers, shown above it. Required.directioncolumn | row. How the choices sit. Defaults tocolumn.disabledA boolean. Disables everything inside.childrenA snippet with the choices inside. Required.
Form Control
The controls that are not text: a range, a color picker, a file input, a progress bar and a meter.
Available props:
typerange | color | file | progress | meter. Required.labelA string. Required.nameA string, sent with the form.valueA number or string, bindable. Forprogressandmetera number frommintomax.minA number. Defaults to0.maxA number. Defaults to100.stepA number, for a range.multipleA boolean, for a file input.acceptA string of file types, for a file input.disabledA boolean.
[ Icon - Component ]
Draws an SVG from static/icons in the current text color, so it follows themes and hover states.
Available props:
nameA string, the icon file name instatic/iconswithout.svg, or a path starting with/to any single-color image (e.g. a CMS upload). Required.labelA string. Gives the icon an accessible name. Without it the icon is hidden from screen readers.sizesm | md | lg. The icon is1emby default (md), so it scales with its text.classA string of extra classes....restAny other attribute for the<span>, such asstyle.
-
check -
chevron-right -
arrow-tr -
new-tab -
copy -
x -
mail -
social-x
[ Logo - Component ]
An image, text, or both, optionally linked.
Available props:
srcA string, the path to one image used in both themes.srcLightA string, the image for the light theme. Use withsrcDark; the right one shows for the theme, and a wide logo keeps its shape (set--logo-height).srcDarkA string, the image for the dark theme.textA string shown beside the image.altA string. The accessible name when there is notext.urlA string. Wraps the logo in a link.tintA 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:
linksAn array of Button props. Add alinksarray (also Button props) to an item to make it a dropdown. Required.labelA string, the accessible name of the navigation. Required.typeA Buttontypefor every link. Defaults tounderline.directionrow | column. In a column, dropdowns open as accordions instead of popovers. Defaults torow.landmarkA boolean. Render a<nav>. Turn off inside something that is already a<nav>. Defaults totrue.classA string of extra classes.
Row
Column
[ 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:
eyebrowTextA string for the eyebrow.eyebrowIconAn icon name for the eyebrow.eyebrowDirectionrow | column. Defaults torow.eyebrowDotfalse | true | pulse | sonar. A green status dot before the eyebrow. Defaults tofalse.titleA string.titleAttachAn attachment for the title heading, e.g.textIntro()for a heading that plays on load.descriptionAttachAn attachment for the description, e.g.textReveal({ from: 'top' })for a description that reveals later.level1 | 2 | 3 | 4 | 5 | 6. The heading level of the title. A page hero is1, other sections2. Defaults to2.titleStyleh1 | h2 | h3 | h4 | h5 | h6. Looks like another heading size without changing the level.descriptionA string, or a snippet for rich content such as links.ctaAn object with aprimaryand optionalsecondaryButton (see CTA Group).layoutcolumn | row.rowputs the description beside the eyebrow and title and stacks below the md breakpoint. Defaults tocolumn.alignstart | center. Defaults tostart.rowAlignstart | center | end. How the two sides line up in a row layout. Defaults tostart.showEyebrowA boolean. Defaults totrue.showTitleA boolean. Defaults totrue.showDescriptionA boolean. Defaults totrue.showCtaA boolean. Defaults totrue.
Show and hide
Centered
Row: description beside the title
Row, lined up at the bottom
[ Site Nav Button - Component ]
The button that opens the mobile navigation. Click the toggle to see the open state.
Available props:
symbolburger | 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 toburger.shapesquare | round. Defaults tosquare.typeicon | button.buttonputs the symbol in a bordered box. Defaults toicon.textA string shown beside the symbol, e.g.menu.expandedA boolean. The open state; the burger turns into an X.controlsA string, the id of the navigation it opens (aria-controls)....restAny other button attribute, such asonclick.
[ 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:
linksAn array of{ title, url, icon }. The icon is a name fromstatic/iconsor an image path such as/uploads/social-x.svg. Required.labelA string, the accessible name of the list. Defaults toSocial media.solidA 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 tofalse.
[ Tag - Component ]
A small pill for labels and status.
Available props:
textA string. Required.iconAn icon name fromstatic/icons, shown before the text.typesolid | outline | glass. Defaults tosolid.classA string of extra classes.
[ 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:
variantsolid | underline. A block behind the selected option (with a frame around the row), or a line under it. Defaults tosolid.triggerclick | hover.clickmoves the slider to the option that becomes selected.hoveralso follows the pointer and keyboard focus, and goes back to the selected option when it leaves. Defaults toclick.optionsA string, a selector for the options inside the element. Defaults to its direct children, except a<legend>.