Design System
Spark's design system is the shared foundation for every site in the monorepo. It packages design tokens, semantic roles, and ready-made utilities for colour, typography, spacing, surfaces, and motion so designers and developers work from the same source of truth. Import @spark/design-system once in your root layout, then apply CSS variables, Tailwind classes, or named utility classes across pages and components.
This styleguide walks through those foundations with live demos — browse tokens, semantic roles, and utility classes, then see them applied on real components. Tokens originate in @spark/design-system, flow into Tailwind v4's @theme layer, and reach each app from there, keeping web and studio visually aligned without maintaining parallel CSS.
Import
@spark/design-systemStructure
tokenssemanticbaseutilitiesApply
text-displaybtn-primarypage-xBrowse
Foundations
Tokens, utilities, and patterns shared across every Spark site. Pick a section to browse values, classes, and usage notes.
Colors
The colour system centres on a cool zinc grey scale from white to near-black. Lighter steps suit backgrounds, borders, and subtle fills; darker steps carry text hierarchy and emphasis, while the semantic roles below map UI parts to consistent colours. In code, use bg-neutral-* and text-neutral-* utilities, --color-neutral-* from tokens.css, or named roles from semantic.css.
Neutral palette
Thirteen steps from white to near-black. Lighter shades suit backgrounds and borders; darker shades carry text and emphasis. Copy an OKLCH value or use --color-neutral-{step} with matching Tailwind classes.
--color-black--color-white--color-neutral-50--color-neutral-100--color-neutral-200--color-neutral-300--color-neutral-400--color-neutral-500--color-neutral-600--color-neutral-700--color-neutral-800--color-neutral-900--color-neutral-950Semantic colors
Named roles tie UI parts to the palette so themes stay consistent. Apply bg-background, text-foreground, border-border, or the --color-* variables in semantic.css.
--color-background→ white--color-foreground→ neutral-900--color-muted→ neutral-500--color-muted-subtle→ neutral-400--color-border→ neutral-200--color-border-subtle→ neutral-100Typography
A responsive type scale separates hero headlines from body copy and labels. Apply text-display, text-heading, text-body, and siblings, or rely on base h1–h6 styles from base.css.
Type scale
Each step has a clear job. Display draws attention, body carries reading text, and labels organise metadata. Pick the utility that matches the content role.
text-display3rem → 4.8remsemiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-heading2.4rem → 3.6remsemiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-title1.8remnormal weightLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-body-lg2remnormal weightLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-body1.6rem → 1.8remLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-caption1.4remLorem ipsum dolor sit amet, consectetur adipiscing elit.
text-label1.2remuppercase, widest trackingLorem ipsum dolor sit amet, consectetur adipiscing elit.
HTML headings
Use semantic h1–h6 tags for accessible document outline. base.css gives every heading the same sans face, semibold weight, and tight leading; font size is not set there. Add a Tailwind text utility on the token scale below (text-4xl on h1 down to text-base on h6) to step from page title to the smallest section label. Each specimen lists the paired class with rem and px sizes.
<h1>text-4xl2.25rem / 36px--text-4xllh 1.11semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
<h2>text-3xl1.875rem / 30px--text-3xllh 1.2semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
<h3>text-2xl1.5rem / 24px--text-2xllh 1.33semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
<h4>text-xl1.25rem / 20px--text-xllh 1.4semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
<h5>text-lg1.125rem / 18px--text-lglh 1.56semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
<h6>text-base1rem / 16px--text-baselh 1.5semiboldLorem ipsum dolor sit amet, consectetur adipiscing elit.
Surfaces
Surfaces are layered backgrounds that set section mood and keep typography readable. Most pages read on bg-background with text-foreground; cards and headers step up to bg-white with border-border, while sidebars and secondary chrome stay quieter on muted fills such as bg-neutral-100. When a footer, feature band, or CTA needs more presence, reach for surface-dark. The layout demos below show how those layers stack on light and dark pages — hover a region to reveal its tokens.
Light surfaces
bg-backgroundtext-foregroundbg-backgroundDark surfaces
bg-backgroundtext-foregroundbg-backgroundSpacing & layout
A numbered scale keeps padding and gaps consistent across breakpoints. Use Tailwind spacing utilities (gap-200, m-100, p-300, space-x-150) or --spacing-* CSS variables; grid gap and margin tokens (--spacing-grid-gap, --spacing-grid-margin) are listed under Grid spacing — apply page-x for responsive horizontal page gutters.
--spacing-00px--spacing-251px--spacing-502px--spacing-754px--spacing-1008px--spacing-15012px--spacing-20016px--spacing-30024px--spacing-40032px--spacing-45044px--spacing-50048px--spacing-60064px--spacing-70080px--spacing-80096px--spacing-900128px--spacing-grid-gap16pxgap-grid-gap--spacing-grid-margin16pxpx-grid-margin, mx-grid-marginMotion
Motion should feel immediate and intentional, clarifying change without slowing frequent interactions. A three-step duration scale (fast, normal, slow) works with purpose-built easing curves (--duration-* and --ease-*): ease-out for enters and exits, ease-in-out for reversible states, ease-drawer for sliding panels. The live demo below lets you compare pacing and curves side by side.
Tokens
Semantic duration names map to interaction types. Easing curves are custom — stronger than built-in CSS easings.
--duration-fast150msButton press, tooltips, micro-feedback
--duration-normal200msDropdowns, hovers, color transitions
--duration-slow300msModals, drawers, panel transitions
--ease-outcubic-bezier(0.23, 1, 0.32, 1)Default for enters and exits — starts fast, feels responsive
--ease-in-outcubic-bezier(0.77, 0, 0.175, 1)On-screen movement and morphing between positions
--ease-drawercubic-bezier(0.32, 0.72, 0, 1)Drawers and sheet transitions (iOS-like curve)
Live demo
Interactive examples — press feedback, duration pacing, and easing comparison. Respects prefers-reduced-motion.
Hold the button — transform scales to 0.97 with duration-fast and ease-out. Specify exact properties, never transition: all.
Press Replay — all three tracks fill together with the same ease-out curve. Each row uses a different duration token so 150ms finishes before 200ms, then 300ms.
duration-fast150msduration-normal200msduration-slow300msTime maps to progress on the curve. Compare how each easing moves the traveler on the same track.
cubic-bezier(0.23, 1, 0.32, 1)Starts fast, settles gently
Default for enters and exits — elements arrive with energy, then decelerate into place.
Linear time →
Transform animations use motion-safe: so they respect prefers-reduced-motion. Keep opacity and color transitions that aid comprehension.