A palette usually arrives as a list someone copied out of a design file: blue, blue2, dark blue, brand-blue-final. Paste that list into a variable builder and you get exactly what you asked for: a tidy block of variables with those same names, just as meaningless as the day they were typed.

The builder enforces the form of your names; it cannot supply the meaning. That part is a naming system, decided before you paste. This guide builds one around the free CSS Variable Palette Builder on Ovatly, which turns a pasted list of colors into a :root block of CSS custom properties, plus a Tailwind snippet referencing the same names.

Contents

  • Quick answer
  • What the builder does to your names
  • Rule one: write names in the form the builder produces
  • Rule two: role first, then shade
  • Rule three: name every line
  • Rule four: one name, one role
  • How to build the list, step by step
  • Worked example: cleaning up a copied list
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Name every line in your list, put the role first and the shade second, and write the names in lowercase kebab-case yourself. The CSS Variable Palette Builder adds one shared prefix (default color) to every variable, normalizes your names, and suffixes any duplicate instead of overwriting it. If the output contains a numbered name, your list had a collision: fix the list and run it again, rather than editing the generated CSS.

What the builder does to your names

Each line of input can be written as name: #HEX, name #HEX, --name: #HEX with an optional semicolon, or as a bare #HEX. Whatever form you use, the builder applies the same four mechanics:

  • Names are normalized to lowercase kebab-case.
  • One prefix, defaulting to color, is applied to all of them.
  • If two lines produce the same name, the duplicate is kept and given a numeric suffix, never overwritten.
  • A line without a valid hex value is reported with its line number and excluded from the output.

A naming system designed around these mechanics lets the builder do the formatting while you concentrate on what each name means.

Rule one: write names in the form the builder produces

Since every name is normalized to lowercase kebab-case anyway, write it that way in your list from the start. Two names that look different in a draft, such as Primary and primary, are the same name after normalization; a list written in final form shows you that collision while it is still cheap to fix.

Rule two: role first, then shade

The shared prefix already marks every variable as a color, so the name itself does not need to describe the hue or repeat the category. Spend it on the role: what the color is for. The builder's own example follows this pattern, pairing primary (the main action color) with paper (its background).

When a role needs a variant, grow the name from the role and put the shade second. Names that lead with the role sort together wherever variables are listed, and a reader who meets the variable in a stylesheet learns its job rather than its appearance. Appearances change in every redesign; roles mostly survive them.

Rule three: name every line

A bare hex value on its own line is accepted input, and for a quick throwaway test it is fine. In a palette you intend to maintain, it is the anti-pattern: the variable that comes out carries a default name rather than a role you chose, so the next person to read the stylesheet has to guess what that color is for. Naming a line costs seconds; guessing costs more, repeatedly.

Rule four: one name, one role

The numeric suffix is the warning light of this system. It appears when two lines claim the same name after normalization, which means the naming system leaked: either one role entered twice under spellings that collapse together, or two different colors were handed a single role name. Both are list problems, not output problems. The generated CSS is still valid, so nothing downstream will complain; the only defence is reading the output names before you paste them in.

How to build the list, step by step

  1. Draft the list with one line per color, every line named, role first and shade second, in lowercase kebab-case.
  2. Paste it into the CSS Variable Palette Builder.
  3. Read the report of excluded lines and fix any line that was dropped for lacking a valid hex value.
  4. Scan the output names for numeric suffixes; if any appear, resolve the collision in the list and re-run.
  5. Copy the :root block, plus the Tailwind snippet if your project uses Tailwind; both reference the same names.

Worked example: cleaning up a copied list

Here is a small list as it might arrive from a design file:

Primary: #2563EB
#FAFAF7
primary #2563EB

Three lines, two problems. The first and third both normalize to primary, so one would leave with a numeric suffix. The second has no name at all. Applying the rules: name every line, give each role exactly one line, and let a second role share the background value openly:

primary: #2563EB
paper: #FAFAF7
surface: #FAFAF7

The first two lines are the builder's own worked example, producing exactly this:

:root { --color-primary: #2563EB; --color-paper: #FAFAF7; }

The third line follows the same pattern to --color-surface. Note that paper and surface share a hex value without triggering a suffix, because the suffix is about names, not colors: two roles may hold the same value today and diverge in a later redesign.

Limitations and honest tradeoffs

The builder enforces form, not meaning. It will normalize a name like blue2 without objection, because judging names is your job, not the tool's. Normalization is also lossy about intent: names differing only in case or punctuation collapse into one, and the builder keeps both with a suffix rather than asking which you meant.

Nothing in the output validates your design decisions either. The builder cannot tell you that a role is misnamed, that two roles should be one, or that a value is the wrong color. A naming system reduces the mechanical failures to a checklist; the judgment calls remain yours.

Common mistakes

  • Naming by hue instead of role. A variable called blue has to be renamed the day the brand color changes; a variable called primary does not.
  • Leaving bare hex lines in a maintained palette. The variable gets a name nobody chose, and its purpose is lost.
  • Fixing a suffixed name in the generated CSS. The next export restores the suffix. Fix the input list instead.
  • Using two spellings for one role across lists. One palette quietly becomes two variable sets that drift apart.

FAQs

What happens if two lines in my list use the same name? The builder keeps both colors instead of overwriting the first. The duplicate name is given a numeric suffix so the two variables can coexist. Treat that suffix as a warning that your naming system let two lines claim one name, and fix the collision in the input list.

Do I have to write the names in lowercase myself? No. The builder normalizes every name to lowercase kebab-case for you. Writing them that way yourself is still worth it, because names that differ only in case, like Primary and primary, become the same name after normalization, and it is better to spot that collision in your list than in the finished CSS.

Can I paste a color without giving it a name? Yes. A bare hex value on its own line is accepted input. For a palette you plan to maintain it is a bad habit, because the variable that comes out cannot carry the role you would have given it. Name every line you intend to keep.

What does the prefix do, and should my names repeat it? Every generated variable starts with one shared prefix, which defaults to color, so the name primary becomes --color-primary. Because the prefix already marks the variable as a color, your names do not need to repeat the category. Spend the name on the role instead.

Does the builder ever change my colors? It normalizes the spelling, not the color. A 3-digit hex value is expanded to the 6-digit form, and the worked example values, #2563EB and #FAFAF7, come through exactly as pasted. What the builder will not do is check that a value is the color you actually meant.

Conclusion

A good naming system for color variables is mostly a short set of habits: name every line, role first and shade second, write the final form yourself, and treat any numeric suffix as a defect in the list. The CSS Variable Palette Builder then does the mechanical work of producing the :root block and the Tailwind snippet on those names. Once the names are right, the export itself is a single paste: our guide to exporting a palette as ready to paste CSS covers the three output formats and the reports to check first. For more guides in this series, see our Color and Design Tools guides.

References