figma-plugin
figma-plugin copied to clipboard
Tokens that share name with a group are not visible in the UI
When using a naming convention that's shared (i.e. in both typography and composition tokens within the same token set, the nested composition tokens are not visible within the plugin UI even though they are available as unique tokens in the JSON. For example, after adding the {bjc.type.p.lg.bold.defaultColor} token to the Composition token section within the UI, the Typography token {bjc.type.p.lg.bold} remains visible but the Composition token does not.
{
"bjc": {
"type": {
"p": {
"lg": {
"bold": {
"value": {
"fontFamily": "{bjc.fontFamilies.open-sans}",
"fontWeight": "{bjc.fontWeights.700}",
"lineHeight": "{bjc.lineHeights.2}",
"fontSize": "{bjc.fontSize.lg}",
"letterSpacing": "{bjc.letterSpacing.4}",
"paragraphSpacing": "{bjc.paragraphSpacing.lg}",
"textCase": "{bjc.textCase.none}",
"textDecoration": "{bjc.textDecoration.none}"
},
"type": "typography",
"description": "18px / 1.125rem",
"defaultColor": {
"value": {
"typography": "{bjc.type.p.lg.bold}",
"fill": "{bjc.colors.type.body.default}"
},
"type": "composition"
}
}
}
}
}
}
}
Only when I move the typography token to a different token set does this not occur. For example...
Token set A
{
"bjc": {
"type": {
"p": {
"lg": {
"bold": {
"value": {
"fontFamily": "{bjc.fontFamilies.open-sans}",
"fontWeight": "{bjc.fontWeights.700}",
"lineHeight": "{bjc.lineHeights.2}",
"fontSize": "{bjc.fontSize.lg}",
"letterSpacing": "{bjc.letterSpacing.4}",
"paragraphSpacing": "{bjc.paragraphSpacing.lg}",
"textCase": "{bjc.textCase.none}",
"textDecoration": "{bjc.textDecoration.none}"
},
"type": "typography",
"description": "18px / 1.125rem"
}
}
}
}
}
}
}
Token set B
{
"bjc": {
"type": {
"p": {
"lg": {
"bold": {
"defaultColor": {
"value": {
"typography": "{bjc.type.p.lg.bold}",
"fill": "{bjc.colors.type.body.default}"
},
"type": "composition"
}
}
}
}
}
}
}
Is this a bug? It would be ideal if the UI would not hide these tokens.
This is currently intended as a token name should not share a name with a group.
This was based on a prior draft of the W3C which specified that this should be the case.
In the newest draft this is however not found anymore, so in the future we'll support this as well (once we've moved on to support the new version of the draft)
Any estimated timing for supporting the new W3C draft?
We'll be supporting this in the next release, even before the new W3C draft.
This would be great. In figma, we can use the same name for a color style and a color style group.
However, it seems that the change is moved from 🤞 To be released
to 🗃️ Backlog
and not yet released. Is there anything to reconsider?
@six7 assuming this one can be closed but I'm not sure