Skip to content

CSS Variable Generator

Centralise your design values in reusable variables and copy the entire block into your stylesheet.

It works in your browser. We do not store or send anything you type.Free · No sign-up required

Workspace · CSS Variable Generator

Runs in your browser · 100% local
--color-primary: #17191c
--color-surface: #ffffff
--radius-card: 16px
--space-section: 80px

CSS generado

:root {
  --color-primary: #17191c;
  --color-surface: #ffffff;
  --radius-card: 16px;
  --space-section: 80px;
}
Files are processed in your browser; if you are signed in with history enabled, text results appear in your history.
Instructions

How to use it

01

Edit the selector and the name-value pairs.

02

Add new variables or remove any you don’t use; the preview shows the colours.

03

Copy the generated CSS block into your stylesheet.

Examples

Examples

Clear topic

Define ‘colour-primary’, ‘colour-surface’ and ‘colour-text’ in :root.

Radius scale

Variables for small, medium and card-sized radios.

Spacing

Reusable values for sections, cards and forms.

Reference guide

What you need to know

CSS variables allow you to change a value in one place and apply it throughout the project. The generator checks that names begin with -- and do not contain spaces.

The colour preview is for guidance only: if the value is not a valid CSS colour, the browser will display the default background. The generated block can be pasted into any stylesheet.

Frequently asked questions

Frequently Asked Questions

Yes. Change the selector from :root to the scope you need, for example .dark-theme.

Related tools

Other tools that can help with similar tasks.

More at Web development→
Custom CSS Variable Generator · ByTooly