Foundations
Tokens
Semantic names, one source of truth. Every value below is read from the live CSS custom properties.
How tokens work#
Tokens are CSS custom properties prefixed --ha-. Structure tokens (type, space, radius, motion, z-index, breakpoints, containers) are the same for every brand. Color tokens come in a set per brand and theme. The same values are in tokens.json and typed in tokens.d.ts.
.card {
background: var(--ha-surface);
color: var(--ha-text);
border-radius: var(--ha-radius-card);
box-shadow: var(--ha-shadow-raised);
transition: translate var(--ha-dur-slow) var(--ha-ease);
}Color#
Each panel is a live scope with its own theme and brand. The ratios are computed in your browser from the resolved values, using the same function the test suite uses. A ratio judges a token against the page canvas, or for on-accent, against the fill.
Origin brand#
Origin, light
Surfaces
--ha-canvas#fafaf9--ha-surface#ffffff--ha-surface-2#f5f3f1--ha-raised#ffffff--ha-raised-hover#faf7f4--ha-glass#ffffff--ha-sunkenrgba(12, 10, 9, 0.05)--ha-header-glassrgba(255, 255, 255, 0.94)Lines
--ha-border#e2ded9--ha-border-strong#cfc9c2--ha-edge#cfc9c2--ha-glass-edgergba(10, 10, 10, 0.08)Text
--ha-text#0c0a0918.92:1--ha-text-strong#0c0a0918.92:1--ha-muted#44403c9.84:1--ha-faint#57534e7.30:1Accent
--ha-accent-fill#c2410cFills with on-accent content--ha-accent-fill-hover#9a3412--ha-on-accent#ffffffContent on accent-fill5.18:1--ha-accent-text#c2410c4.96:1--ha-accent#ff4d00Decoration only--ha-accent-hover#e64500Decoration only--ha-accent-light#ff8c42Decoration only--ha-accent-ink#0a0a0aLegacy: text on the saturated accentSignals and ambient
--ha-danger#b91c1c6.19:1--ha-success#15803d4.80:1--ha-focus-ring#c2410c4.96:1--ha-ember#ffe4d6--ha-glow#8b5cf6--ha-teal#14b8a6Origin, dark
Surfaces
--ha-canvas#0a0a0a--ha-surface#111111--ha-surface-2#161210--ha-raisedrgba(255, 255, 255, 0.07)--ha-raised-hoverrgba(255, 255, 255, 0.12)--ha-glassrgba(255, 255, 255, 0.045)--ha-sunkenrgba(0, 0, 0, 0.35)--ha-header-glassrgba(17, 17, 17, 0.85)Lines
--ha-border#262626--ha-border-strong#333338--ha-edgergba(255, 255, 255, 0.12)--ha-glass-edgergba(255, 255, 255, 0.08)Text
--ha-text#fafafa18.97:1--ha-text-strong#fafafa18.97:1--ha-muted#b8b8b89.98:1--ha-faint#9a9a9a7.04:1Accent
--ha-accent-fill#c2410cFills with on-accent content--ha-accent-fill-hover#9a3412--ha-on-accent#ffffffContent on accent-fill5.18:1--ha-accent-text#ff8c428.56:1--ha-accent#ff4d00Decoration only--ha-accent-hover#ff6a26Decoration only--ha-accent-light#ff8c42Decoration only--ha-accent-ink#0a0a0aLegacy: text on the saturated accentSignals and ambient
--ha-danger#f871717.16:1--ha-success#4ade8011.36:1--ha-focus-ring#ff8c428.56:1--ha-ember#3b0a02--ha-glow#8b5cf6--ha-teal#14b8a6Gabarito brand#
Gabarito, light
Surfaces
--ha-canvas#f4f6f1--ha-surfacergba(255, 255, 255, 0.66)--ha-surface-2#ebeee6--ha-raisedrgba(255, 255, 255, 0.78)--ha-raised-hover#ffffff--ha-glassrgba(255, 255, 255, 0.72)--ha-sunkenrgba(21, 26, 18, 0.06)--ha-header-glassrgba(255, 255, 255, 0.72)Lines
--ha-borderrgba(21, 26, 18, 0.1)--ha-border-strongrgba(21, 26, 18, 0.2)--ha-edgergba(21, 26, 18, 0.2)--ha-glass-edgergba(21, 26, 18, 0.07)Text
--ha-text#1b1f1715.38:1--ha-text-strong#0a0d0817.97:1--ha-muted#484e427.90:1--ha-faint#5f655a5.52:1Accent
--ha-accent-fill#a8e05fFills with on-accent content--ha-accent-fill-hover#98d24a--ha-on-accent#101508Content on accent-fill11.91:1--ha-accent-text#3a63106.49:1--ha-accent#a8e05fDecoration only--ha-accent-hover#98d24aDecoration only--ha-accent-light#b9ea79Decoration only--ha-accent-ink#101508Legacy: text on the saturated accentSignals and ambient
--ha-danger#b3232b6.05:1--ha-success#3a63106.49:1--ha-focus-ring#4f84164.16:1--ha-ember#e6f3cd--ha-glow#7a68ee--ha-teal#14b8a6Gabarito, dark
Surfaces
--ha-canvas#060608--ha-surfacergba(20, 20, 24, 0.42)--ha-surface-2#101014--ha-raisedrgba(255, 255, 255, 0.06)--ha-raised-hoverrgba(255, 255, 255, 0.1)--ha-glassrgba(255, 255, 255, 0.07)--ha-sunkenrgba(0, 0, 0, 0.24)--ha-header-glassrgba(18, 18, 22, 0.78)Lines
--ha-borderrgba(255, 255, 255, 0.08)--ha-border-strongrgba(255, 255, 255, 0.15)--ha-edgergba(255, 255, 255, 0.15)--ha-glass-edgergba(255, 255, 255, 0.08)Text
--ha-text#ececf117.19:1--ha-text-strong#ffffff20.24:1--ha-muted#9d9daa7.56:1--ha-faint#8a8a985.95:1Accent
--ha-accent-fill#a8e05fFills with on-accent content--ha-accent-fill-hover#b9ea79--ha-on-accent#101508Content on accent-fill11.91:1--ha-accent-text#a8e05f13.01:1--ha-accent#a8e05fDecoration only--ha-accent-hover#b9ea79Decoration only--ha-accent-light#b9ea79Decoration only--ha-accent-ink#101508Legacy: text on the saturated accentSignals and ambient
--ha-danger#ffa1a410.49:1--ha-success#a8e05f13.01:1--ha-focus-ring#a8e05f13.01:1--ha-ember#171d10--ha-glow#8b7cf6--ha-teal#14b8a6Typography#
Fonts are --ha-font-sans, --ha-font-mono, and --ha-font-display. The scale uses clamp(), so sizes step down on phones. Body copy is 16px, labels are 13px or more at weight 500, and the display and headings use weight 500 with negative tracking.
| Token | Value |
|---|---|
font-weight-regular | 400 |
font-weight-medium | 500 |
font-weight-semibold | 600 |
leading-prose | 1.7 |
tracking-label | 0.12em |
tracking-mono | 0.04em |
Spacing#
| Token | Value | Use |
|---|---|---|
space-1 to space-10 | 0.25rem to 8rem | Gaps and padding |
gutter | 24px | Page side padding |
section | clamp(112px, 14vw, 160px) | Gap between landing sections |
section-tight | clamp(56px, 8vw, 88px) | Footer margin, compact pages |
Radius#
8px
12px
18px
24px
999px
Shadows#
Shadows change with the theme and brand. Dark glass uses an inset highlight and a one pixel ring. Light surfaces are solid with a visible edge and a soft drop.
Motion#
Hover or focus a track to see the curve. All durations collapse to near zero under reduced motion or the pause switch.
| Token | Value | Use |
|---|---|---|
dur-fast | 140ms | Color and background changes |
dur-base | 300ms | Small layout moves |
dur-slow | 500ms | Header pill, hover lift, layout |
dur-reveal | 700ms | Scroll reveal |
reveal-distance | 24px | Reveal translate, 24px or less |
stagger-max | 240ms | Longest reveal stagger |
Z-index#
| Token | Value | Layer |
|---|---|---|
z-lights | -1 | Page lights and particles |
z-base | 0 | Content |
z-sticky | 20 | Sticky elements |
z-header | 50 | Header |
z-drawer | 60 | Mobile navigation drawer |
z-dialog | 100 | Dialogs |
z-toast | 200 | Toasts |
z-skip | 300 | Skip link |
Breakpoints and containers#
Custom properties cannot be used inside media queries, so the breakpoints are documented values. Tailwind users get them as ha-sm to ha-xl screens.
| Token | Value | Used for |
|---|---|---|
bp-sm | 480px | Button groups stack below this |
bp-md | 640px | Header and dialog go to the phone layout |
bp-lg | 900px | Header navigation appears |
bp-xl | 1120px | Page container width |
container | 1120px | Page container |
container-narrow | 720px | Narrow column |
container-prose | 68ch | Article measure |
container-pill | 720px | Scrolled header pill width |
header-height | 72px | Header bar |
header-height-mobile | 64px | Header bar on phones (64px maximum) |
tap-target | 44px | Minimum touch target on phones |