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

Ability to 'Hide from publishing' and Variable scoping for tokens #2300

Closed
Tracked by #2233
esthercheran opened this issue Oct 4, 2023 · 2 comments
Closed
Tracked by #2233
Labels
Figma variables icebox Will be picked up later 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow 💡request Community feedback variables-m2

Comments

@esthercheran
Copy link
Collaborator

esthercheran commented Oct 4, 2023

Issue:
When creating or editing a token in the plugin, it is not possible to granularly scope the purpose of the tokens for Figma Variables. Users are also not able to specify which variables should be hidden from publishing.

Definition of done
In the creation modal add a multi-select input where users can select available scopes for the following token types:

  • color,
  • number
  • dimension

A color token will have the following scopes available:

  • ALL_SCOPES
  • ALL_FILLS
  • FRAME_FILL
  • SHAPE_FILL
  • TEXT_FILL
  • STROKE_COLOR

A number or dimension token will have the following scopes:

  • ALL_SCOPES
  • TEXT_CONTENT
  • WIDTH_HEIGHT
  • GAP

Automatically scope tokens that are of type borderRadius to the corner radius scope silently. Only if a user changes this scope would we set it to something differently (if a variableScope property is present)

Based on the selected scopes when the token is created as a variable, the created variable will have the selected scopes checked.
The selected scopes will live in the metadata of the token.
This will be a pro feature.

For all tokens that can be created as variables:

  • color,
  • number,
  • dimension,
  • sizing
  • border radius
  • border width
  • spacing
  • text
    add a checkbox that toggles the visibility of variables being published. On creating variable from the token this setting will be set on the variable

Design

Image

Walkthrough

CleanShot.2023-10-04.at.18.04.41.2-converted.mp4

{
  extensions:
    studio.tokens: {
      variableScopes: [...]
      }
    }
  }

Original Issues:
#2193
#2194

@mikejyoung
Copy link

mikejyoung commented Feb 8, 2024

It would really beneficial to us if you could also include code syntax in these settings.

We are building a code-gen plugin to to generate the base styles for a component in the format needed by our design system, such as:

const baseStyles = {
	
	backgroundColor: $neutral30,
	color: $neutral100,
    "_dark" : {
    	backgroundColor: $neutral40
    }
	"_primary" : {
		backgroundColor: $primary30,
		color: $primary100,
    	"_dark" : {
    		backgroundColor: $primary40
    	}
	}
}

Figma's code syntax does a nice job of converting the variables to our preferred format in the output, but it's a pain to have to need to go into the variables editor to set the code syntax. It would save a lot time if we could set it while creating tokens in Tokens Studio.

I prepared some designs for a proposed implementation that aligns with the other variable properties scoped in this issue:

#2346 Define code syntax for a token

Related issue: #2346

@SamIam4Hyma SamIam4Hyma added Figma variables icebox Will be picked up later 💡request Community feedback 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow labels Mar 26, 2024
@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
@github-project-automation github-project-automation bot moved this from 📤 Ready for dev to ✅ Done in Tokens Studio for Figma Roadmap Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Figma variables icebox Will be picked up later 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow 💡request Community feedback variables-m2
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants