figma-plugin
figma-plugin copied to clipboard
Allow to set if Variables, Styles or Hex values are applied on applying tokens
When I have tokens linked with variables and styles, I want to set what should be applied on Figma when tokens are applied through the plugin.
Introduce a setting in the settings tab that will allow a default to be set, with each option explained.
- Variables
- Styles
- Raw values
This behaviour should happen for all token types depending on whether they are applicable in variables and styles.
The logic of applying the values would be as follows: Prefer Variables:
- If variables are present and styles are present, apply variables
- If variables are not present and styles are present, apply styles
- If variables and styles not present, apply raw values Prefer Styles:
- If styles are present and variables are present, apply styles
- If styles are not present and variables are present, apply variables
- If styles and variables are not present, apply raw value Use raw values:
- Always apply raw values irrespective of styles or variables being present or not
This sounds great!
If they change their mind later, how can they switch to an alternate representation? Ex: Variables today, styles tomorrow
If the representation doesn't exist any more, like if variables are deleted, then what?
Are the settings on the file side, or the plug-in side? If I want to have multiple files using the same tokens can I have 1 file showing styles and another showing variables? This gets into the multiple file sync needs convo.
Will there also be consideration for the Figma feature of referencing a variable in a style for this one?
I'm going under the assumption that 'Hex' should actually be Raw value? For example if I don't want a border-radius variable to be applied, and just want the number.
Can you confirm @esthercheran ?
@LukeFinch yes the raw value
@SamIam4Hyma would it better to have this setting specific to a document?
UX Research shows that this feature is desired, but the wording in the design mockups was confusing and most users were unsure that the settings is the best place for this menu option.
If we have an "apply to" settings, could it also be accessed there?
Added to FeatureBase Roadmap : ❖⚙️ Choose to express a token as a style, variable or raw design property
Will be part of 2.0 RC7