-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Theme: Restructure theme tokens to embed prefix, flattened modifiers #73859
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +370 B (+0.01%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
|
Importing the tokens is working for me. Is it expected that;
|
It's not my preference, but it is expected, yes. We can't really "hide" values when using the raw DTCG JSON like this.
This was somewhat surprising, but it does at least scope for valid fields for the type (i.e. can't use dimension values for colors). But yeah, this does regress slightly that it no longer scopes stroke colors to stroke fields, for example. Through some reverse-engineering, I know that Figma can support us controlling this, through additional extension values. Specifically, they have a
This is rather surprising, actually. Since we use the standard |
ab6c2c3 to
eb3aa94
Compare
mirka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it to the design folks on whether or not the (temporary?) feature regressions are acceptable, but code-wise this looks ok to me.
|
I'll be happy to address feedback asynchronously, but since this is a pretty large restructuring prone to merge conflicts (already had to reconcile #73793), I'm hesitant to leave this open longer than it needs to be and will plan to merge this as-is. To put some potential concerns at ease:
|
Follow-up at #73897 |
What?
Restructures design token JSON files to improve consistency of token structure and align to expected conventions:
Example:
color.semantic.bg-surface.neutral.resting➡️wpds-color.bg.surface.neutralcolor.semantic.fg.interactive.neutral.strong.active➡️wpds-color.fg.interactive.neutral-strong-activeBuilds on #73858
This is aimed at serving as an alternative to #73407, reflecting assumptions about how we want to represent tokens within the source tokens themselves.
Why?
How?
surface.neutral.resting, eliminating default states in the process (resting)Testing Instructions
Observe that there is no impact to
packages/theme/src/prebuilt/css/design-tokens.css(aside from code comment correction), even after runningnpm run --workspace @wordpress/theme build.Since this builds on #73858, optionally test how the resulting
color.jsonis imported into Figma if you have means to do so, where the resulting variables look like e.g.wpds-color/bg/interactive/neutral-strong-active.