MDN self-hosted library · e01.org

`:root` CSS pseudo-class

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
/* Selects the root element of the document:
   <html> in the case of HTML */
:root {
  background: yellow;
}
css
:root {
  /* ... */
}
css
:root {
  --main-color: hotpink;
  --pane-padding: 5px 42px;
}