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

2.0: let users choose if variables+styles should be applied #2781

Merged
merged 6 commits into from
May 28, 2024

Conversation

six7
Copy link
Collaborator

@six7 six7 commented May 20, 2024

Why does this PR exist?

Closes #2618

What does this pull request do?

Gives users a choice if they want to apply styles+variables or raw values. If raw values is chosen, we will always apply raw values when applying to nodes. This effectively allows users to theme-switch even though they've created variables and styles. Before as we would always apply styles - we would not be able to react to theme changes unless the user had set up different variable modes.

CleanShot 2024-05-26 at 11 40 20@2x

Testing this change

Play around with enabling/disabling those settings and try applying various tokens to layers that have styles / variables attached.

Copy link

changeset-bot bot commented May 20, 2024

🦋 Changeset detected

Latest commit: 018b24c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@six7 six7 marked this pull request as ready for review May 21, 2024 09:25
@six7 six7 marked this pull request as draft May 21, 2024 09:25
@six7 six7 marked this pull request as ready for review May 21, 2024 09:25
@six7 six7 marked this pull request as draft May 21, 2024 09:25
@@ -69,6 +78,8 @@ export default function ApplySelector() {

<DropdownMenu.Portal>
<DropdownMenu.Content side="top">
{/* TODO: Use DropdownMenu.Label - first add that to `ds` */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,11 +1,12 @@
import { clone } from '@figma-plugin/helpers';

export async function unbindVariableFromTarget(target: BaseNode | PaintStyle, key: 'paints' | 'fills' | 'strokes', newPaint: Paint) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this now, it's possible for users to completely detach a system from styles and variables - super awesome!

Copy link
Contributor

@LukeFinch LukeFinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only quickly tried this with a manual test - would be good to get a thorough manual QA check.

Code is great - nice work!

@six7 six7 merged commit 4989732 into release-139 May 28, 2024
5 of 6 checks passed
@six7 six7 deleted the six7/choose-variable-style-apply branch May 28, 2024 16:32
@six7 six7 added the 2.0-rc7 label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants