:root

The CSS selector that matches the document's top element, the html element, where global custom properties are usually declared.

In more detail

Declaring tokens on :root makes them available to every element on the page through inheritance. Themes then override some of them on a lower element, such as one carrying data-theme="dark".

Related terms

Taught in

References