Design tokens
The design system is built on a small set of semantic design tokens shipped by @civitai/theme. Every --civitai-* custom property, its light and dark value, and the value your browser actually resolves are shown below — read live from the published package, so this page can never drift from what a consumer installs.
How tokens are consumed
Tokens ship in three interchangeable forms:
- CSS custom properties — link
@civitai/theme/styles.css(orinjectTokens()from JS). Every--civitai-*property is registered with@propertyand re-resolves under a[data-theme="light|dark"]scope. - Typed JS/TS export —
tokens(light values),darkTokens(dark overrides), andtokenVars(var(--civitai-*)reference strings) from@civitai/theme, with aTokenNameunion. - DTCG JSON —
@civitai/theme/tokens.jsonfor design-tool import.
import { tokens, darkTokens, tokenVars, type TokenName } from '@civitai/theme';
// Resolved light value: tokens.colorPrimary // "#228BE6"
// Dark override: darkTokens.colorPrimary // "#1971C2"
// CSS var reference (for styling): tokenVars.colorPrimary // "var(--civitai-color-primary)"
const brand: TokenName = 'colorPrimary';Theme a subtree by setting data-theme on any ancestor; all tokens re-resolve from that scope:
<div data-theme="dark">
<!-- --civitai-* tokens here resolve to the dark palette -->
</div>Token gallery
All 27 tokens below are read live from the published @civitai/theme export. The tokens form a single semantic layer (e.g. colorPrimary, colorSurface) — there is no separate raw-palette layer at this version; consumers reference the semantic names and let the [data-theme] scope resolve light vs. dark.
Colors
Typography
--civitai-font The quick brown fox jumps over the lazy dog — 0123456789 --civitai-font-mono The quick brown fox jumps over the lazy dog — 0123456789 Radius & shape
--civitai-radius0.25remAll tokens
| Token | CSS custom property | Light | Dark |
|---|---|---|---|
font | --civitai-font | -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji | -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji |
fontMono | --civitai-font-mono | ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace | ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace |
radius | --civitai-radius | 0.25rem | 0.25rem |
colorText | --civitai-color-text | #222 | #C1C2C5 |
colorTextDimmed | --civitai-color-text-dimmed | #868e96 | #8c8fa3 |
colorBody | --civitai-color-body | #fefefe | #1A1B1E |
colorSurface | --civitai-color-surface | #fefefe | #1A1B1E |
colorSurface2 | --civitai-color-surface-2 | #fefefe | #25262B |
colorBorder | --civitai-color-border | #ced4da | #373A40 |
colorPrimary | --civitai-color-primary | #228BE6 | #1971C2 |
colorPrimaryHover | --civitai-color-primary-hover | #1C7ED6 | #1864AB |
colorPrimaryFg | --civitai-color-primary-fg | #fefefe | #fefefe |
colorPrimaryLight | --civitai-color-primary-light | rgba(34, 139, 230, 0.1) | rgba(34, 139, 230, 0.15) |
colorError | --civitai-color-error | #fa5252 | #e03131 |
colorSuccess | --civitai-color-success | #299C7A | #326D5C |
colorWarning | --civitai-color-warning | #fd7e14 | #e8590c |
colorInfo | --civitai-color-info | #228BE6 | #1971C2 |
colorGray0 | --civitai-color-gray-0 | #f8f9fa | #f8f9fa |
colorGray1 | --civitai-color-gray-1 | #f1f3f5 | #f1f3f5 |
colorGray2 | --civitai-color-gray-2 | #e9ecef | #e9ecef |
colorGray3 | --civitai-color-gray-3 | #dee2e6 | #dee2e6 |
colorGray4 | --civitai-color-gray-4 | #ced4da | #ced4da |
colorGray5 | --civitai-color-gray-5 | #adb5bd | #adb5bd |
colorGray6 | --civitai-color-gray-6 | #868e96 | #868e96 |
colorGray7 | --civitai-color-gray-7 | #495057 | #495057 |
colorGray8 | --civitai-color-gray-8 | #343a40 | #343a40 |
colorGray9 | --civitai-color-gray-9 | #212529 | #212529 |
Component size scales
Spacing and sizing come from each component's data-gap / data-padding / data-size presets (resolved in @civitai/components), not from theme tokens. For reference:
| Preset | Stack gap | Group gap | Card padding |
|---|---|---|---|
sm | 8px | 6px | 10px |
md | 16px | 16px | 16px |
lg | 24px | 24px | 24px |
DTCG export
The same tokens are published as a DTCG document at @civitai/theme/tokens.json for design-tool import:
View tokens.json
{
"font": {
"font": {
"$type": "fontFamily",
"$value": "-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",
"$description": "Base UI font stack (Mantine default system stack)."
},
"mono": {
"$type": "fontFamily",
"$value": "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",
"$description": "Monospace font stack."
}
},
"radius": {
"radius": {
"$type": "dimension",
"$value": {
"value": 0.25,
"unit": "rem"
},
"$description": "Default corner radius (civitai leaves Mantine's `sm` default)."
}
},
"color": {
"text": {
"$type": "color",
"$value": "#222",
"$description": "Primary body text color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#C1C2C5"
}
}
},
"textDimmed": {
"$type": "color",
"$value": "#868e96",
"$description": "Secondary / muted text color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#8c8fa3"
}
}
},
"body": {
"$type": "color",
"$value": "#fefefe",
"$description": "Page / document background (derived from Mantine's `--mantine-color-body`). Use for `body { background }` in plain-HTML apps.",
"$extensions": {
"com.civitai.theme": {
"dark": "#1A1B1E"
}
}
},
"surface": {
"$type": "color",
"$value": "#fefefe",
"$description": "Primary surface / page background.",
"$extensions": {
"com.civitai.theme": {
"dark": "#1A1B1E"
}
}
},
"surface2": {
"$type": "color",
"$value": "#fefefe",
"$description": "Secondary surface (inputs, insets).",
"$extensions": {
"com.civitai.theme": {
"dark": "#25262B"
}
}
},
"border": {
"$type": "color",
"$value": "#ced4da",
"$description": "Default border / divider color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#373A40"
}
}
},
"primary": {
"$type": "color",
"$value": "#228BE6",
"$description": "Primary accent (filled) color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#1971C2"
}
}
},
"primaryHover": {
"$type": "color",
"$value": "#1C7ED6",
"$description": "Primary accent hover color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#1864AB"
}
}
},
"primaryFg": {
"$type": "color",
"$value": "#fefefe",
"$description": "Foreground/text color on a filled primary surface.",
"$extensions": {
"com.civitai.theme": {
"dark": "#fefefe"
}
}
},
"primaryLight": {
"$type": "color",
"$value": "rgba(34, 139, 230, 0.1)",
"$description": "Translucent primary tint (light variant background).",
"$extensions": {
"com.civitai.theme": {
"dark": "rgba(34, 139, 230, 0.15)"
}
}
},
"error": {
"$type": "color",
"$value": "#fa5252",
"$description": "Error / destructive color.",
"$extensions": {
"com.civitai.theme": {
"dark": "#e03131"
}
}
},
"success": {
"$type": "color",
"$value": "#299C7A",
"$description": "Success color (civitai's custom `success` palette).",
"$extensions": {
"com.civitai.theme": {
"dark": "#326D5C"
}
}
},
"warning": {
"$type": "color",
"$value": "#fd7e14",
"$description": "Warning color (derived from the orange palette).",
"$extensions": {
"com.civitai.theme": {
"dark": "#e8590c"
}
}
},
"info": {
"$type": "color",
"$value": "#228BE6",
"$description": "Informational color (derived from the blue palette).",
"$extensions": {
"com.civitai.theme": {
"dark": "#1971C2"
}
}
},
"gray0": {
"$type": "color",
"$value": "#f8f9fa",
"$description": "Neutral ramp step 0 (Mantine gray[0]); 0 = lightest … 9 = darkest."
},
"gray1": {
"$type": "color",
"$value": "#f1f3f5",
"$description": "Neutral ramp step 1 (Mantine gray[1]); 0 = lightest … 9 = darkest."
},
"gray2": {
"$type": "color",
"$value": "#e9ecef",
"$description": "Neutral ramp step 2 (Mantine gray[2]); 0 = lightest … 9 = darkest."
},
"gray3": {
"$type": "color",
"$value": "#dee2e6",
"$description": "Neutral ramp step 3 (Mantine gray[3]); 0 = lightest … 9 = darkest."
},
"gray4": {
"$type": "color",
"$value": "#ced4da",
"$description": "Neutral ramp step 4 (Mantine gray[4]); 0 = lightest … 9 = darkest."
},
"gray5": {
"$type": "color",
"$value": "#adb5bd",
"$description": "Neutral ramp step 5 (Mantine gray[5]); 0 = lightest … 9 = darkest."
},
"gray6": {
"$type": "color",
"$value": "#868e96",
"$description": "Neutral ramp step 6 (Mantine gray[6]); 0 = lightest … 9 = darkest."
},
"gray7": {
"$type": "color",
"$value": "#495057",
"$description": "Neutral ramp step 7 (Mantine gray[7]); 0 = lightest … 9 = darkest."
},
"gray8": {
"$type": "color",
"$value": "#343a40",
"$description": "Neutral ramp step 8 (Mantine gray[8]); 0 = lightest … 9 = darkest."
},
"gray9": {
"$type": "color",
"$value": "#212529",
"$description": "Neutral ramp step 9 (Mantine gray[9]); 0 = lightest … 9 = darkest."
}
}
}