On platforms like the web where names of tokens can affect download size, shorter token names are ideal. There are a few opportunities for shortening things.
Remove Set from exported token names—the Set heading is an organizational tool, but doesn't need to be present in the exported token name.
Remove Root from exported token names—the Root node under control tokens specifies properties for the control's top-level background element. For example, MyControl.Root.Stroke.Color might be used like this in a React component:
The CSS variable name would still be unambiguous if it were named --mycontrol-stroke-color, since other stroke colors within the same control would have an extra word in them.
On platforms like the web where names of tokens can affect download size, shorter token names are ideal. There are a few opportunities for shortening things.
Remove
Set
from exported token names—theSet
heading is an organizational tool, but doesn't need to be present in the exported token name.Remove
Root
from exported token names—theRoot
node under control tokens specifies properties for the control's top-level background element. For example,MyControl.Root.Stroke.Color
might be used like this in a React component:The CSS variable name would still be unambiguous if it were named
--mycontrol-stroke-color
, since other stroke colors within the same control would have an extra word in them.