Skip to content

Set variables scopes for Figma in JSON files #4473

@Febakke

Description

@Febakke

Token Studio just released support for scoping and syntax when exporting tokens to Figma. It would be very helpful if we could support this as scoping is reset for all variables that are created today. Some times creating weird scoping in the community files.

token studio documentation
Also interesting with the "publish variables" node. I think we could set this for all variables that do not have a scope.

Suggested standard scoping

collection Name scope (yes/no) Type Usage
Colorscheme All colors No --- ---
Size Font-size Yes number "FONT_SIZE"
Size _size no --- ---
Typography Font-family no --- ---
Typography font-weight no --- ---
Theme Color no --- ---
Theme font-weight yes string "FONT_WEIGHT", "?FONT_STYLE?"
Theme font-family Yes string "FONT_FAMILY"
Theme Border-radius no --- ---
Semantic Color Yes color "ALL_FILLS"
Semantic link/color Yes color "ALL_FILLS"?
Semantic opacity Yes number "OPACITY"
Semantic border-width yes number "STROKE_FLOAT"
Semantic border-radius yes number "CORNER_RADIUS"
Semantic Size yes number "GAP", "WIDTH_HEIGHT" Padding??
Main color main/color yes color "ALL_FILLS"
Support color support/color yes color "ALL_FILLS"

more explicit color scoping

We could also offer explicit color scoping. This would mean that our text colors only can be used for text elements in Figma for instance. Im not sure if everyone would like that change? But worth discussing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    $ tokensEverything related to tokens and Work related to @digdir/designsystemet-themecli@digdir/designsystemet🎨 figmaEverything related to changes in Figma

    Type

    No type

    Projects

    Status

    📄 Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions