Skip to content

Change mode output format #320

@lukasoppermann

Description

@lukasoppermann

Hey @0m4r,

I found a way of making multiple values work with style dictionary.

I am proposing a new format to include all modes into a token:

"accent": {
          "description": "",
          "type": "color",
          "value": "{base.color.blue.5}",
          "extensions": {
            "org.lukasoppermann.modes": { // adding this
               "dark": "{base.color.blue.7}",
            },
            "org.lukasoppermann.figmaDesignTokens": {
              "mode": "light",
              "collection": "mode",
              "scopes": [
                "SHAPE_FILL",
                "TEXT_FILL"
              ],
              "variableId": "VariableID:27057:2696",
              "exportKey": "variables"
            }
          }
        },

Basically we remove all the mode stuff from the structure, etc. and just add it to the extension as a simple key (mode name) and value (mode value) pair.

            "org.lukasoppermann.modes": { // adding this
               "dark": "{base.color.blue.7}",
            },

What do you think? Would you like to add this? I will implement the style dictionary part that is needed to make it work with SD in https://github.com/lukasoppermann/style-dictionary-utils

Metadata

Metadata

Assignees

Labels

FeatureNew feature or requestImprovementEnhancement or code cleanup

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions