Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Dec 4, 2025

Follow-up to #72599

What?

This PR will correctly display the default variation color in the Color Variations section of the global styles.

Why?

I think we should perform a deep merge, not a shallow merge here.

Testing Instructions

Access Editor > Global Styles > Browse Styles > Color Variations

Screenshots or screencast

Before After
image image

@t-hamano t-hamano self-assigned this Dec 4, 2025
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Dec 4, 2025
@t-hamano t-hamano marked this pull request as ready for review December 4, 2025 08:44
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Looks good ✅


const context = useMemo( () => {
let merged = { ...base, ...variation };
let merged = mergeGlobalStyles( base, variation );
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. The code was previously using mergeBaseAndUserConfigs private util, which was doing the same thing as mergeGlobalStyles.

@t-hamano
Copy link
Contributor Author

t-hamano commented Dec 4, 2025

@Mamaduka Thanks for the review!

@t-hamano t-hamano merged commit 5ba7053 into trunk Dec 4, 2025
54 of 56 checks passed
@t-hamano t-hamano deleted the global-styles-ui-default-color branch December 4, 2025 10:35
@github-actions github-actions bot added this to the Gutenberg 22.3 milestone Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants