Color token naming convention #7827
Replies: 8 comments 32 replies
-
A. [style modifier*]-[element]-[role]-[state]
Examples:
|
Beta Was this translation helpful? Give feedback.
-
B. [property]-[role]-[style modifier]-[state]
Examples:
|
Beta Was this translation helpful? Give feedback.
-
Question: disabled tokensShould we break apart the abstract disabled tokens into more specific names? This would result in more disabled tokens going from 3 to about ~8. Or should we just keep it simple with abstract tokens. |
Beta Was this translation helpful? Give feedback.
-
Question: field tokenShould we combine the traditional Combining would result in less tokens but we would lose the ability to change field color separate from other ui containers. This is mostly a future concern or a "white label theme" concern. Note: we no longer need two field tokens with inline theming. |
Beta Was this translation helpful? Give feedback.
-
Question: color prefixShould we prefix the tokens with If I remember correctly, @joshblack said we could make this essentially part of the file structure. |
Beta Was this translation helpful? Give feedback.
-
Question: new ui-01 nameWhat should we call the new ui-01 token? In proposal A we call it |
Beta Was this translation helpful? Give feedback.
-
Alpha release final names
|
Beta Was this translation helpful? Give feedback.
-
Token names I'm still unsure about:
|
Beta Was this translation helpful? Give feedback.
-
Goal
As part of our next major release we want to update the names of the color tokens to users better understand how to apply color without needing to frequently reference a guide. We want the names to clearly articulate the purpose of the color and where/how to apply it.
Note: These token names and lists are based on the assumption that we will be implementing the inline theming proposal.
Existing convention
Currently, our existing token names are too abstract and only use numbers to distinguish between roles. For example, with
text-01
the user knows its a text color but what kind of text?There is also no real convention to the names and names have become inconsistent.
Two proposed naming conventions
Conventions
Terms:
*
the style modifier is not a required in every token. It is only present in a few token categories. It is used to help group tokens that are used as a set (inverse) or interchangeably (support).Overall we are (mostly) removing the terminating number labeling
-01
-02
etcRequest for feedback:
color-
prefix? Color token naming convention #7827 (comment)Conclusion
#7827 (comment)
Beta Was this translation helpful? Give feedback.
All reactions