A Sass variable is a build-time convenience - by the time CSS reaches the browser, every $variable has been replaced with its literal value and the variable itself no longer exists. A native CSS custom property is different: it lives in the browser, can be read and updated with JavaScript, and can even be scoped to a specific part of the page.

:root { --brand: #1c6e63; }
.card { color: var(--brand); }

Live theming, without a rebuild

document.documentElement.style.setProperty('--brand', '#a56c1f');

That single line re-themes every element referencing --brand, instantly, with no compile step - something a Sass variable simply cannot do, because it never survives into the browser in the first place.

They coexist with Sass just fine

We're not dropping Sass - its nesting and functions are still useful at build time - but custom properties now handle anything that needs to change at runtime: theming, user preferences, animation targets.

Not the same thing as Sass variables

Sass variables are compiled away at build time - by the time the browser sees the CSS, they're just static values. Custom properties are live in the DOM and can be read and changed with JavaScript, inherited down the cascade, and overridden per-component or per-media-query, none of which a preprocessor variable can do.

:root { --gap: 16px; }
@media (min-width: 900px) { :root { --gap: 32px; } }
.grid { display: grid; gap: var(--gap); }

Theming without a build step

Because they're inherited and overridable at runtime, custom properties are what makes a dark-mode toggle or a user-selectable accent color possible without recompiling any CSS - flip a few values on :root or a data attribute, and everything referencing those variables updates instantly:

[data-theme="dark"] { --bg: #12192b; --text: #f2ede3; }
body { background: var(--bg); color: var(--text); }