:root

A CSS pseudo-class that matches the top element of the document, the html element, where global custom properties are usually set.

In more detail

It has higher specificity than the html type selector, although it matches the same element. Values set on :root are inherited by every element, so it is the natural home for theme tokens.

Related terms

Taught in

References