Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cgatian opened this issue Oct 17, 2024 · 0 comments
Open

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

cgatian opened this issue Oct 17, 2024 · 0 comments

Comments

@cgatian
Copy link

cgatian commented Oct 17, 2024

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":[{},{}]}]
@cgatian cgatian changed the title plugin-token-json doesnt seem to work plugins for style/variable do not seem to work correctly Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant