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

[FEATURE REQUEST] Support filtering out token-sets (such as those "treated as source") #32

Open
kvenn opened this issue Jun 12, 2024 · 4 comments

Comments

@kvenn
Copy link

kvenn commented Jun 12, 2024

💬 Description

If I mark a token-set as "source", it doesn't allow me to access those variables in Figma. Ideally it would work the same in the code.

If this is controversial, it would be great if there was a setting passed to the generator (or a config file) that allowed you to ignore certain token-sets. Or ignore source token-sets.

❓ Link to specification or documentation (if available)

Tokens studio docs

Details

themes/semantic-light references colors in core, but they shouldn't be accessible in the code (to prevent people from using colors directly instead of through the semantic theme token set).

In $themes.json there is this:

    "selectedTokenSets": {
      "global": "enabled",
      "core": "source",
      "theme/semantic-light": "enabled"
    },

image

@kvenn kvenn changed the title [FEATURE REQUEST] Don't import token sets defined as "treat as source" [FEATURE REQUEST] Don't import token-sets defined as "treat as source" Jun 12, 2024
@kvenn
Copy link
Author

kvenn commented Jun 12, 2024

Style Dictionary has some generic approaches to how they handle it. Flutter impl.

https://v4.styledictionary.com/examples/splitting-output-files/
Looks like using "filters" is how they recommend doing it.
https://v4.styledictionary.com/reference/hooks/formats/#filtering-tokens

@kvenn kvenn changed the title [FEATURE REQUEST] Don't import token-sets defined as "treat as source" [FEATURE REQUEST] Support filtering out token-sets (such as those "treated as source") Jun 12, 2024
@freemansoft
Copy link
Collaborator

The linked docs require a Figma login.

@kvenn
Copy link
Author

kvenn commented Jun 17, 2024

Updated!

@apackin
Copy link
Contributor

apackin commented Jun 17, 2024

I opened a PR specific to omitting "core" tokens #34. It could easily be modified to accept a list of paths for token sets to omit if that need arrises.

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

3 participants