figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Allow to set if Variables, Styles or Hex values are applied on applying tokens

Open esthercheran opened this issue 1 year ago • 7 comments

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.

Image

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

esthercheran avatar Aug 31 '23 09:08 esthercheran

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.

SamIam4Hyma avatar Sep 13 '23 20:09 SamIam4Hyma

Will there also be consideration for the Figma feature of referencing a variable in a style for this one?

image

SamIam4Hyma avatar Sep 14 '23 15:09 SamIam4Hyma

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 avatar Oct 11 '23 08:10 LukeFinch

@LukeFinch yes the raw value

esthercheran avatar Oct 17 '23 06:10 esthercheran

@SamIam4Hyma would it better to have this setting specific to a document?

esthercheran avatar Oct 20 '23 11:10 esthercheran

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?

SamIam4Hyma avatar Oct 30 '23 17:10 SamIam4Hyma

Will be part of 2.0 RC7

six7 avatar May 28 '24 16:05 six7