Skip to content

Fix: Default color variations not showing in global styles#73742

Merged
t-hamano merged 1 commit into
trunkfrom
global-styles-ui-default-color
Dec 4, 2025
Merged

Fix: Default color variations not showing in global styles#73742
t-hamano merged 1 commit into
trunkfrom
global-styles-ui-default-color

Conversation

@t-hamano

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

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

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 <wildworks@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

t-hamano commented Dec 4, 2025

Copy link
Copy Markdown
Contributor Author

@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.

2 participants