Layers

9 cascade layers, ordered weakest → strongest. Each has a single responsibility.

@layer reset, props, theme, color, typography, composition, layout, components, overrides;

Normalize browser defaults. Box-sizing, margin removal, media defaults.

RuleEffect
*, *::before, *::afterbox-sizing: border-box, margin: 0
img, svg, video, canvasdisplay: block, max-width: 100%
input, button, textarea, selectfont: inherit
bodymin-height: 100dvh, text-rendering: optimizeLegibility

Static design constants. Font stacks, system references. Never change at runtime.

PropertyValue
--font-system-uisystem-ui, sans-serif
--font-monospace-codeui-monospace, monospace

Brand configuration. Fluid scaling ratios, viewport range, font roles. Override these to re-theme.

VariableDefaultPurpose
--_fluid-min-vp22.5remviewport floor (360px)
--_fluid-max-vp77.5remviewport ceiling (1240px)
--_type-min1.125rembase size @ mobile
--_type-max1.25rembase size @ desktop
--_type-min-ratio1.2scale ratio @ mobile
--_type-max-ratio1.25scale ratio @ desktop
--_space-min0.5rembase space @ mobile
--_space-max0.75rembase space @ desktop
--_space-min-ratio1.4space ratio @ mobile
--_space-max-ratio1.65space ratio @ desktop
--_font-headingsystem-uiheading font family
--_font-bodysystem-uibody font family
--_font-monoui-monospacecode font family

OS preference detection. Sets --_dark, --_motion, and user preference scales.

DetectionAttributeSets
Dark modedata-ui-scheme="dark"--_dark: 1
Reduced motiondata-ui-motion="none"--_motion: 0
Compact densitydata-ui-density="compact"--_space-scale: 0.75
Comfortabledata-ui-density="comfortable"--_space-scale: 1.25
Small typedata-ui-size="small"--_type-scale: 0.85
Large typedata-ui-size="large"--_type-scale: 1.15

The sentinel pattern. --_type activates fluid font-size, tracking, and leading only where set.

Selector--_typeNotes
body0base size, body font, bg + text color
h15heading font family, contrast 0.92
h24
h33
h42
h51
small-1
code, premono font, 0.85em

Context-free layout primitives. Work anywhere, nest freely.

ClassBehaviorKey variable
.stackvertical flex, gap--_gap
.rowhorizontal flex, gap--_gap
.gridauto-fit grid, min column width--_col, --_gap
.splitspace-between flex--_gap
.flanksidebar + fluid main--_flank, --_gap
ModifierEffect
.ai-center, .ai-start, .ai-end, .ai-baseline, .ai-stretchalign-items
.jc-center, .jc-between, .jc-endjustify-content
.spangrid-column: 1 / -1
.wrap, .nowrapflex-wrap control

Page-level semantic regions. CSS grid areas with responsive breakpoints.

ClassGrid areasBreakpoint
.layout-docnav, sidebar, main, tocsidebar drawer <768px, toc >1024px
.layout-appsidebar, mainsidebar drawer <768px
.layout-stackheader, main, footersingle column always
Child classGrid areaVariable
.layout-sidebarsidebar--_sidebar (width, default 16rem)
.layout-mainmainmax-width: 72ch
.layout-navnav
.layout-toctoc--_toc (width, default 14ch)
.layout-togglehidden on desktop, visible on mobile

Styled elements. Each uses the --_bg pattern for auto contrast.

ComponentLocal varsStates
.card--_bg: --surface(1)
button--_bg, --_border, --_shadow:hover, :active
[popover].popover--_bg: --surface(1)anchor positioned, animated
.fabfixed bottom-right, anchor source
input, selectaccent-color: --fill()

Responsive visibility, print, and accessibility helpers.

ClassBehavior
.mobilevisible <768px only
.tabletvisible 768–1024px only
.desktopvisible ≥1024px only
.nphidden in print
.vhvisually hidden, accessible to screen readers
Settings
Color
Scheme
Size
Density
Motion