What is CSS variables?
Also called: Custom properties, Design tokens
The short answer
CSS variables store reusable values, such as colours, spacing or fonts, in one place so a whole site can be themed or changed consistently.
CSS variables, explained
Defined as --name and used with var(--name), they update live, which makes dark mode and per-brand theming simple.
Questions people ask about CSS variables
What is CSS variables?
CSS variables store reusable values, such as colours, spacing or fonts, in one place so a whole site can be themed or changed consistently.
Related terms
A design system is a shared library of reusable components, tokens and rules that keeps every page of a product consistent and faster to build.
Dark modeDark mode is a colour theme with light text on a dark background, offered as an alternative to a light theme or matched to the visitor's system setting.
CSSCSS is the language that controls how a web page looks: colours, fonts, spacing, layout, animation and how the design adapts to each screen.
DOMThe DOM is the browser's live, tree-shaped model of a web page; JavaScript reads and changes the DOM to update what visitors see.
Part of the Web Encyclopedia by Apex Flow Digital. Definitions are general knowledge, kept current, with no invented statistics.