CSS Variables Generator

Define your color design tokens and generate a clean :root block, plus the SCSS and Sass variable equivalents.

Settings

Preview

Code


            
            
            

User guide

CSS variables (custom properties) are declared in :root and reused with var(--name). They're dynamic: editable in JavaScript and overridable per theme.

  • Ideal for theming and dark mode.
  • Unlike Sass variables, they exist at runtime.

FAQ

CSS or Sass variables?

Sass variables are compiled (static); CSS variables live in the browser and can change on the fly — perfect for theming.

How do I change a variable in JS?

Use element.style.setProperty('--primary', '#000') or document.documentElement.style.setProperty(...).