figma-plugin
figma-plugin copied to clipboard
Nesting in Composition tokens
Currently composition tokens can be applied to a single layer. It would be great if a composition token could define tokens for nested layers and apply tokens to child/sibling layers as well.
For example: A composition token button
with the following nesting:
Button container
- border radius
- fill
- padding Button label
- typography
- fill Button icon
- size
- fill
What's the primary use case to solve here? I feel this might be overly complex to achieve.
One thing I could see working is to have something like for CSS, where defining a color
attribute will define any text-color
property down the line? But do be able to define specific layers sound complex?
Well actually it sounds complex but from a css point of view it would make sense. You would have a container with a specific color and padding. And nested layers/auto-lay outs within that container would all have the same font. In the current scenario i would all have to select the different text layers and assign a typo token. While with nested tokens i should only have to assign that once. Inheritance could be great but keep in mind that maybe you have overlapping tokens.
https://www.w3schools.com/cssref/css_inherit.asp
@esthercheran can you shape this more? i'm not sure this is ready yet.
Added to Featurebase Request- 🪙 ➕ Support multiple tokens per layer of the same type