Color · Made a little simpler
Palette to CSS Variables
Turn a list of HEX, RGB, HSL or named colors into numbered CSS custom properties. Preview the swatches, choose a prefix and download a local stylesheet.
Using custom properties from a color list
Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device
#336699#993366#669933Palette to CSS Variables: how to use it
- Paste one color per line, keeping the order you want for the variables.
- Choose a prefix starting with a letter and inspect the generated :root declarations.
- Copy the CSS or download the stylesheet, then reference a variable using var().
Limits and notes
Accepts up to 64 sRGB colors. Blank lines are ignored. The prefix supports 1 to 40 ASCII letters, digits and hyphens, starting with a letter. CSS functions that depend on document context are unsupported.
How your privacy works →Palette to CSS Variables: common questions
What happens to duplicate colors?
The exporter keeps each entry in its original position. Two matching colors can have different numbered variables.
Does it preserve decimal opacity?
Yes. Translucent values are written as RGBA, which keeps the parsed opacity. HEX swatch labels round alpha to a byte.