-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles: Restore the default variation to the color and typography style tiles #61901
Conversation
// Remove variations that are empty once the property is filtered out. | ||
if ( Object.keys( variationFilteredByProperty ).length === 0 ) { | ||
if ( | ||
variation.title !== 'Default' && |
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.
If I'm not wrong, this is a translated string so it might break. We could test __( 'Default' )
instead but I wonder if there's a better way to identify this (a flag or something)
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.
Good catch. We do this elsewhere too:
title === __( 'Default' ) || // Always preseve the default variation. |
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.
Done in 2cfcf6b
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: +87 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
Flaky tests detected in 2cfcf6b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9211097299
|
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.
LGTM 👍
Would be good to consider moving away from checking labels though. Someone can register a variable called "Default".
…phy style tiles (WordPress#61901) * Global Styles: Restore the default variation to the color and typography style tiles * find the default variation with i18n Co-authored-by: scruffian <[email protected]> Co-authored-by: youknowriad <[email protected]>
…phy style tiles (WordPress#61901) * Global Styles: Restore the default variation to the color and typography style tiles * find the default variation with i18n Co-authored-by: scruffian <[email protected]> Co-authored-by: youknowriad <[email protected]>
What?
This restores the default variation to the style tiles for color and typography sets.
Why?
This is necessary to allow users to put their color and typography settings back to how they were before they made changes.
How?
Don't filter out Default as an empty variation - treat it as an exception.
Testing Instructions
Screenshots or screencast