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

In the Styles Actions, add a new "Sync styles" option which renames Styles according to their connected tokens (via Themes), deletes any styles that are not referenced, and creates new styles that do not exist yet #1196

Closed
Tracked by #1160 ...
six7 opened this issue Aug 19, 2022 · 1 comment · Fixed by #1320
Assignees
Labels
Figma non-local styles variables Publishing comp lib, styles and variables to consume

Comments

@six7
Copy link
Collaborator

six7 commented Aug 19, 2022

As users might rename, create or delete new tokens outside of the Plugin or outside of the library file we are in right now, we need to provide a way so users can 1-click Sync styles according to the new JSON.

To do that, let's add a Sync styles option to the Styles dropdown.

Depending on if the user has an active theme:

Active theme

  • Remove any styles that do not have a style associated (e.g. the user deleted a token on GitHub but now the token needs to be removed as well)
  • Update all values of styles
  • Rename styles that are associated with a token and where the token name is different than the style name

Not-active theme

  • Remove any styles that do not have a token that matches its name
  • Update all values of styles

We should probably add a Modal that appears and asks if they want to (checkboxes):

  • Remove styles without connection
  • Rename styles

One caveat: We should respect the user's setting on Ignore first part of token name for style and Prefix style with active theme name.

@six7
Copy link
Collaborator Author

six7 commented Oct 24, 2022

This was shipped as part of V123 🎉

@six7 six7 closed this as completed Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment