Skip to content
EldanCSS

Docs

Customization

Override the tokens that drive color, type, spacing, and measure.

EldanCSS exposes a small token layer. Override the values after the stylesheet loads, or edit them in place.

Color

The palette is generated from --hue and --saturation. --hue shifts the accent and surface family; --saturation is a 0–1 multiplier. At 0, the palette becomes grayscale and accent lightness is lowered to preserve contrast.

241
100%
accent
hover
code
border
surface
danger

Drag either slider to retint this documentation. Saturation 0 produces an accessible grayscale palette. Reset restores hue 241 and saturation 100%. The snippet below updates to match, ready to copy.

Copy this CSS

:root {
  --hue: 241;
  --saturation: 1;
}

The palette inputs are:

TokenPurpose
--hueBase hue, 0–360
--saturationSaturation multiplier, 0–1; 0 is grayscale

For finer control, override the individual color tokens:

TokenPurpose
--color-bgPage background
--color-surfaceInputs, articles, and details
--color-textBody and heading text
--color-mutedSecondary text and markers
--color-borderDividers and control borders
--color-accentLinks, buttons, focus rings, and selections
--color-accent-hoverHover state for accent surfaces
--color-on-accentText placed on the accent color
--color-codeInline code and code block background
--color-dangerInvalid form controls

Forced schemes

Each token is declared with light-dark() and color-scheme: light dark, so the active scheme follows prefers-color-scheme unless a root selector forces one. Override tokens per scheme with an attribute selector:

:root[data-theme="light"] {
  --color-bg: hsl(200 20% 98%);
}

:root[data-theme="dark"] {
  --color-bg: hsl(200 20% 8%);
  --color-accent: hsl(200 75% 72%);
}

When no data-theme is present, target @media (prefers-color-scheme: dark) instead. See Getting started for a complete switcher.

Type and spacing

TokenPurpose
--font-sansBody text
--font-monoCode and labels
--font-headingHeadings (defaults to --font-mono)
--measureMaximum body width
--text-baseBase font size
--h1 … --h6Heading sizes
--space-1 … --space-8Spacing scale
:root {
  --measure: 72ch;
  --radius: 0.2rem;
  --h1: clamp(2rem, 1.5rem + 2.5vw, 3rem);
}

Headings use the monospace stack by default. Set --font-heading to any stack if you would rather not have monospace headings — for example, to match the body text:

:root {
  --font-heading: var(--font-sans);
}

Toggles the headings on this page, or rolls a random stack from Modern Font Stacks. The snippet below follows along, ready to copy.

Heading 3 Example

Copy this CSS

:root {
  --font-heading: var(--font-mono);
}

Borders

--radius controls the small radius used by controls, code, and articles. --radius-lg is used for dialogs, popovers, and larger surfaces.

:root {
  --radius: 0.25rem;
  --radius-lg: 0.5rem;
}