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

Add support for referencing non-local variables #2023

Closed
Tracked by #2106 ...
vnys opened this issue Jul 5, 2023 · 10 comments · Fixed by #2568
Closed
Tracked by #2106 ...

Add support for referencing non-local variables #2023

vnys opened this issue Jul 5, 2023 · 10 comments · Fixed by #2568
Assignees
Labels
enhancement Internal new feature or functionality Figma non-local styles variables Publishing comp lib, styles and variables to consume Figma variables 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow plugin v2 variables, UI, WTCG format, Bitbucket variables-m2

Comments

@vnys
Copy link

vnys commented Jul 5, 2023

Users need to be able to publish their variable collections into different files. The plugin currently does not allow that. Currently, when users hit Create variables, we create all possible variable collections, making it impossible to spread them out to different files. With the work in #2211 we'll have a Dialog that asks users what collections and tokens to create from, meaning we should now be able to have variables that can be references to other files variables.

Definition of done:

  • When a token references another token from another collection, do not just check the local file, but instead if the token is part of another collection, use the reference from that. We do have the collection and mode id stored in $figmaVariableReferences, so we should be able to detect those remote references too.

Original issue description:

In order to allow design system designers to share core tokens across multiple files, I need to publish core tokens as variables in a separate Figma library.

I’d like there to be an option when exporting tokens from Tokens Studio where I can choose which themes to export, so that only the core tokens are imported in the core file – instead of having to delete unwanted collections afterwards.

I’d also like to be able to export only the semantic tokens without breaking the connection to the core tokens if there are non-local core tokens available in the file.

@yapjonathan
Copy link

+1

It would be great if we're able to approach it similarly to non-local styles. Right now, creating variables will create all of them even if I have a theme set that is marked as source.

@SimonLeclercq
Copy link

+1 absolutely need it!

@danvpeterson
Copy link

danvpeterson commented Jul 12, 2023

To keep managing our tokens in TS this is possibly a requirement for us. I'm looking at what changes we need to make now to support variables, and keeping our base tokens in a separate library from our semantic tokens feels like a necessity at first glance. Digging in to see if I can figure out a workaround, but would love to see this added!

@six7
Copy link
Collaborator

six7 commented Jul 22, 2023

To keep managing our tokens in TS this is possibly a requirement for us. I'm looking at what changes we need to make now to support variables, and keeping our base tokens in a separate library from our semantic tokens feels like a necessity at first glance. Digging in to see if I can figure out a workaround, but would love to see this added!

you could just have everything in 1 library, but mark the Collection that is not supposed to be exposed as "hide from publishing". We do support having multiple Collections.

@chongchizhang
Copy link

Currently, the plugin does allow creating Variables in different files. However, when we need to update (ex: change a name of a token for all Variables across different files), it will not sync the change for the file that doesn't have matching Variables IDs. I have recorded a video here to demonstrate what I mean.

@danvpeterson
Copy link

you could just have everything in 1 library, but mark the Collection that is not supposed to be exposed as "hide from publishing"

Unfortunately we need to be able to use them within the design system team in other files so we can't just hide from publishing. We reference base tokens in some component specific tokens (not many, but it's a need we've found). And we don't want a mono-library where all variables and all components are in the same file to make this work.

@six7 six7 added the design Design is needed label Sep 4, 2023
@six7 six7 removed the design Design is needed label Oct 4, 2023
@robinhoodie0823 robinhoodie0823 self-assigned this Nov 16, 2023
@SamIam4Hyma SamIam4Hyma added Figma non-local styles variables Publishing comp lib, styles and variables to consume Figma variables enhancement Internal new feature or functionality 💡request Community feedback 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow plugin v2 variables, UI, WTCG format, Bitbucket and removed 💡request Community feedback labels Mar 21, 2024
@six7 six7 self-assigned this Apr 5, 2024
@six7 six7 linked a pull request Apr 11, 2024 that will close this issue
@LukeFinch
Copy link
Contributor

This request has been moved to our new feedback tool. Go check out https://tokensstudio.featurebase.app/ to create a free account. You can upvote and comment on existing posts, make a new request, and subscribe to be notified when requests move into our roadmap.

@LukeFinch LukeFinch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
@UdayHyma
Copy link
Collaborator

Added to Featurebase Roadmap : ❖ ❇️ Non-local support of variables and styles

@six7 six7 reopened this May 8, 2024
@six7
Copy link
Collaborator

six7 commented May 8, 2024

Reopening as we're actively working on this, hoping to get it into 2.0 still.

@six7
Copy link
Collaborator

six7 commented May 26, 2024

Closing this, will be part of 2.0 and the next release candidate.

@six7 six7 closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Internal new feature or functionality Figma non-local styles variables Publishing comp lib, styles and variables to consume Figma variables 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow plugin v2 variables, UI, WTCG format, Bitbucket variables-m2
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

10 participants