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.
Matches names, values and descriptions.
Surfaces and text
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-surface | oklch(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-raised | oklch(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-sunken | oklch(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-hover | oklch(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-active | oklch(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-frame | oklch(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-text | oklch(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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-border-control | oklch(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-hover | oklch(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-button | oklch(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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-primary | oklch(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-contrast | oklch(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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-accent | oklch(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-indigo | oklch(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-visited | oklch(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-danger | oklch(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-solid | oklch(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-contrast | oklch(100% 0 0deg) | oklch(100% 0 0deg) | Text on the danger fill, 4.5:1 Written as var(--dui-color-white) | |
--dui-color-success | oklch(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-warning | oklch(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-info | oklch(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-mark | oklch(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-text | oklch(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-backdrop | oklch(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-shadow | oklch(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)
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-code-keyword | oklch(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-string | oklch(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-comment | oklch(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-tag | oklch(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-attribute | oklch(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-property | oklch(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-number | oklch(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-punctuation | oklch(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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-font-body | system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serif | system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serif | Body font stack † Written as var(--dui-font-stack-system-ui) | |
--dui-font-mono | ui-monospace, "Cascadia Code", "Source Code Pro", menlo, consolas, "DejaVu Sans Mono", monospace | ui-monospace, "Cascadia Code", "Source Code Pro", menlo, consolas, "DejaVu Sans Mono", monospace | Code font stack † Written as var(--dui-font-stack-monospace) | |
--dui-font-weight-body | 400 | 400 | Body weight † Written as var(--dui-font-weight-400) | |
--dui-font-weight-strong | 600 | 600 | strong, legends, th † Written as var(--dui-font-weight-600) | |
--dui-font-weight-ui | 500 | 500 | Interface 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-heading | 600 | 600 | h1–h6 † Written as var(--dui-font-weight-600) | |
--dui-font-weight-display | 500 | 500 | h1 to h3: medium, because a serif carries its own weight Written as var(--dui-font-weight-500) | |
--dui-step--1 | 0.875rem | 0.875rem | 14px: small text, captions, and the UI text size Written as var(--dui-font-size-0-875) | |
--dui-step-0 | 1rem | 1rem | 16px: body text, h5 and h6 Written as var(--dui-font-size-1) | |
--dui-step-1 | 1.125rem | 1.125rem | 18px: h4 Written as var(--dui-font-size-1-125) | |
--dui-step-2 | 1.375rem | 1.375rem | 22px: h3 Written as var(--dui-font-size-1-375) | |
--dui-step-3 | clamp(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-4 | clamp(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-5 | clamp(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-6 | clamp(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-7 | clamp(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-code | 0.9em | 0.9em | code, kbd, samp, pre (relative) † Written as var(--dui-font-size-relative-90) | |
--dui-line-height-body | 1.5 | 1.5 | Body text † Written as var(--dui-leading-150) | |
--dui-line-height-heading | 1.2 | 1.2 | Headings, buttons, pre † Written as var(--dui-leading-120) | |
--dui-line-height-snug | 1.4 | 1.4 | Lines that run long but are not body text: code blocks and lead paragraphs Written as var(--dui-leading-140) | |
--dui-line-height-display | 1.1 | 1.1 | h1 † Written as var(--dui-leading-110) | |
--dui-letter-spacing-heading | -0.02em | -0.02em | h1 to h3 Written as var(--dui-tracking-tight) | |
--dui-letter-spacing-display | -0.03em | -0.03em | h1 and page titles Written as var(--dui-tracking-tighter) | |
--dui-letter-spacing-hero | -0.045em | -0.045em | The h1 of a hero band: very tight, because large type looks loose Written as var(--dui-tracking-tightest) | |
--dui-line-height-hero | 1 | 1 | The h1 of a hero band: solid, so two lines read as one title Written as var(--dui-leading-100) | |
--dui-measure | 60ch | 60ch | Longest 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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-pattern-size | None | 1.5rem | 1.5rem | Spacing of the page pattern's grid: 24px Written as var(--dui-space-l) |
--dui-pattern-dot | None | 1px | 1px | Radius of each dot in the dotted page pattern: 1px Written as var(--dui-border-1) |
Space
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-space-3xs | 0.125rem | 0.125rem | Space scale † Written as var(--dui-space-1) | |
--dui-space-2xs | 0.25rem | 0.25rem | Space scale † Written as var(--dui-space-2) | |
--dui-space-xs | 0.5rem | 0.5rem | Space scale † Written as var(--dui-space-3) | |
--dui-space-s | 0.75rem | 0.75rem | Space scale † Written as var(--dui-space-4) | |
--dui-space-m | 1rem | 1rem | Space scale; default flow rhythm and .stack gap † Written as var(--dui-space-5) | |
--dui-space-l | 1.5rem | 1.5rem | Space scale; default .grid gap † Written as var(--dui-space-6) | |
--dui-space-xl | 2rem | 2rem | Space scale; space above h1–h3 † Written as var(--dui-space-7) | |
--dui-space-2xl | 3rem | 3rem | Space scale † Written as var(--dui-space-8) | |
--dui-space-3xl | 4rem | 4rem | Space scale † Written as var(--dui-space-9) |
Sizes
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-size-target | 2.25rem | 2.25rem | Comfortable 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-compact | 2rem | 2rem | Compact 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-small | 2rem | 2rem | Small 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-large | 2.5rem | 2.5rem | Large 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-row | 2rem | 2rem | Comfortable 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-compact | 1.75rem | 1.75rem | Compact 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-check | 1rem | 1rem | Checkbox 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-min | 16rem | 16rem | Default .grid min column width † Written as var(--dui-size-16) | |
--dui-size-menu-min | 12rem | 12rem | Min width of menus and nav dropdowns † Written as var(--dui-size-12) | |
--dui-size-drawer | 24rem | 24rem | Drawer width (all of the viewport when narrower) † Written as var(--dui-size-24) | |
--dui-size-page | 72rem | 72rem | Max inline size of a page's content column: header, main and footer Written as var(--dui-size-72) | |
--dui-size-narrow | 24rem | 24rem | Max inline size of a narrow page's one card: sign-in, sign-up, error pages Written as var(--dui-size-24) | |
--dui-size-icon | 1.25rem | 1.25rem | Decorative icons beside a label, on their own Written as var(--dui-size-1-25) | |
--dui-size-icon-inline | 1rem | 1rem | Icons inside buttons, menu items and toolbars, beside 14 to 16px text Written as var(--dui-size-1) | |
--dui-size-icon-nav | 1rem | 1rem | Decorative 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-chevron | None | calc(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-width | None | 1.75 | 1.75 | Stroke width of [data-icon] SVGs, set with the CSS stroke-width property Written as var(--dui-stroke-1-75) |
--dui-size-sidebar | 16rem | 16rem | Inline size of an app shell's primary sidebar when it sits beside main Written as var(--dui-size-16) | |
--dui-size-sidebar-aux | 20rem | 20rem | Inline size of an app shell's auxiliary (inline-end) sidebar when it sits beside main Written as var(--dui-size-20) | |
--dui-size-pane | None | 100svh | 100svh | Max 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-window | 100vw | 100vw | The window width a full-bleed band spans; the body clips the scrollbar part Written as var(--dui-size-100vw) |
Shape
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-radius-scale | 1 | 1 | Radius 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-pill | 999rem | 999rem | Fully rounded ends; not scaled, so pills stay round Written as var(--dui-radius-round) | |
--dui-border-width | 1px | 1px | Hairline width † Written as var(--dui-border-1) | |
--dui-border-width-emphasis | 0.25rem | 0.25rem | blockquote rule, alert start rule, invalid field † Written as var(--dui-border-4) | |
--dui-border-width-indicator | 3px | 3px | The selected tab's and the current nav item's bar in forced colors only † Written as var(--dui-border-3) | |
--dui-angle-chevron | None | 45deg | 45deg | Turn 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-check | 2px | 2px | Stroke 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-chevron | calc(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-offset | None | 0.15em | 0.15em | Link underline offset † Written as var(--dui-underline-offset-015em) |
--dui-underline-thickness | None | 0.0625em | 0.0625em | Link underline † Written as var(--dui-underline-1) |
--dui-underline-thickness-hover | None | 0.125em | 0.125em | Link underline on hover † Written as var(--dui-underline-2) |
Focus indicator
WCAG 2.4.7, 2.4.11, 2.4.13.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-focus-width | 3px | 3px | Focus ring width: 3px, as shadcn/ui's ring Written as var(--dui-border-3) | |
--dui-focus-offset | 0px | 0px | Focus 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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-motion-scale | None | 1 | 1 | Multiplies every motion duration: 2 is twice as slow, 0 turns motion off Written as var(--dui-factor-1) |
--dui-motion-movement | None | 1 | 1 | 1 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-enabled | None | 1 | 1 | 0 (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-standard | None | cubic-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-enter | None | cubic-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-exit | None | cubic-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-spring | None | cubic-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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-space-page-inline | 1.5rem | 1.5rem | Inline gutter of a plain document page's column, so content never touches the window edge Written as var(--dui-space-l) | |
--dui-space-section | None | clamp(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-inset | 0.5rem | 0.5rem | Gap between a floating panel and the viewport or frame edge Written as var(--dui-space-xs) |
Elevation knobs
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-elevation-strength | None | 100% | 100% | How much of --dui-color-shadow each shadow uses, 0% to 100% Written as var(--dui-mix-100) |
--dui-elevation-surface-step | None | 3% | 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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-density-scale | None | 1 | 1 | 1 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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-opacity-disabled | None | 0.6 | 0.6 | Disabled controls, disabled and aria-disabled="true" †Written as var(--dui-opacity-60) |
Contrast knob
Muted text, hairlines and tints follow it (section 2).
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-contrast | None | 1 | 1 | 1 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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-text-muted | color-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-border | oklch(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-amount | None | calc(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-amount | None | calc(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-text | oklch(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-link | oklch(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-focus | oklch(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-contrast | oklch(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-hover | oklch(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-hover | oklch(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-hover | oklch(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-heading | system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serif | system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", roboto, "Noto Sans", "Helvetica Neue", arial, sans-serif | Heading font stack † Written as var(--dui-font-body) | |
--dui-font-display | None | charter, "Bitstream Charter", "Sitka Text", cambria, serif | charter, "Bitstream Charter", "Sitka Text", cambria, serif | h1 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-pattern | oklch(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-dots | None | radial-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-image | None | radial-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-ui | 0.875rem | 0.875rem | Interface 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-field | 0.875rem | 0.875rem | Text 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-badge | 0.75rem | 0.75rem | Badge text: 12px, as shadcn/ui sets its badge (text-xs) Written as var(--dui-font-size-0-75) | |
--dui-font-size-page-title | clamp(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-control | calc(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-surface | calc(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-check | calc(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-accent-surface | color-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-surface | color-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-surface | color-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-surface | color-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-halo | color-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-surface | color-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-border | color-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-border | color-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-border | color-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-border | color-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-thumb | oklch(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
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-color-surface-inverse | oklch(28% 0.035 45deg) | oklch(95% 0.012 85deg) | Tooltip background † Written as var(--dui-color-text) | |
--dui-color-text-inverse | oklch(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-motion-duration-fast | None | calc(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-normal | None | calc(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-slow | None | calc(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-distance | None | calc(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-zoom | None | calc(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-scale | None | calc(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-elevation-shadow-color | color-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-ring | None | 0 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-highlight | None | inset 0 1px 0 0 transparent | inset 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-0 | None | none | none | Level 0, flat: no shadow Written as var(--dui-shadow-none) |
--dui-elevation-control | None | 0 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-1 | None | 0 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-2 | None | inset 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-3 | None | inset 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-4 | None | inset 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-surface | oklch(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-surface | oklch(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-surface | oklch(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-surface | oklch(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-surface | oklch(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-elevation-flat | None | none | none | Shadow of content on the page Written as var(--dui-elevation-0) |
--dui-elevation-flat-surface | oklch(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-raised | None | 0 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-surface | oklch(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-panel | None | 0 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-surface | oklch(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-overlay | None | inset 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-surface | oklch(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-popover | None | inset 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-surface | oklch(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-dialog | None | inset 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-surface | oklch(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-size-control | None | calc(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-row | None | calc(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-block | None | calc(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-inline | None | calc(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-inline | None | calc(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-gap | None | calc(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-tight | None | calc(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-nested | max(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-bar | None | calc(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-cell | None | calc(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.
| Token | Preview | Light | Dark | Description |
|---|---|---|---|---|
--dui-shadow-raised | 0 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-fast | None | calc(120ms * 1 * 1) | calc(120ms * 1 * 1) | Deprecated: use --dui-motion-duration-fast Written as var(--dui-motion-duration-fast) |
--dui-duration-normal | None | calc(200ms * 1 * 1) | calc(200ms * 1 * 1) | Deprecated: use --dui-motion-duration-normal Written as var(--dui-motion-duration-normal) |
--dui-easing-standard | None | cubic-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) |