Skip to main content

dress.css

Variables

Every design token is exposed by dress.css as a CSS variable so you can adapt the palette, spacing, and motion without editing the library itself. Override them globally in your own stylesheet:

:root {
	--dress-bg: #f5f5f5;
	--dress-lk: rebeccapurple;
	--dress-mw: 64rem;
}

Variables fall into two groups: primary tokens (raw values such as colours or spacing constants) and derived tokens that are calculated from them. Whenever possible, override the primary value and let the derived siblings update automatically.

⚠️ Note some variable names have changed from v4.


Contents

Palette

Surface

VariableDescription
--dress-bgBase page background colour
--dress-fgDefault body text colour
--dress-bg-2Raised block background derived from --dress-bg
--dress-dtBorder/detail colour used for strokes
VariableDescription
--dress-lkDefault link colour
--dress-lk-hHover/focus link colour
--dress-lk-aActive link colour
--dress-lk-vVisited link colour
--dress-lk-txText colour when links sit on solid accents

Buttons

VariableDescription
--dress-bt-1Primary button background (default)
--dress-bt-1-hPrimary button background (hover/focus)
--dress-bt-1-aPrimary button background (active)
--dress-bt-1-txPrimary button text colour
--dress-bt-2Secondary button background (default)
--dress-bt-2-hSecondary button background (hover/focus)
--dress-bt-2-aSecondary button background (active)
--dress-bt-2-txSecondary button text colour

Semantic Accents

VariableDescription
--dress-secSecondary highlight colour
--dress-sec-txSecondary highlight text colour
--dress-mkMark/highlight background
--dress-mk-txMark/highlight text colour
--dress-negBase red tone for destructive states
--dress-posBase green tone for constructive states
--dress-delSoft delete background
--dress-insSoft insert background
--dress-lowMeter colour for low values
--dress-midMeter colour for mid-range values
--dress-hiMeter colour for high values
--dress-shSoft drop shadow colour

Layout & Spacing

Metrics

VariableDescription
--dress-brDefault border radius
--dress-bsDefault border thickness
--dress-lhBase line-height multiplier
--dress-mwMaximum main width for <body>
--dress-mw-fFluid main width for <body> (max-content)
--dress-mw-minMinimum main width for <body>
--dress-s-iBase inline spacing unit
--dress-logo-hHeader logo height

✅ All derived spacing tokens respond automatically when you change --dress-mw or the other primary metrics, so you rarely need to override them individually.

Spacing Helpers

VariableDescription
--dress-gapDefault gap between stacked elements
--dress-m-bBase block margin
--dress-m-beBlock margin end override
--dress-m-bsBlock margin start override
--dress-m-iDefault inline margin
--dress-mpConsistent spacing inside interactive controls
--dress-p-bBlock padding derived from --dress-s-b
--dress-p-iInline padding derived from --dress-s-i
--dress-s-bBase block spacing unit (--dress-lh * 1rem)
--dress-soScroll offset applied to anchored headings

Typography & Motion

Typography

VariableDescription
--dress-ff-sansSans-serif font stack
--dress-ff-serifSerif font stack
--dress-ffDefault font family (points to sans stack)
--dress-ff-hHeading font family (points to sans stack)
--dress-ff-monoMonospace font stack
--dress-fs-minLower bound for clamp()
--dress-fs-maxUpper bound for clamp()
--dress-fs-varViewport-driven value for clamp()
--dress-fsResulting clamp value applied to <html>
--dress-csScale multiplier for inline/preformatted code
--dress-tstab-size used in <pre> and <code>

Motion

VariableDescription
--dress-adDefault animation/transition duration
--dress-ad-hHover/active duration (half of --dress-ad)
--dress-atAnimation timing function

Icons & Data URIs

VariableDescription
--dress-i-cbCheckbox glyph (data URI)
--dress-i-rbRadio glyph (data URI)
--dress-i-dlDownload icon (data URI)
--dress-i-xlnExternal-link icon (data URI)
--dress-i-sel-dSelect chevron for light inputs
--dress-i-sel-lSelect chevron for dark inputs

Vector assets use inline SVG data URIs so you can replace them with your own brand system.


Tips


Source

Browse the upstream variables file on GitHub: https://github.com/remino/dress.css/blob/main/src/styles/dress/variables.css