domestic-ui GitHub

Semantic tokens

Public theming API. Named by role. Each points at a primitive (css/tokens/primitives.css) or at another semantic token. Base, layout, utility and component CSS use only these. Renaming or removing one is a breaking change.

A theme is an override of these tokens on :root or on a scoped element. No rebuild. See Theming.

Colors use light-dark(), which picks a value from the used color-scheme of the element where the token is read.

201 tokens in css/tokens/semantic.css. Light and Dark resolve every var() and take one side of light-dark(). Previews are decorative. † marks a description taken from the semantic token table in Theming.

Surfaces and text

TokenPreviewLightDarkDescription
--dui-color-surfaceoklch(96.6% 0.012 85deg)oklch(18.5% 0.012 55deg)Page background
Written as light-dark(var(--dui-color-neutral-1), var(--dui-color-neutral-dark-1))
--dui-color-surface-raisedoklch(98.8% 0.006 85deg)oklch(21.5% 0.014 55deg)Brighter paper on the page: cards, panels, neutral buttons, table row hover
Written as light-dark(var(--dui-color-neutral-2), var(--dui-color-neutral-dark-2))
--dui-color-surface-sunkenoklch(93.8% 0.014 82deg)oklch(22% 0.015 55deg)Recessed areas: code, button hover
Written as light-dark(var(--dui-color-neutral-3), var(--dui-color-neutral-dark-3))
--dui-color-surface-hoveroklch(92.4% 0.016 80deg)oklch(27% 0.016 55deg)Hover fill of quiet buttons and rows (neutral step 4)
Written as light-dark(var(--dui-color-neutral-4), var(--dui-color-neutral-dark-4))
--dui-color-surface-activeoklch(89.8% 0.018 78deg)oklch(31% 0.018 55deg)Pressed fill of quiet buttons (neutral step 5)
Written as light-dark(var(--dui-color-neutral-5), var(--dui-color-neutral-dark-5))
--dui-color-surface-frameoklch(96.6% 0.012 85deg)oklch(18.5% 0.012 55deg)Background of an app shell's frame: the app bar and sidebars sit on it, around the main content panel. The page color, so the brighter panel stands on it
Written as var(--dui-color-surface)
--dui-color-textoklch(28% 0.035 45deg)oklch(95% 0.012 85deg)Body text
Written as light-dark(var(--dui-color-neutral-12), var(--dui-color-neutral-dark-12))

Borders

TokenPreviewLightDarkDescription
--dui-color-border-controloklch(57% 0.03 60deg)oklch(57% 0.025 60deg)Boundaries of fields, selects, checkboxes, radios and switches, 3:1
Written as light-dark(var(--dui-color-neutral-8), var(--dui-color-neutral-dark-8))
--dui-color-border-control-hoveroklch(50% 0.03 55deg)oklch(66% 0.022 65deg)Field border on hover, one step stronger
Written as light-dark(var(--dui-color-neutral-9), var(--dui-color-neutral-dark-9))
--dui-color-border-buttonoklch(86% 0.02 75deg)oklch(35% 0.02 55deg)Secondary button border: the subtle border step, softer than a field, because its visible label identifies it
Written as light-dark(var(--dui-color-neutral-6), var(--dui-color-neutral-dark-6))

Primary

TokenPreviewLightDarkDescription
--dui-color-primaryoklch(28% 0.035 45deg)oklch(95% 0.012 85deg)Primary fill: the ink, brown in light and ivory in dark
Written as light-dark(var(--dui-color-neutral-12), var(--dui-color-neutral-dark-12))
--dui-color-primary-contrastoklch(98.8% 0.006 85deg)oklch(18.5% 0.012 55deg)Text on the primary fill: paper on ink
Written as light-dark(var(--dui-color-neutral-2), var(--dui-color-neutral-dark-1))

Accent and status

TokenPreviewLightDarkDescription
--dui-color-accentoklch(57% 0.17 42deg)oklch(57% 0.17 42deg)Accent solid for selection, checks, switches and focus, and the hue of links: clay, the same in both schemes. Themes set a hue here
Written as var(--dui-color-clay-9)
--dui-color-accent-indigooklch(53% 0.215 272deg)oklch(53% 0.215 272deg)An indigo accent solid, more vivid on a Display P3 screen. The calm theme points --dui-color-accent at it
Written as light-dark(var(--dui-color-indigo-9), var(--dui-color-indigo-dark-9))
--dui-color-link-visitedoklch(46.2% 0.195 299deg)oklch(80.1% 0.127 306deg)Visited links
Written as light-dark(var(--dui-color-purple-11), var(--dui-color-purple-dark-11))
--dui-color-dangeroklch(48% 0.16 27deg)oklch(80% 0.114 27deg)Errors and invalid borders
Written as light-dark(var(--dui-color-red-11), var(--dui-color-red-dark-11))
--dui-color-danger-solidoklch(50% 0.19 27deg)oklch(50% 0.19 27deg)Fill of danger buttons, the same red in both schemes, 3:1 against the light page
Written as var(--dui-color-red-10)
--dui-color-danger-contrastoklch(100% 0 0deg)oklch(100% 0 0deg)Text on the danger fill, 4.5:1
Written as var(--dui-color-white)
--dui-color-successoklch(47% 0.128 150deg)oklch(80% 0.12 150deg)Success messages
Written as light-dark(var(--dui-color-green-11), var(--dui-color-green-dark-11))
--dui-color-warningoklch(47% 0.098 75deg)oklch(80% 0.12 75deg)Warning badges and messages
Written as light-dark(var(--dui-color-amber-11), var(--dui-color-amber-dark-11))
--dui-color-infooklch(48% 0.12 245deg)oklch(80% 0.108 245deg)Informational alerts, separate from the accent
Written as light-dark(var(--dui-color-blue-11), var(--dui-color-blue-dark-11))
--dui-color-markoklch(95.3% 0.093 99deg)oklch(83.4% 0.141 97deg)mark and ::selection background
Written as light-dark(var(--dui-color-yellow-3), var(--dui-color-yellow-dark-9))
--dui-color-mark-textoklch(28% 0.035 45deg)oklch(28% 0.035 45deg)Text on mark, the light text color in both schemes
Written as var(--dui-color-neutral-12)
--dui-color-backdropoklch(0% 0 0deg / 40%)oklch(0% 0 0deg / 60%)dialog::backdrop
Written as light-dark(var(--dui-color-black-a40), var(--dui-color-black-a60))
--dui-color-shadowoklch(30% 0.04 45deg / 10%)oklch(10% 0.02 45deg / 50%)Shadow color, tinted with the neutral hue
Written as light-dark(var(--dui-color-neutral-shadow), var(--dui-color-neutral-dark-shadow))

Code highlighting (css/base/typography.css, explainers/code-highlighting.md). Each meets 4.5:1 on --dui-color-surface-sunken, the <pre> background (WCAG 1.4.3)

TokenPreviewLightDarkDescription
--dui-color-code-keywordoklch(46.2% 0.195 299deg)oklch(80.1% 0.127 306deg)JS keywords and CSS at-rules: const, return, @layer
Written as light-dark(var(--dui-color-purple-11), var(--dui-color-purple-dark-11))
--dui-color-code-stringoklch(47% 0.128 150deg)oklch(80% 0.12 150deg)Quoted strings in JS and CSS, and HTML attribute values
Written as light-dark(var(--dui-color-green-11), var(--dui-color-green-dark-11))
--dui-color-code-commentoklch(49% 0.03 55deg)oklch(75% 0.02 70deg)Comments in HTML, CSS and JS
Written as light-dark(var(--dui-color-neutral-11), var(--dui-color-neutral-dark-11))
--dui-color-code-tagoklch(48% 0.12 245deg)oklch(80% 0.108 245deg)HTML tag names and CSS selectors
Written as light-dark(var(--dui-color-blue-11), var(--dui-color-blue-dark-11))
--dui-color-code-attributeoklch(47% 0.098 75deg)oklch(80% 0.12 75deg)HTML attribute names
Written as light-dark(var(--dui-color-amber-11), var(--dui-color-amber-dark-11))
--dui-color-code-propertyoklch(49.1% 0.081 203deg)oklch(77.3% 0.099 203deg)CSS properties and custom properties, JS object properties
Written as light-dark(var(--dui-color-teal-11), var(--dui-color-teal-dark-11))
--dui-color-code-numberoklch(48% 0.16 27deg)oklch(80% 0.114 27deg)Numbers with their units: 0.5rem, 100%, 42
Written as light-dark(var(--dui-color-red-11), var(--dui-color-red-dark-11))
--dui-color-code-punctuationoklch(37% 0.03 45deg)oklch(84% 0.015 75deg)Brackets, braces, angle brackets, colons, semicolons, commas
Written as light-dark(var(--dui-color-neutral-punctuation), var(--dui-color-neutral-dark-punctuation))

Type

TokenPreviewLightDarkDescription
--dui-font-bodysystem-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serifsystem-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serifBody font stack †
Written as var(--dui-font-stack-system-ui)
--dui-font-monoui-monospace, "Cascadia Code", "Source Code Pro", menlo, consolas, "DejaVu Sans Mono", monospaceui-monospace, "Cascadia Code", "Source Code Pro", menlo, consolas, "DejaVu Sans Mono", monospaceCode font stack †
Written as var(--dui-font-stack-monospace)
--dui-font-weight-body400400Body weight †
Written as var(--dui-font-weight-400)
--dui-font-weight-strong600600strong, legends, th †
Written as var(--dui-font-weight-600)
--dui-font-weight-ui500500Interface labels: buttons, nav rows and field labels. Between body and strong, as Radix and shadcn set them
Written as var(--dui-font-weight-500)
--dui-font-weight-heading600600h1–h6 †
Written as var(--dui-font-weight-600)
--dui-font-weight-display500500h1 to h3: medium, because a serif carries its own weight
Written as var(--dui-font-weight-500)
--dui-step--10.875rem0.875rem14px: small text, captions, and the UI text size
Written as var(--dui-font-size-0-875)
--dui-step-01rem1rem16px: body text, h5 and h6
Written as var(--dui-font-size-1)
--dui-step-11.125rem1.125rem18px: h4
Written as var(--dui-font-size-1-125)
--dui-step-21.375rem1.375rem22px: h3
Written as var(--dui-font-size-1-375)
--dui-step-3clamp(1.5rem, 1.375rem + 0.625vw, 1.875rem)clamp(1.5rem, 1.375rem + 0.625vw, 1.875rem)24px to 30px: h2
Written as var(--dui-font-size-fluid-3)
--dui-step-4clamp(1.75rem, 1.5417rem + 1.0417vw, 2.375rem)clamp(1.75rem, 1.5417rem + 1.0417vw, 2.375rem)28px to 38px: page titles, one step above h2
Written as var(--dui-font-size-fluid-4)
--dui-step-5clamp(2rem, 1.6667rem + 1.6667vw, 3rem)clamp(2rem, 1.6667rem + 1.6667vw, 3rem)32px to 48px: h1, docs and marketing heroes
Written as var(--dui-font-size-fluid-5)
--dui-step-6clamp(2.5rem, 2rem + 2.5vw, 4rem)clamp(2.5rem, 2rem + 2.5vw, 4rem)40px to 64px: the h2 of a hero band
Written as var(--dui-font-size-fluid-6)
--dui-step-7clamp(2.75rem, 2.0833rem + 3.3333vw, 4.75rem)clamp(2.75rem, 2.0833rem + 3.3333vw, 4.75rem)44px to 76px: the h1 of a hero band
Written as var(--dui-font-size-fluid-7)
--dui-font-size-code0.9em0.9emcode, kbd, samp, pre (relative) †
Written as var(--dui-font-size-relative-90)
--dui-line-height-body1.51.5Body text †
Written as var(--dui-leading-150)
--dui-line-height-heading1.21.2Headings, buttons, pre †
Written as var(--dui-leading-120)
--dui-line-height-snug1.41.4Lines that run long but are not body text: code blocks and lead paragraphs
Written as var(--dui-leading-140)
--dui-line-height-display1.11.1h1 †
Written as var(--dui-leading-110)
--dui-letter-spacing-heading-0.02em-0.02emh1 to h3
Written as var(--dui-tracking-tight)
--dui-letter-spacing-display-0.03em-0.03emh1 and page titles
Written as var(--dui-tracking-tighter)
--dui-letter-spacing-hero-0.045em-0.045emThe h1 of a hero band: very tight, because large type looks loose
Written as var(--dui-tracking-tightest)
--dui-line-height-hero11The h1 of a hero band: solid, so two lines read as one title
Written as var(--dui-leading-100)
--dui-measure60ch60chLongest line of running text: 60 characters, inside the 45 to 75 range that reads well
Written as var(--dui-size-60ch)

Page pattern

A backdrop drawn on the page surface and an app shell's frame, under every panel and card.

TokenPreviewLightDarkDescription
--dui-pattern-sizeNone1.5rem1.5remSpacing of the page pattern's grid: 24px
Written as var(--dui-space-l)
--dui-pattern-dotNone1px1pxRadius of each dot in the dotted page pattern: 1px
Written as var(--dui-border-1)

Space

TokenPreviewLightDarkDescription
--dui-space-3xs0.125rem0.125remSpace scale †
Written as var(--dui-space-1)
--dui-space-2xs0.25rem0.25remSpace scale †
Written as var(--dui-space-2)
--dui-space-xs0.5rem0.5remSpace scale †
Written as var(--dui-space-3)
--dui-space-s0.75rem0.75remSpace scale †
Written as var(--dui-space-4)
--dui-space-m1rem1remSpace scale; default flow rhythm and .stack gap †
Written as var(--dui-space-5)
--dui-space-l1.5rem1.5remSpace scale; default .grid gap †
Written as var(--dui-space-6)
--dui-space-xl2rem2remSpace scale; space above h1–h3 †
Written as var(--dui-space-7)
--dui-space-2xl3rem3remSpace scale †
Written as var(--dui-space-8)
--dui-space-3xl4rem4remSpace scale †
Written as var(--dui-space-9)

Sizes

TokenPreviewLightDarkDescription
--dui-size-target2.25rem2.25remComfortable control height: 36px, 44px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-2-75), resolves to 2.75rem.
Written as var(--dui-size-2-25)
--dui-size-target-compact2rem2remCompact control height: 32px, 44px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-2-75), resolves to 2.75rem.
Written as var(--dui-size-2)
--dui-size-target-small2rem2remSmall buttons: 32px, 44px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-2-75), resolves to 2.75rem.
Written as var(--dui-size-2)
--dui-size-target-large2.5rem2.5remLarge buttons: 40px, 52px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-3-25), resolves to 3.25rem.
Written as var(--dui-size-2-5)
--dui-size-target-row2rem2remComfortable row height of nav, menu, listbox and list items: 32px, 44px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-2-75), resolves to 2.75rem.
Written as var(--dui-size-2)
--dui-size-target-row-compact1.75rem1.75remCompact row height: 28px, 44px under a coarse pointer
With @media (pointer: coarse): var(--dui-size-2-75), resolves to 2.75rem.
Written as var(--dui-size-1-75)
--dui-size-check1rem1remCheckbox and radio box, and the switch thumb: 16px, as shadcn/ui. The label around it is the full-size target (WCAG 2.5.8)
Written as var(--dui-size-1)
--dui-size-column-min16rem16remDefault .grid min column width †
Written as var(--dui-size-16)
--dui-size-menu-min12rem12remMin width of menus and nav dropdowns †
Written as var(--dui-size-12)
--dui-size-drawer24rem24remDrawer width (all of the viewport when narrower) †
Written as var(--dui-size-24)
--dui-size-page72rem72remMax inline size of a page's content column: header, main and footer
Written as var(--dui-size-72)
--dui-size-narrow24rem24remMax inline size of a narrow page's one card: sign-in, sign-up, error pages
Written as var(--dui-size-24)
--dui-size-icon1.25rem1.25remDecorative icons beside a label, on their own
Written as var(--dui-size-1-25)
--dui-size-icon-inline1rem1remIcons inside buttons, menu items and toolbars, beside 14 to 16px text
Written as var(--dui-size-1)
--dui-size-icon-nav1rem1remDecorative icons at the start of nav links and group summaries: 16px beside 14px sidebar text, as shadcn/ui
Written as var(--dui-size-icon-inline)
--dui-size-chevronNonecalc(0.25rem + 0.125rem)calc(0.25rem + 0.125rem)Arm length of the CSS-drawn chevron on a sidebar nav group: 6px
Written as calc(var(--dui-space-2xs) + var(--dui-space-3xs))
--dui-icon-stroke-widthNone1.751.75Stroke width of [data-icon] SVGs, set with the CSS stroke-width property
Written as var(--dui-stroke-1-75)
--dui-size-sidebar16rem16remInline size of an app shell's primary sidebar when it sits beside main
Written as var(--dui-size-16)
--dui-size-sidebar-aux20rem20remInline size of an app shell's auxiliary (inline-end) sidebar when it sits beside main
Written as var(--dui-size-20)
--dui-size-paneNone100svh100svhMax block size of a pane that scrolls on its own beside others, such as the detail of a list-detail or a data-scroll="block inline" table
Written as var(--dui-size-100svh)
--dui-size-window100vw100vwThe window width a full-bleed band spans; the body clips the scrollbar part
Written as var(--dui-size-100vw)

Shape

TokenPreviewLightDarkDescription
--dui-radius-scale11Radius knob: multiplies the control and surface radii. 1 is the default, 0 gives square corners, 1.5 rounder
Written as var(--dui-factor-1)
--dui-radius-pill999rem999remFully rounded ends; not scaled, so pills stay round
Written as var(--dui-radius-round)
--dui-border-width1px1pxHairline width †
Written as var(--dui-border-1)
--dui-border-width-emphasis0.25rem0.25remblockquote rule, alert start rule, invalid field †
Written as var(--dui-border-4)
--dui-border-width-indicator3px3pxThe selected tab's and the current nav item's bar in forced colors only †
Written as var(--dui-border-3)
--dui-angle-chevronNone45deg45degTurn of the CSS-drawn sidebar group chevron: -1x points to the inline end, 1x points down (open), 3x points left in right-to-left text
Written as var(--dui-angle-45)
--dui-border-width-check2px2pxStroke of the CSS-drawn check and indeterminate bar in a checkbox, close to a 14px icon's 2 stroke
Written as var(--dui-border-2)
--dui-border-width-chevroncalc(1px * 1.5)calc(1px * 1.5)Stroke of the CSS-drawn chevron on a sidebar nav group, close to a 16px icon's 1.75 stroke
Written as calc(var(--dui-border-1) * 1.5)
--dui-underline-offsetNone0.15em0.15emLink underline offset †
Written as var(--dui-underline-offset-015em)
--dui-underline-thicknessNone0.0625em0.0625emLink underline †
Written as var(--dui-underline-1)
--dui-underline-thickness-hoverNone0.125em0.125emLink underline on hover †
Written as var(--dui-underline-2)

Focus indicator

WCAG 2.4.7, 2.4.11, 2.4.13.

TokenPreviewLightDarkDescription
--dui-focus-width3px3pxFocus ring width: 3px, as shadcn/ui's ring
Written as var(--dui-border-3)
--dui-focus-offset0px0pxFocus ring offset: 0, so the ring hugs the edge. Our choice: the ring is opaque at 3:1 rather than a translucent halo, so it meets WCAG 1.4.11
Written as var(--dui-border-0)

Motion knobs

Durations and distances (section 2) are derived from these.

TokenPreviewLightDarkDescription
--dui-motion-scaleNone11Multiplies every motion duration: 2 is twice as slow, 0 turns motion off
Written as var(--dui-factor-1)
--dui-motion-movementNone111 lets things slide, lift and zoom; 0 (reduced motion) keeps fades and color changes only
With @media (prefers-reduced-motion: reduce): var(--dui-factor-0), resolves to 0.
With [data-motion="reduced"]: var(--dui-factor-0), resolves to 0.
With [data-motion="none"]: var(--dui-factor-0), resolves to 0.
Written as var(--dui-factor-1)
--dui-motion-enabledNone110 (data-motion="none") makes every duration 0s, whatever the scale set inside
With [data-motion="none"]: var(--dui-factor-0), resolves to 0.
Written as var(--dui-factor-1)
--dui-motion-easing-standardNonecubic-bezier(0.2, 0, 0, 1)cubic-bezier(0.2, 0, 0, 1)Easing for state changes that stay on screen: hover, press, switch
Written as var(--dui-easing-ease-out)
--dui-motion-easing-enterNonecubic-bezier(0, 0, 0, 1)cubic-bezier(0, 0, 0, 1)Easing for things arriving: dialogs, drawers, popovers, toasts
Written as var(--dui-easing-decelerate)
--dui-motion-easing-exitNonecubic-bezier(0.3, 0, 1, 1)cubic-bezier(0.3, 0, 1, 1)Easing for things leaving
Written as var(--dui-easing-accelerate)
--dui-motion-easing-springNonecubic-bezier(0, 0, 0, 1)cubic-bezier(0, 0, 0, 1)Easing for popover, menu and drawer entrances: a linear() spring where supported (below), the enter easing elsewhere
With @supports (transition-timing-function: linear(0, 1)): var(--dui-easing-spring), resolves to linear(0, 0.16 4%, 0.46 11%, 0.71 19%, 0.86 28%, 0.94 38%, 0.98 51%, 0.995 66%, 1).
Written as var(--dui-easing-decelerate)

Floating panels

The app shell's main content panel, inset from the frame edge.

TokenPreviewLightDarkDescription
--dui-space-page-inline1.5rem1.5remInline gutter of a plain document page's column, so content never touches the window edge
Written as var(--dui-space-l)
--dui-space-sectionNoneclamp(3rem, 2rem + 5vw, 6rem)clamp(3rem, 2rem + 5vw, 6rem)Block padding of a band: 48px on a phone to 96px on a wide screen
Written as var(--dui-space-fluid-section)
--dui-space-panel-inset0.5rem0.5remGap between a floating panel and the viewport or frame edge
Written as var(--dui-space-xs)

Elevation knobs

TokenPreviewLightDarkDescription
--dui-elevation-strengthNone100%100%How much of --dui-color-shadow each shadow uses, 0% to 100%
Written as var(--dui-mix-100)
--dui-elevation-surface-stepNone3%3%Dark scheme: how much text color each level mixes into its surface
Written as var(--dui-mix-3)

Density knob

The density tokens (section 2) are derived from it.

TokenPreviewLightDarkDescription
--dui-density-scaleNone111 is comfortable, 0 compact (data-density); in between interpolates. Below 0 is not supported: targets could drop under 24px
With [data-density="comfortable"]: var(--dui-factor-1), resolves to 1.
With [data-density="compact"]: var(--dui-factor-0), resolves to 0.
Written as var(--dui-factor-1)

State

TokenPreviewLightDarkDescription
--dui-opacity-disabledNone0.60.6Disabled controls, disabled and aria-disabled="true" †
Written as var(--dui-opacity-60)

Contrast knob

Muted text, hairlines and tints follow it (section 2).

TokenPreviewLightDarkDescription
--dui-contrastNone111 is the default look; 1.5 (prefers-contrast: more or data-contrast="more") gives stronger muted text, hairlines and tints. Below 1 softens hairlines and tints only: text never drops under 4.5:1
With @media (prefers-contrast: more): var(--dui-factor-1-5), resolves to 1.5.
With [data-contrast="more"]: var(--dui-factor-1-5), resolves to 1.5.
Written as var(--dui-factor-1)

Dependent tokens

Defined in terms of other semantic tokens.

TokenPreviewLightDarkDescription
--dui-color-text-mutedcolor-mix(in oklab, oklch(28% 0.035 45deg) clamp(0%, (1 - 1) * 100%, 100%), oklch(49% 0.03 55deg))color-mix(in oklab, oklch(95% 0.012 85deg) clamp(0%, (1 - 1) * 100%, 100%), oklch(75% 0.02 70deg))Secondary text, still 4.5:1. Above contrast 1 it moves toward --dui-color-text (halfway at 1.5); below 1 it stays
Written as color-mix(in oklab, var(--dui-color-text) clamp(0%, (var(--dui-contrast) - 1) * 100%, 100%), light-dark(var(--dui-color-neutral-11), var(--dui-color-neutral-dark-11)))
--dui-color-borderoklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1))oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1))Decorative hairline. Its alpha scales with --dui-contrast
Written as light-dark(oklch(from var(--dui-color-neutral-12-a11) l c h / calc(alpha * var(--dui-contrast))), oklch(from var(--dui-color-neutral-dark-12-a10) l c h / calc(alpha * var(--dui-contrast))))
--dui-tint-amountNonecalc(8% * 1)calc(8% * 1)How much of a status or accent color tints a surface: 8% times --dui-contrast
Written as calc(var(--dui-mix-8) * var(--dui-contrast))
--dui-border-tint-amountNonecalc(35% * 1)calc(35% * 1)How much of a status color a tinted border uses: 35% times --dui-contrast
Written as calc(var(--dui-mix-35) * var(--dui-contrast))
--dui-color-accent-textoklch(from oklch(57% 0.17 42deg) calc(0.47 - max(0, 0.02 - c) * 16.25) calc(c * 0.19 / 0.215) h)oklch(from oklch(57% 0.17 42deg) calc(0.78 + max(0, 0.02 - c) * 10.25) calc(c * 0.11 / 0.215) h)Accent as text. Relative color of the accent, same hue, 4.5:1. Our choice: an achromatic accent (chroma 0, fading in up to 0.02) gives the text color, 14.5% and 98.5%, so links read as text with an underline, as in shadcn/ui. https://www.w3.org/TR/css-color-5/#relative-colors
Written as light-dark(oklch(from var(--dui-color-accent) calc(0.47 - max(0, 0.02 - c) * 16.25) calc(c * 0.19 / 0.215) h), oklch(from var(--dui-color-accent) calc(0.78 + max(0, 0.02 - c) * 10.25) calc(c * 0.11 / 0.215) h))
--dui-color-linkoklch(from oklch(57% 0.17 42deg) calc(0.47 - max(0, 0.02 - c) * 16.25) calc(c * 0.19 / 0.215) h)oklch(from oklch(57% 0.17 42deg) calc(0.78 + max(0, 0.02 - c) * 10.25) calc(c * 0.11 / 0.215) h)Links: the text color with the default neutral accent, told apart by the underline (WCAG 1.4.1)
Written as var(--dui-color-accent-text)
--dui-color-focusoklch(from oklch(57% 0.17 42deg) calc(l + max(0, 0.02 - c) * 20.25) c h)oklch(from oklch(from oklch(57% 0.17 42deg) calc(0.78 + max(0, 0.02 - c) * 10.25) calc(c * 0.11 / 0.215) h) calc(l - max(0, 0.02 - c) * 21.25) c h)Focus ring, 3:1 (WCAG 1.4.11). A hued accent: the accent solid in light, the accent text in dark. The neutral accent: a mid gray, 55% lightness in light and 56% in dark
Written as light-dark(oklch(from var(--dui-color-accent) calc(l + max(0, 0.02 - c) * 20.25) c h), oklch(from var(--dui-color-accent-text) calc(l - max(0, 0.02 - c) * 21.25) c h))
--dui-color-accent-contrastoklch(100% 0 0deg)oklch(from oklch(57% 0.17 42deg) calc(1 - max(0, 0.02 - c) * 42.5) 0 0deg)Text on the accent fill: white, except on the neutral dark accent, where it is the dark page color
Written as light-dark(var(--dui-color-white), oklch(from var(--dui-color-accent) calc(1 - max(0, 0.02 - c) * 42.5) 0 0deg))
--dui-color-danger-solid-hoveroklch(from oklch(50% 0.19 27deg) calc(l - 0.04) c h)oklch(from oklch(50% 0.19 27deg) calc(l - 0.04) c h)Danger fill hover: 0.04 darker in OKLCH lightness, so white text gains contrast
Written as oklch(from var(--dui-color-danger-solid) calc(l - 0.04) c h)
--dui-color-accent-hoveroklch(from oklch(57% 0.17 42deg) calc(l - 0.02) c h)oklch(from oklch(57% 0.17 42deg) calc(l - 0.02) c h)Accent solid hover. Our choice: 0.02 darker in OKLCH lightness, so white text stays 4.5:1
Written as oklch(from var(--dui-color-accent) calc(l - 0.02) c h)
--dui-color-primary-hoveroklch(from oklch(28% 0.035 45deg) 26% calc(c + 0.002) h)oklch(from oklch(95% 0.012 85deg) 90% calc(c + 0.004) h)Primary fill hover, same hue as the primary
Written as light-dark(oklch(from var(--dui-color-primary) 26% calc(c + 0.002) h), oklch(from var(--dui-color-primary) 90% calc(c + 0.004) h))
--dui-font-headingsystem-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serifsystem-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serifHeading font stack †
Written as var(--dui-font-body)
--dui-font-displayNonecharter, "Bitstream Charter", "Sitka Text", cambria, serifcharter, "Bitstream Charter", "Sitka Text", cambria, serifh1 to h3: the transitional serif stack (Charter, Cambria), so titles read like a printed page; set it to var(--dui-font-heading) for sans titles
Written as var(--dui-font-stack-transitional)
--dui-color-patternoklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1))oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1))Dots or lines of the page pattern: the hairline color, so it follows --dui-contrast
Written as var(--dui-color-border)
--dui-pattern-dotsNoneradial-gradient(circle, oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)) 1px, transparent 0)radial-gradient(circle, oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)) 1px, transparent 0)A dotted grid, one dot per --dui-pattern-size cell. Set --dui-pattern-image to it to turn it on
Written as radial-gradient(circle, var(--dui-color-pattern) var(--dui-pattern-dot), transparent 0)
--dui-pattern-imageNoneradial-gradient(circle, oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)) 1px, transparent 0)radial-gradient(circle, oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)) 1px, transparent 0)The page pattern behind the page and an app shell's frame: the dotted grid by default; none turns it off
Written as var(--dui-pattern-dots)
--dui-font-size-ui0.875rem0.875remInterface text: buttons, fields, selects, nav, menu and listbox items, tabs, tooltips, table cells. 14px at the default font size
Written as var(--dui-step--1)
--dui-font-size-field0.875rem0.875remText in fields, selects and text areas: the UI size, at least 16px under a coarse pointer (section 2a)
With @media (pointer: coarse): max(var(--dui-font-size-ui), var(--dui-step-0)), resolves to max(0.875rem, 1rem).
Written as var(--dui-font-size-ui)
--dui-font-size-badge0.75rem0.75remBadge text: 12px, as shadcn/ui sets its badge (text-xs)
Written as var(--dui-font-size-0-75)
--dui-font-size-page-titleclamp(1.75rem, 1.5417rem + 1.0417vw, 2.375rem)clamp(1.75rem, 1.5417rem + 1.0417vw, 2.375rem)The h1 of a page header or an app shell: 38px at most, one step above h2
Written as var(--dui-step-4)
--dui-radius-controlcalc(0.5rem * 1)calc(0.5rem * 1)Controls, buttons, inline code: 8px times the radius scale
Written as calc(var(--dui-radius-2) * var(--dui-radius-scale))
--dui-radius-surfacecalc(0.75rem * 1)calc(0.75rem * 1)Panels, cards, pre, dialogs, details, media: 12px times the radius scale
Written as calc(var(--dui-radius-3) * var(--dui-radius-scale))
--dui-radius-checkcalc(0.25rem * 1)calc(0.25rem * 1)Checkbox corners: 4px times the radius scale
Written as calc(var(--dui-radius-1-5) * var(--dui-radius-scale))

Tinted surfaces for status badges

A little of the tone mixed into the surface.

TokenPreviewLightDarkDescription
--dui-color-accent-surfacecolor-mix(in oklab, oklch(57% 0.17 42deg) calc(8% * 1), oklch(96.6% 0.012 85deg))color-mix(in oklab, oklch(57% 0.17 42deg) calc(8% * 1), oklch(18.5% 0.012 55deg))Accent badge background †
Written as color-mix(in oklab, var(--dui-color-accent) var(--dui-tint-amount), var(--dui-color-surface))
--dui-color-success-surfacecolor-mix(in oklab, oklch(47% 0.128 150deg) calc(8% * 1), oklch(96.6% 0.012 85deg))color-mix(in oklab, oklch(80% 0.12 150deg) calc(8% * 1), oklch(18.5% 0.012 55deg))Success badge background †
Written as color-mix(in oklab, var(--dui-color-success) var(--dui-tint-amount), var(--dui-color-surface))
--dui-color-warning-surfacecolor-mix(in oklab, oklch(47% 0.098 75deg) calc(8% * 1), oklch(96.6% 0.012 85deg))color-mix(in oklab, oklch(80% 0.12 75deg) calc(8% * 1), oklch(18.5% 0.012 55deg))Warning badge background †
Written as color-mix(in oklab, var(--dui-color-warning) var(--dui-tint-amount), var(--dui-color-surface))
--dui-color-danger-surfacecolor-mix(in oklab, oklch(48% 0.16 27deg) calc(8% * 1), oklch(96.6% 0.012 85deg))color-mix(in oklab, oklch(80% 0.114 27deg) calc(8% * 1), oklch(18.5% 0.012 55deg))Danger badge and alert background †
Written as color-mix(in oklab, var(--dui-color-danger) var(--dui-tint-amount), var(--dui-color-surface))
--dui-color-danger-halocolor-mix(in oklab, oklch(48% 0.16 27deg) calc(20% * 1), transparent)color-mix(in oklab, oklch(80% 0.114 27deg) calc(20% * 1), transparent)Halo around an invalid field: the danger color at 20%, times --dui-contrast
Written as color-mix(in oklab, var(--dui-color-danger) calc(var(--dui-mix-20) * var(--dui-contrast)), transparent)
--dui-color-info-surfacecolor-mix(in oklab, oklch(48% 0.12 245deg) calc(8% * 1), oklch(96.6% 0.012 85deg))color-mix(in oklab, oklch(80% 0.108 245deg) calc(8% * 1), oklch(18.5% 0.012 55deg))Info alert background †
Written as color-mix(in oklab, var(--dui-color-info) var(--dui-tint-amount), var(--dui-color-surface))
--dui-color-info-bordercolor-mix(in oklab, oklch(48% 0.12 245deg) calc(35% * 1), transparent)color-mix(in oklab, oklch(80% 0.108 245deg) calc(35% * 1), transparent)Border of a tinted info box: the info color at --dui-border-tint-amount
Written as color-mix(in oklab, var(--dui-color-info) var(--dui-border-tint-amount), transparent)
--dui-color-success-bordercolor-mix(in oklab, oklch(47% 0.128 150deg) calc(35% * 1), transparent)color-mix(in oklab, oklch(80% 0.12 150deg) calc(35% * 1), transparent)Border of a tinted success box
Written as color-mix(in oklab, var(--dui-color-success) var(--dui-border-tint-amount), transparent)
--dui-color-warning-bordercolor-mix(in oklab, oklch(47% 0.098 75deg) calc(35% * 1), transparent)color-mix(in oklab, oklch(80% 0.12 75deg) calc(35% * 1), transparent)Border of a tinted warning box
Written as color-mix(in oklab, var(--dui-color-warning) var(--dui-border-tint-amount), transparent)
--dui-color-danger-bordercolor-mix(in oklab, oklch(48% 0.16 27deg) calc(35% * 1), transparent)color-mix(in oklab, oklch(80% 0.114 27deg) calc(35% * 1), transparent)Border of a tinted danger box
Written as color-mix(in oklab, var(--dui-color-danger) var(--dui-border-tint-amount), transparent)
--dui-color-thumboklch(96.6% 0.012 85deg)oklch(95% 0.012 85deg)The moving part of a switch: the page color on the track in light, the text color in dark
Written as light-dark(var(--dui-color-surface), var(--dui-color-text))

Inverse pair for small overlays on top of content (tooltips): text and surface swapped

TokenPreviewLightDarkDescription
--dui-color-surface-inverseoklch(28% 0.035 45deg)oklch(95% 0.012 85deg)Tooltip background †
Written as var(--dui-color-text)
--dui-color-text-inverseoklch(96.6% 0.012 85deg)oklch(18.5% 0.012 55deg)Tooltip text †
Written as var(--dui-color-surface)

Motion

Durations times --dui-motion-scale and --dui-motion-enabled, distances times --dui-motion-movement.

TokenPreviewLightDarkDescription
--dui-motion-duration-fastNonecalc(120ms * 1 * 1)calc(120ms * 1 * 1)Small state changes: hover, press, switch, popovers and menus
Written as calc(var(--dui-duration-120) * var(--dui-motion-scale) * var(--dui-motion-enabled))
--dui-motion-duration-normalNonecalc(200ms * 1 * 1)calc(200ms * 1 * 1)Dialogs and toasts
Written as calc(var(--dui-duration-200) * var(--dui-motion-scale) * var(--dui-motion-enabled))
--dui-motion-duration-slowNonecalc(300ms * 1 * 1)calc(300ms * 1 * 1)Large surfaces that travel: the drawer
Written as calc(var(--dui-duration-300) * var(--dui-motion-scale) * var(--dui-motion-enabled))
--dui-motion-distanceNonecalc(0.75rem * 1)calc(0.75rem * 1)How far a dialog or toast lifts as it fades in; 0 with reduced motion
Written as calc(var(--dui-space-4) * var(--dui-motion-movement))
--dui-motion-zoomNonecalc(1 - (1 - 0.95) * 1)calc(1 - (1 - 0.95) * 1)Scale a popover or menu grows from; 1 (no zoom) with reduced motion
Written as calc(1 - (1 - var(--dui-ratio-95)) * var(--dui-motion-movement))
--dui-motion-press-scaleNonecalc(1 - (1 - 0.98) * 1)calc(1 - (1 - 0.98) * 1)Scale of a pressed (:active) button: 0.98, or 1 with reduced motion
Written as calc(1 - (1 - var(--dui-ratio-98)) * var(--dui-motion-movement))

Elevation

A shadow and a surface per level. Every level from 1 up is a 1px ring in the hairline color (--dui-color-border) plus layers with a negative spread, so an elevated component needs no border of its own. Light scheme: the shadow does the work and every level keeps --dui-color-surface. Dark scheme: shadows barely show on a dark page, so each level also mixes --dui-elevation-surface-step more of the text color into its surface, and levels 2 to 4 add a 1px top inset highlight. The ring reads slightly brighter in dark, because the dark hairline is the light text color at low alpha.

TokenPreviewLightDarkDescription
--dui-elevation-shadow-colorcolor-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow color after strength; retune --dui-color-shadow and --dui-elevation-strength
Written as color-mix(in srgb, var(--dui-color-shadow) var(--dui-elevation-strength), transparent)
--dui-elevation-ringNone0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1))0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1))The 1px hairline ring included in every elevated role
Written as var(--dui-shadow-ring) var(--dui-color-border)
--dui-elevation-highlightNoneinset 0 1px 0 0 transparentinset 0 1px 0 0 oklch(95% 0.012 85deg / 6%)Dark scheme only: a 1px top inset highlight on levels 2 to 4
Written as var(--dui-shadow-highlight) light-dark(transparent, var(--dui-color-neutral-dark-12-a6))
--dui-elevation-0NonenonenoneLevel 0, flat: no shadow
Written as var(--dui-shadow-none)
--dui-elevation-controlNone0 1px 2px -1px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)0 1px 2px -1px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)A 1px shadow under secondary buttons, without the ring: they have a border
Written as var(--dui-shadow-1-key) var(--dui-elevation-shadow-color)
--dui-elevation-1None0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Level 1: the ring and a 1px shadow
Written as var(--dui-elevation-ring), var(--dui-shadow-1-key) var(--dui-elevation-shadow-color)
--dui-elevation-2Noneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 2px 4px -2px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 4px 12px -4px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 2px 4px -2px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 4px 12px -4px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Level 2: ring, two layers, dark highlight
Written as var(--dui-elevation-highlight), var(--dui-elevation-ring), var(--dui-shadow-2-key) var(--dui-elevation-shadow-color), var(--dui-shadow-2-ambient) var(--dui-elevation-shadow-color)
--dui-elevation-3Noneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 4px 8px -4px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 12px 24px -8px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 4px 8px -4px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 12px 24px -8px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Level 3: ring, two layers, dark highlight
Written as var(--dui-elevation-highlight), var(--dui-elevation-ring), var(--dui-shadow-3-key) var(--dui-elevation-shadow-color), var(--dui-shadow-3-ambient) var(--dui-elevation-shadow-color)
--dui-elevation-4Noneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 8px 16px -8px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 24px 48px -12px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 8px 16px -8px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 24px 48px -12px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Level 4: ring, two layers, dark highlight
Written as var(--dui-elevation-highlight), var(--dui-elevation-ring), var(--dui-shadow-4-key) var(--dui-elevation-shadow-color), var(--dui-shadow-4-ambient) var(--dui-elevation-shadow-color)
--dui-elevation-0-surfaceoklch(96.6% 0.012 85deg)oklch(18.5% 0.012 55deg)Level 0 surface: the page
Written as var(--dui-color-surface)
--dui-elevation-1-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) 3%, oklch(18.5% 0.012 55deg))Level 1 surface: one step lighter in dark
Written as light-dark(var(--dui-color-surface), color-mix(in oklab, var(--dui-color-text) var(--dui-elevation-surface-step), var(--dui-color-surface)))
--dui-elevation-2-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 2), oklch(18.5% 0.012 55deg))Level 2 surface: two steps lighter in dark
Written as light-dark(var(--dui-color-surface), color-mix(in oklab, var(--dui-color-text) calc(var(--dui-elevation-surface-step) * 2), var(--dui-color-surface)))
--dui-elevation-3-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 3), oklch(18.5% 0.012 55deg))Level 3 surface: three steps lighter in dark
Written as light-dark(var(--dui-color-surface), color-mix(in oklab, var(--dui-color-text) calc(var(--dui-elevation-surface-step) * 3), var(--dui-color-surface)))
--dui-elevation-4-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 4), oklch(18.5% 0.012 55deg))Level 4 surface: four steps lighter in dark
Written as light-dark(var(--dui-color-surface), color-mix(in oklab, var(--dui-color-text) calc(var(--dui-elevation-surface-step) * 4), var(--dui-color-surface)))

Elevation by role

Components use these, never the numbers.

TokenPreviewLightDarkDescription
--dui-elevation-flatNonenonenoneShadow of content on the page
Written as var(--dui-elevation-0)
--dui-elevation-flat-surfaceoklch(96.6% 0.012 85deg)oklch(18.5% 0.012 55deg)Surface of content on the page
Written as var(--dui-elevation-0-surface)
--dui-elevation-raisedNone0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow of cards
Written as var(--dui-elevation-1)
--dui-elevation-raised-surfaceoklch(98.8% 0.006 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) 3%, oklch(18.5% 0.012 55deg))Surface of cards: the brighter paper in light; one elevation step up in dark, so --dui-elevation-surface-step retunes it
Written as light-dark(var(--dui-color-surface-raised), var(--dui-elevation-1-surface))
--dui-elevation-panelNone0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow of floating panels: an app shell's main content panel on the frame. The ring and a 1px shadow
Written as var(--dui-elevation-1)
--dui-elevation-panel-surfaceoklch(98.8% 0.006 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) 3%, oklch(18.5% 0.012 55deg))Surface of floating panels: the brighter paper in light, one elevation step up in dark, on the page-colored frame
Written as light-dark(var(--dui-color-surface-raised), var(--dui-elevation-1-surface))
--dui-elevation-overlayNoneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 2px 4px -2px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 4px 12px -4px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 2px 4px -2px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 4px 12px -4px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow of toasts and other non-modal layers over the page
Written as var(--dui-elevation-2)
--dui-elevation-overlay-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 2), oklch(18.5% 0.012 55deg))Surface of non-modal layers over the page
Written as var(--dui-elevation-2-surface)
--dui-elevation-popoverNoneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 4px 8px -4px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 12px 24px -8px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 4px 8px -4px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 12px 24px -8px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow of popovers, menus, tooltips and nav dropdowns
Written as var(--dui-elevation-3)
--dui-elevation-popover-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 3), oklch(18.5% 0.012 55deg))Surface of popovers, menus and nav dropdowns
Written as var(--dui-elevation-3-surface)
--dui-elevation-dialogNoneinset 0 1px 0 0 transparent, 0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 8px 16px -8px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent), 0 24px 48px -12px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)inset 0 1px 0 0 oklch(95% 0.012 85deg / 6%), 0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 8px 16px -8px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent), 0 24px 48px -12px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Shadow of dialogs and drawers
Written as var(--dui-elevation-4)
--dui-elevation-dialog-surfaceoklch(96.6% 0.012 85deg)color-mix(in oklab, oklch(95% 0.012 85deg) calc(3% * 4), oklch(18.5% 0.012 55deg))Surface of dialogs and drawers
Written as var(--dui-elevation-4-surface)

Density

Space inside components and control heights, from the comfortable value (--dui-density-scale 1) down to the compact one (0). Compact controls stay 32px tall, above the 24px of WCAG 2.5.8. Type sizes never change with density.

TokenPreviewLightDarkDescription
--dui-size-controlNonecalc(2rem + (2.25rem - 2rem) * 1)calc(2rem + (2.25rem - 2rem) * 1)Min block size of controls and buttons: 36px comfortable, 32px compact, 44px under a coarse pointer
Written as calc(var(--dui-size-target-compact) + (var(--dui-size-target) - var(--dui-size-target-compact)) * var(--dui-density-scale))
--dui-size-rowNonecalc(1.75rem + (2rem - 1.75rem) * 1)calc(1.75rem + (2rem - 1.75rem) * 1)Min block size of nav, menu, listbox, combobox option and list-detail items: 32px comfortable, 28px compact, 44px under a coarse pointer
Written as calc(var(--dui-size-target-row-compact) + (var(--dui-size-target-row) - var(--dui-size-target-row-compact)) * var(--dui-density-scale))
--dui-space-control-blockNonecalc(0.25rem + (0.5rem - 0.25rem) * 1)calc(0.25rem + (0.5rem - 0.25rem) * 1)Block padding inside controls, buttons and items: 0.5rem comfortable, 0.25rem compact
Written as calc(var(--dui-space-2xs) + (var(--dui-space-xs) - var(--dui-space-2xs)) * var(--dui-density-scale))
--dui-space-control-inlineNonecalc(0.5rem + (0.75rem - 0.5rem) * 1)calc(0.5rem + (0.75rem - 0.5rem) * 1)Inline padding of text fields and nav, menu and listbox items: 0.75rem comfortable, 0.5rem compact
Written as calc(var(--dui-space-xs) + (var(--dui-space-s) - var(--dui-space-xs)) * var(--dui-density-scale))
--dui-space-button-inlineNonecalc(0.75rem + (1rem - 0.75rem) * 1)calc(0.75rem + (1rem - 0.75rem) * 1)Inline padding of buttons: 1rem comfortable, 0.75rem compact
Written as calc(var(--dui-space-s) + (var(--dui-space-m) - var(--dui-space-s)) * var(--dui-density-scale))
--dui-space-gapNonecalc(0.25rem + (0.5rem - 0.25rem) * 1)calc(0.25rem + (0.5rem - 0.25rem) * 1)Gap between the parts of a control: icon and label, check and label: 0.5rem comfortable, 0.25rem compact
Written as calc(var(--dui-space-2xs) + (var(--dui-space-xs) - var(--dui-space-2xs)) * var(--dui-density-scale))
--dui-space-gap-tightNonecalc(0.125rem + (0.25rem - 0.125rem) * 1)calc(0.125rem + (0.25rem - 0.125rem) * 1)Gap and padding in groups of controls: field, toolbar, pagination, menu: 0.25rem comfortable, 0.125rem compact
Written as calc(var(--dui-space-3xs) + (var(--dui-space-2xs) - var(--dui-space-3xs)) * var(--dui-density-scale))
--dui-radius-nestedmax(0px, calc(calc(0.75rem * 1) - calc(0.125rem + (0.25rem - 0.125rem) * 1)))max(0px, calc(calc(0.75rem * 1) - calc(0.125rem + (0.25rem - 0.125rem) * 1)))Concentric corner for an item inside a --dui-radius-surface container padded by --dui-space-gap-tight (menu, listbox, dropdown): the outer radius less the gap, never below 0
Written as max(0px, calc(var(--dui-radius-surface) - var(--dui-space-gap-tight)))
--dui-size-app-barNonecalc(calc(2rem + (2.25rem - 2rem) * 1) + 0.5rem * 2 + 1px)calc(calc(2rem + (2.25rem - 2rem) * 1) + 0.5rem * 2 + 1px)Block size of an app shell's app bar: one control, its block padding and the bottom hairline. Sticky parts below it start here
Written as calc(var(--dui-size-control) + var(--dui-space-xs) * 2 + var(--dui-border-width))
--dui-space-cellNonecalc(0.25rem + (0.5rem - 0.25rem) * 1)calc(0.25rem + (0.5rem - 0.25rem) * 1)Table cell padding: 0.5rem comfortable, 0.25rem compact
Written as calc(var(--dui-space-2xs) + (var(--dui-space-xs) - var(--dui-space-2xs)) * var(--dui-density-scale))

Deprecated aliases, removed in the next release

See CHANGELOG.md.

TokenPreviewLightDarkDescription
--dui-shadow-raised0 0 0 1px oklch(from oklch(28% 0.035 45deg / 14%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(30% 0.04 45deg / 10%) 100%, transparent)0 0 0 1px oklch(from oklch(95% 0.012 85deg / 12%) l c h / calc(alpha * 1)), 0 1px 2px -1px color-mix(in srgb, oklch(10% 0.02 45deg / 50%) 100%, transparent)Deprecated: use --dui-elevation-raised (level 1)
Written as var(--dui-elevation-1)
--dui-duration-fastNonecalc(120ms * 1 * 1)calc(120ms * 1 * 1)Deprecated: use --dui-motion-duration-fast
Written as var(--dui-motion-duration-fast)
--dui-duration-normalNonecalc(200ms * 1 * 1)calc(200ms * 1 * 1)Deprecated: use --dui-motion-duration-normal
Written as var(--dui-motion-duration-normal)
--dui-easing-standardNonecubic-bezier(0.2, 0, 0, 1)cubic-bezier(0.2, 0, 0, 1)Deprecated: use --dui-motion-easing-standard
Written as var(--dui-motion-easing-standard)

Search