Reference for every CSS custom property token and how the four-layer token cascade resolves them
Sarde uses CSS custom properties (prefixed --sd-*) called tokens to control every visual aspect of the generated site. Override any token in theme.overrides or theme.dark_overrides in sarde.yaml.
YAML
theme:
overrides:
accent:"#2563eb"
radius:"0.25rem"
font-sans:"'Inter', sans-serif"
dark_overrides:
bg:"#111113"
Token cascade
Tokens resolve through four layers. Each layer overrides the one before it. Empty-string values never override a lower layer.
Priority
Layer
Source
1 (lowest)
Embedded defaults
Hardcoded Go maps compiled into the binary
2
Theme base tokens
theme.yaml top-level tokens: / dark_tokens:
3
Preset tokens
Selected preset's tokens: / dark_tokens:
4 (highest)
User overrides
sarde.yamltheme.overrides / theme.dark_overrides
Primitives
The base color palette. Grays follow the Zinc scale in OKLCH.
Token
Default
white
oklch(1 0 0)
black
oklch(0.145 0.005 286)
gray-1
oklch(0.985 0.002 286)
gray-2
oklch(0.967 0.003 286)
gray-3
oklch(0.920 0.004 286)
gray-4
oklch(0.705 0.015 286)
gray-5
oklch(0.553 0.014 286)
gray-6
oklch(0.442 0.012 286)
gray-7
oklch(0.370 0.011 286)
gray-8
oklch(0.274 0.006 286)
gray-9
oklch(0.210 0.006 286)
Dark mode remaps semantic tokens (text, bg, border) instead of redefining the primitive gray scale.
Status colors
Hues
OKLCH hue angles used as the base for status color calculations.
Token
Default
hue-accent
264
hue-green
155
hue-amber
75
hue-red
25
hue-cyan
196
Color scales
Each status color has three variants: the base color, a -low variant for subtle background tints, and a -high variant for stronger foreground emphasis.
Token
Default
green
oklch(0.52 0.15 var(--sd-hue-green))
green-low
oklch(0.95 0.04 var(--sd-hue-green))
green-high
oklch(0.65 0.18 var(--sd-hue-green))
amber
oklch(0.75 0.16 var(--sd-hue-amber))
amber-low
oklch(0.96 0.04 var(--sd-hue-amber))
amber-high
oklch(0.79 0.16 var(--sd-hue-amber))
red
oklch(0.55 0.20 var(--sd-hue-red))
red-low
oklch(0.96 0.05 var(--sd-hue-red))
red-high
oklch(0.65 0.22 var(--sd-hue-red))
blue
oklch(0.62 0.20 231)
blue-low
oklch(0.97 0.02 231)
blue-high
oklch(0.70 0.18 231)
purple
oklch(0.59 0.23 293)
purple-low
oklch(0.97 0.02 293)
purple-high
oklch(0.70 0.22 293)
Extended hues
Additional hue angles and color scales for cyan and indigo.
Frosted-glass effect tokens used for overlays and backdrop panels.
Token
Default
glass-bg
oklch(1 0 0 / 0.8)
glass-blur
12px
glass-border
oklch(1 0 0 / 0.2)
Code block tokens
Token
Default
Description
code-bg
var(--sd-bg-surface)
Code block background
code-text
var(--sd-text)
Code block text color
code-border
var(--sd-border)
Code block border color
code-font
var(--sd-font-mono)
Code block font family
code-font-size
var(--sd-text-sm)
Code block font size
code-line-height
1.7
Code block line height
code-padding
var(--sd-space-4)
Code block inner padding
code-radius
var(--sd-radius-lg)
Code block corner radius
code-btn-size
2rem
Toolbar button size
code-btn-bg
transparent
Toolbar button background
code-btn-text
var(--sd-text-muted)
Toolbar button text color
code-btn-bg-hover
var(--sd-hover)
Toolbar button hover background
code-btn-text-hover
var(--sd-text)
Toolbar button hover text color
Aside tokens
Foreground and background color pairs for each aside type.
Token
Default
aside-note
var(--sd-blue)
aside-note-bg
var(--sd-blue-low)
aside-tip
var(--sd-green)
aside-tip-bg
var(--sd-green-low)
aside-info
var(--sd-cyan)
aside-info-bg
var(--sd-cyan-low)
aside-caution
var(--sd-amber)
aside-caution-bg
var(--sd-amber-low)
aside-danger
var(--sd-red)
aside-danger-bg
var(--sd-red-low)
aside-success
var(--sd-green)
aside-success-bg
var(--sd-green-low)
Accent derivation
Setting theme.accent_color or theme.overrides.accent triggers automatic derivation of three variant tokens. If any variant is already set explicitly, that variant is kept as-is.
Derived token
Purpose
accent-hover
Slightly darker accent for hover states
accent-high
Lighter accent for dark-mode emphasis
accent-low
Accent at 10% opacity for subtle backgrounds
The derivation formulas depend on the color format of the accent value.
=== Hex
For hex colors (#RGB or #RRGGBB), derivation converts to HSL, adjusts lightness, and converts back.
Token
Formula
accent-hover
Lightness - 0.10 (10% darker)
accent-high
Lightness + 0.20 (20% lighter)
accent-low
rgba(r, g, b, 0.1)
=== OKLCH
For OKLCH colors (oklch(L C H)), derivation adjusts the lightness component directly.
Token
Formula
accent-hover
L - 0.08
accent-high
L + 0.12
accent-low
oklch(L C H / 0.1)
Accent values in other formats (named colors, hsl(), CSS variables) skip derivation gracefully. Set accent-hover, accent-high, and accent-low manually in that case.
Presets
Seven built-in presets provide ready-made visual identities. Set one with theme.preset in sarde.yaml.
YAML
theme:
preset:ocean
Palette presets override the accent color and gray scale (gray-1 through gray-7) to tint the entire UI. Full-look presets change colors, typography, and border radius together.