Theme
@adecore/ui/theme.css holds the tokens every component draws with. Each color token has a light and a dark value, switched by data-theme="light" or data-theme="dark" on <html>.
data-theme also works on any element inside the page, as a scope: a light subtree in a dark window, such as a message drawn on white as its sender made it, or a dark one in a light window. The tokens and the dark: variant follow the nearest scope, up to three scopes deep from <html>.
<article data-theme="light" className="bg-surface text-text">
{/* Components in here draw their light look, also when the window is dark. */}
</article>The theme maps the tokens onto Tailwind utilities (bg-surface, text-text-muted, border-border, shadow-float) and clears Tailwind's default palette with --color-*: initial. Components and your app can reach only these colors until you add your own.
Ground and surfaces
--bg is the page. Panels and cards are --surface; popups, menus and dialogs float on --surface-raised. --surface-sunken is the recessed track of a segmented control, or a field without a box. --track is what a bar or ring fills, an alpha that holds on any surface. --surface-hover is lighter than --surface-active, so pressed outranks hover. --field is what a person types or picks in, a step lighter than the panel in the dark theme. --thumb is the knob of a slider or switch, set apart from its track in both themes. --scrollbar-thumb, --scrollbar-thumb-hover, --scrollbar-thumb-active and --scrollbar-track color the overlay bars of a ScrollArea, alphas over whatever the bar floats on.
| Token | Light | Dark |
|---|---|---|
--bgbg-bg, text-bg, border-bg | #f4f4f5 | #0d0d10 |
--surfacebg-surface, text-surface, border-surface | #ffffff | #131316 |
--surface-raisedbg-surface-raised, text-surface-raised, border-surface-raised | #ffffff | #18181c |
--surface-sunkenbg-surface-sunken, text-surface-sunken, border-surface-sunken | #ececef | #0b0b0e |
--surface-idlebg-surface-idle, text-surface-idle, border-surface-idle | color-mix(in srgb, var(--surface) 50%, var(--surface-sunken)) | color-mix(in srgb, var(--surface) 50%, var(--surface-sunken)) |
--surface-hoverbg-surface-hover, text-surface-hover, border-surface-hover | #f3f3f5 | #202024 |
--surface-hover-edgedbg-surface-hover-edged, text-surface-hover-edged, border-surface-hover-edged | color-mix(in srgb, var(--surface-raised) 60%, var(--surface-hover)) | color-mix(in srgb, var(--surface-raised) 60%, var(--surface-hover)) |
--surface-activebg-surface-active, text-surface-active, border-surface-active | #dcdce2 | #28282e |
--thumbbg-thumb, text-thumb, border-thumb | #ffffff | #ececf1 |
Borders
A border is an alpha over whatever is behind it, never a gray of its own (see Principles). --border-soft is the hairline between rows, --border-strong the outline of a control that has to read as one.
| Token | Light | Dark |
|---|---|---|
--borderbg-border, text-border, border-border | rgb(0 0 0 / 0.11) | rgb(255 255 255 / 0.07) |
--separatorbg-separator, text-separator, border-separator | oklch(0.922 0.003 286.347) | oklch(0.236 0.006 285.956) |
--border-strongbg-border-strong, text-border-strong, border-border-strong | rgb(0 0 0 / 0.2) | rgb(255 255 255 / 0.13) |
--border-softbg-border-soft, text-border-soft, border-border-soft | rgb(0 0 0 / 0.06) | rgb(255 255 255 / 0.03) |
--separator is opaque and fills the space between separated panels. To match borders to those gaps, set --border: var(--separator) in both theme scopes.
Text
| Token | Light | Dark |
|---|---|---|
--textbg-text, text-text, border-text | #18181b | #ececf1 |
--text-mutedbg-text-muted, text-text-muted, border-text-muted | #6f6f78 | #9a9aa6 |
--text-faintbg-text-faint, text-text-faint, border-text-faint | #a1a1aa | #5f5f6b |
Accent
The accent marks the primary button, the focus outline, a picked choice and the text selection. The default is a neutral blue; your app sets its own (below).
--accent-on-surface is the accent as text, an icon or the focus outline on a ground. It is the accent itself until an app sets a version that reads on its surface. text-accent and the focus outline take it; bg-accent and border-accent keep the exact accent.
| Token | Light | Dark |
|---|---|---|
--accentbg-accent, text-accent, border-accent | #155dfc | #155dfc |
--accent-rgb | 21 93 252 | 21 93 252 |
--accent-softbg-accent-soft, text-accent-soft, border-accent-soft | color-mix(in srgb, var(--accent) 16%, var(--surface)) | color-mix(in srgb, var(--accent) 16%, var(--surface)) |
--accent-textbg-accent-text, text-accent-text, border-accent-text | #ffffff | #ffffff |
--accent-on-surfacebg-accent-on-surface, text-accent-on-surface, border-accent-on-surface | var(--accent) | var(--accent) |
--selection | rgb(var(--accent-rgb) / 0.55) | rgb(var(--accent-rgb) / 0.6) |
Status
Four tokens mark the state something is in (running, waiting on a person, idle, failed). --positive fills a step that went well.
| Token | Light | Dark |
|---|---|---|
--status-runningbg-status-running, text-status-running, border-status-running | #2563eb | #60a5fa |
--status-needs-youbg-status-needs-you, text-status-needs-you, border-status-needs-you | #b45309 | #fbbf24 |
--status-idlebg-status-idle, text-status-idle, border-status-idle | #15803d | #4ade80 |
--status-errorbg-status-error, text-status-error, border-status-error | #b91c1c | #f87171 |
--positivebg-positive, text-positive, border-positive | #15803d | #4ade80 |
--positive-textbg-positive-text, text-positive-text, border-positive-text | #ffffff | #052e16 |
Shadows
--float-shadow lifts everything that floats: menus, dialogs, tooltips, toasts. --raised-shadow is the small lift of a picked segment off its track, and --thumb-shadow the edge and lift of a thumb.
| Token | Light | Dark |
|---|---|---|
--float-shadowshadow-float | 0 1px 2px -1px rgb(0 0 0 / 0.08), 0 3px 6px -2px rgb(0 0 0 / 0.07), 0 8px 16px -8px rgb(0 0 0 / 0.1), 0 16px 28px -14px rgb(0 0 0 / 0.1) | 0 1px 2px -1px rgb(0 0 0 / 0.3), 0 2px 4px rgb(0 0 0 / 0.24), 0 4px 8px rgb(0 0 0 / 0.18), 0 6px 12px rgb(0 0 0 / 0.1) |
--raised-shadowshadow-raised | 0 1px 2px rgb(0 0 0 / 0.05), 0 2px 4px -1px rgb(0 0 0 / 0.05), 0 6px 12px -6px rgb(0 0 0 / 0.08) | 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 4px rgb(0 0 0 / 0.2), 0 4px 8px rgb(0 0 0 / 0.12) |
--thumb-shadowshadow-thumb | 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06) | 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 4px -1px rgb(0 0 0 / 0.4) |
--sheet-shadow | 0 0 7px rgb(30 30 50 / 0.06) | 0 0 14px rgb(0 0 0 / 0.3) |
Media
These tokens color a control drawn over a picture, such as the handle of a Wipe. They keep one value in both themes.
| Token | Light | Dark |
|---|---|---|
--media-handlebg-media-handle, text-media-handle, border-media-handle | #ffffff | #ffffff |
--media-handle-textbg-media-handle-text, text-media-handle-text, border-media-handle-text | #18181b | #18181b |
--media-handle-edgeshadow-media-handle-edge | 0 0 0 1px rgb(0 0 0 / 0.3) | 0 0 0 1px rgb(0 0 0 / 0.3) |
--media-handle-shadowshadow-media-handle | 0 2px 12px rgb(0 0 0 / 0.35) | 0 2px 12px rgb(0 0 0 / 0.35) |
Chart series
Chart series colors in order: the accent, then orange, aqua, yellow, magenta and green. The order is checked for color vision deficiency on both grounds. A series without its own tone takes the next one, as in @adecore/charts.
| Token | Light | Dark |
|---|---|---|
--chart-1 | var(--accent) | var(--accent) |
--chart-2 | #eb6834 | #d95926 |
--chart-3 | #1baf7a | #199e70 |
--chart-4 | #eda100 | #c98500 |
--chart-5 | #e87ba4 | #d55181 |
--chart-6 | #008300 | #008300 |
File icons
The palette FileIcon colors file types with. The theme never tints a file icon, so TypeScript stays blue everywhere.
| Token | Light | Dark |
|---|---|---|
--file-icon-gray | #84848a | #adadb1 |
--file-icon-red | #d52c36 | #ff6762 |
--file-icon-vermilion | #ff8c5b | #d5512f |
--file-icon-orange | #d47628 | #ffa359 |
--file-icon-yellow | #d5a910 | #ffd452 |
--file-icon-green | #199f43 | #5ecc71 |
--file-icon-teal | #17a5af | #64d1db |
--file-icon-cyan | #1ca1c7 | #68cdf2 |
--file-icon-blue | #1a85d4 | #69b1ff |
--file-icon-indigo | #693acf | #9d6afb |
--file-icon-purple | #a631be | #d568ea |
--file-icon-pink | #d32a61 | #ff678d |
--file-icon-mauve | #594c5b | #79697b |
Layers
All z-indexes live here, so a new popup takes a named step instead of a number. A dialog sits under the menus and selects it opens, tooltips over both, and the shortcut hints over everything. Reach a step with z-(--z-popup).
| Token | Light | Dark |
|---|---|---|
--z-dialog-backdrop | 80 | 80 |
--z-dialog | 90 | 90 |
--z-popup | 100 | 100 |
--z-tooltip | 110 | 110 |
--z-shortcut-hints | 120 | 120 |
| Token | Light | Dark |
|---|---|---|
--trackbg-track, text-track, border-track | rgb(0 0 0 / 0.09) | rgb(255 255 255 / 0.11) |
--scrollbar-thumb | rgb(0 0 0 / 0.22) | rgb(255 255 255 / 0.22) |
--scrollbar-thumb-hover | rgb(0 0 0 / 0.38) | rgb(255 255 255 / 0.38) |
--scrollbar-thumb-active | rgb(0 0 0 / 0.5) | rgb(255 255 255 / 0.5) |
--scrollbar-track | rgb(0 0 0 / 0.04) | rgb(255 255 255 / 0.04) |
--fieldbg-field, text-field, border-field | var(--surface-raised) | color-mix(in srgb, var(--surface) 40%, var(--surface-hover)) |
--field-borderbg-field-border, text-field-border, border-field-border | rgb(0 0 0 / 0.11) | rgb(255 255 255 / 0.1) |
--match | color-mix(in srgb, var(--status-needs-you) 30%, transparent) | color-mix(in srgb, var(--status-needs-you) 28%, transparent) |
--scene-top | #ffffff | #2c2c32 |
--scene-bottom | #ececf1 | #1a1a1f |
--scene-rim | rgb(0 0 0 / 0.09) | rgb(255 255 255 / 0.08) |
--scene-line | rgb(0 0 0 / 0.12) | rgb(255 255 255 / 0.1) |
--scene-inset | rgb(0 0 0 / 0.06) | rgb(0 0 0 / 0.3) |
--scene-text | rgb(0 0 0 / 0.14) | rgb(255 255 255 / 0.16) |
--scene-lift | drop-shadow(0 1px 1px rgb(0 0 0 / 0.08)) drop-shadow(0 5px 10px rgb(0 0 0 / 0.08)) | drop-shadow(0 1px 0 rgb(0 0 0 / 0.4)) drop-shadow(0 6px 10px rgb(0 0 0 / 0.35)) |
--scene-arrive | cubic-bezier(0.34, 1.5, 0.55, 1) | cubic-bezier(0.34, 1.5, 0.55, 1) |
Type scale
Sizes are rem, rounded to whole pixels, against the font size your app sets on <html>. 15px reads well in a desktop app. Code keeps an absolute size.
2xs (12px at a 15px root) is only for a small label in a row of xs, such as a Pill. Nothing goes below it.
| Token | Value | Sample |
|---|---|---|
--text-2xs | round(0.8rem, 1px)round(1.25rem, 1px) | Build history |
--text-xs | round(0.875rem, 1px)round(1.25rem, 1px) | Build history |
--text-sm | round(0.9375rem, 1px)round(1.375rem, 1px) | Build history |
--text-base | round(1rem, 1px)round(1.5rem, 1px) | Build history |
--text-lg | round(1.125rem, 1px)round(1.5rem, 1px) | Build history |
--text-4xl | round(2.25rem, 1px)round(2.5rem, 1px) | Build history |
--text-code | 13px20px | Build history |
| Token | Value | Sample |
|---|---|---|
--leading-tight | round(1.25em, 1px) | Build history |
--leading-snug | round(1.375em, 1px) | Build history |
--leading-normal | round(1.5em, 1px) | Build history |
Radius
| Token | Value | Sample |
|---|---|---|
--radius-xs | round(0.125rem, 1px) | |
--radius-sm | round(0.25rem, 1px) | |
--radius-md | round(0.375rem, 1px) | |
--radius-lg | round(0.5rem, 1px) | |
--radius-xl | round(0.75rem, 1px) | |
--radius-2xl | round(1rem, 1px) |
Code
Code (an editor, a grid of database values, a statement) has one size apart from the type scale. --code-font-size and --code-line-height default to --text-code and its line height. Set them on <html>, for example from an editor font setting, and every code view follows. Utilities reach them as text-(length:--code-font-size) and leading-(--code-line-height).
| Token | Light | Dark |
|---|---|---|
--code-font-size | var(--text-code) | var(--text-code) |
--code-line-height | var(--text-code--line-height) | var(--text-code--line-height) |
Spacing and fonts
The spacing unit is rounded, so every step lands on a whole pixel. Override --font-mono on <html> when a person picks a monospace font; font-mono follows.
| Token | Value |
|---|---|
--spacing | round(0.25rem, 1px) |
| Token | Value | Sample |
|---|---|---|
--font-sans | -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif | Build history |
--font-mono | ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace | Build history |
Your own accent
Set the accent after the theme import, in both forms. --accent-rgb is the same color as channels, for tokens that add an alpha, such as the text selection.
@import "tailwindcss";
@import "@adecore/ui/theme.css";
:root {
--accent: #7c3aed;
--accent-rgb: 124 58 237;
}--accent-soft follows by itself. Set --accent-text if white does not read on your accent, and --accent-on-surface if the accent itself does not reach 3:1 against --surface as text or as the focus outline. For a separate dark accent, repeat the rule under [data-theme="dark"].
Your own colors
Add a token in both themes and map it onto a Tailwind color:
:root, [data-theme="light"] {
--brand: #0f766e;
}
[data-theme="dark"] {
--brand: #2dd4bf;
}
@theme inline {
--color-brand: var(--brand);
}Now bg-brand, text-brand and border-brand/40 exist. inline makes the utility follow data-theme. A token derived with var() resolves where it is declared, so declare it in the same rule as the tokens it reads.
Rules the utilities cannot write
A few classes cover what a utility cannot express: Base UI state attributes, pseudo-elements, keyframes. Use them for something that has to look like a component.
| Class | What it draws |
|---|---|
.icon-btn, .icon-btn-sm, .icon-btn-xs, .icon-btn-2xs | The square of an icon button and its pressed and disabled states. |
.field, .field-sm | A text field's border, height and focus outline. |
.menu-popup, .picker-popup, .menu-item | A menu's surface and a row in it, with its highlighted and disabled states. |
.cursor-row | A row of a list the arrow keys walk that is not a Base UI menu, with data-active="true" on the current one. |
.dialog-popup, .dialog-backdrop, .lightbox-frame, .lightbox-backdrop | A dialog's surface and dim, and a dialog that shows only a picture. |
.tooltip-positioner, .tooltip-popup | A tooltip that fades in from the side of its trigger. |
.focus-ring, .focus-ring-within | The keyboard focus outline on something that is not a button, or on a card around a focused field. |
.scroll-fade-x, .scroll-fade-top | A fade at an edge that still hides content, switched on by data-fade-start and data-fade-end. .scroll-fade-x takes its width from --fade-size. |
.file-icon | A file icon outside the tree: the hue the sprite gives its file type, or the muted text color. |
Every class sits in Tailwind's components layer, so a utility on the same element still wins.