CSS Custom Properties Playground

Mrs. Lastri’s dye jars are custom properties: declare --brand and --gap on :root or a card, the browser resolves var() on every element, and each table shows…

Why it matters

Custom properties are the foundation of every modern theme (including dark mode in this app). Unlike Sass variables, which vanish at compile time, they live at runtime: computed per element, overridable per component, switched by one theme class, and changed from JS with el.style.setProperty().

The key idea

var() reads the value on the element that uses it

Common mistakes

Try it in this playground