CSS custom property

A property you define yourself with a double-hyphen name, such as --brand: #0066cc, and read elsewhere with var(--brand).

In more detail

Unlike preprocessor variables, custom properties live in the browser at runtime: they cascade and inherit like other properties, so a value set on :root can be overridden for one card or a dark theme. Changing one in JavaScript restyles every element that uses it.

Related terms

Taught in

References