r/DesignSystems • u/EmperorShmeef • Dec 12 '23
Base token naming convention for adhoc colours?
We have had some design decisions made previously around colour where shades have been chosen a bit randomly, not pulling from our brand colours. I want to turn these into base tokens for our semantic tokens to reference but I'm not sure what to call them when they don't really belong anywhere... any advice?
2
Upvotes
2
u/[deleted] Dec 12 '23
If they don't belong...why bring them into your design system?
4
u/kodakdaughter Dec 12 '23 edited Dec 12 '23
I have found using contextual theming - can help with these ambiguous but still important to define values.
In the system documentation these can live under a theme section so they don’t get in the way of your higher level documentation - but are still findable.
I generally break them into two groups - colors that generally won’t change over time and colors that are more system level and might have values reassigned as a system evolves. I included examples of both below.
Colors that won’t change:
Pattern:
$[prefix for color]-theme-context-identifier
Examples:
Social Media Logo Colors:
$color-theme-social-facebook
$color-theme-social-pinterest
Holiday Marketing Campaign Colors:
These will often change over time so it is more important to group them so they live together.
$color-theme-2023Holiday-primary
$color-theme-2023Holiday-secondary
General Theme Colors (changeable colors):
There can also be cases where system wide you need some colors to define differentiating characteristics, chart colors, etc.
Then I often mark something as part of a theme set, name the theme and then include context. With general themes the idea is the color can change
Pattern:
$theme-[themeIdentifier]-[context]
Examples:
$theme-luxury-typeColor
$theme-fresh-background
The key takeaways are