Skip to content

plugins for style/variable do not seem to work correctly #20

@cgatian

Description

@cgatian

Running into issues with the plugins code.js files included in this repo.

I create a new local development plugin and copied the code.jsand I received the following console error (perhaps plugins only work with ES6?)

image

I then copied the code.js to the TypeScript file to downlevel it, and aside from typescript warnings, it compiles. When I run the plugin it doesn't look like it is extracting the same tokens found in the scripts/tokens/styles.json. The style plugin has similar issues.

figma-plugin-token-json

image

{
  "@color_primitives": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:3919:36421",
        "modes": [
          "value"
        ]
      }
    }
  },
  "@color": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:3919:36422",
        "modes": [
          "sds_light",
          "sds_dark"
        ]
      }
    }
  },
  "@typography_primitives": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:9:11179",
        "modes": [
          "default"
        ]
      }
    }
  },
  "@responsive": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:9:11202",
        "modes": [
          "desktop",
          "mobile",
          "tablet"
        ]
      }
    }
  },
  "@size": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:9:11257",
        "modes": [
          "default"
        ]
      }
    }
  },
  "@typography": {
    "$extensions": {
      "org.sds": {
        "figmaId": "VariableCollectionId:58:8567",
        "modes": [
          "mode_1"
        ]
      }
    }
  }
}

figma-plugin-styles-json

image

[{"type":"EFFECT","name":"Drop Shadow/100","effects":[{}]},
{"type":"EFFECT","name":"Drop Shadow/200","effects":[{},{}]},
{"type":"EFFECT","name":"Drop Shadow/300","effects":[{},{}]},
{"type":"EFFECT","name":"Drop Shadow/400","effects":[{},{}]},
{"type":"EFFECT","name":"Drop Shadow/500","effects":[{},{}]},
{"type":"EFFECT","name":"Drop Shadow/600","effects":[{}]},
{"type":"EFFECT","name":"Blur/Overlay","effects":[{}]},
{"type":"EFFECT","name":"Blur/Layer","effects":[{}]},
{"type":"EFFECT","name":"Blur/Glass","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/100","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/200","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/300","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/400","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/500","effects":[{}]},
{"type":"EFFECT","name":"Inner Shadow/600","effects":[{}]},
{"type":"PAINT","name":"Image Placeholder","paints":[{},{}]}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions