-
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
Fix: theme colors cannot override defaults #36811
Conversation
Marking as "needs dev note" to share that theme overriding theme colors is not expected and creates conflicts with the current direction for the UI color component (showing all palettes). |
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 👍
Pushed a change to limit this to the |
d0491e7
to
1657ce6
Compare
* Additionally, for some preset types, we also want to make sure the | ||
* values they introduce don't conflict with default values. We do so | ||
* by checking the incoming slugs for theme presets and compare them | ||
* with the equivalent dfefault presets: if a slug is present as a 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.
Typo: dfefault
Did another test after the updates and things seem to work well. |
Fixes #36772
This PR removes the theme presets that have the same slug as a core preset of the same type. For example, the color theme presets can't have a
black
slug, which is already part of the color default presets.How to test
Global presets are filtered
theme.json
update the value of the colors whose slug isblack
andwhite
to a color that is easily inspectable for debugging purposes. For example:global-styles-inline-css
embedded stylesheet.--wp--preset--color--black
whose value is#000000
and a single--wp--preset--color--white
whose value is#FFFFFF
(they come from the default palette).#FF69B4
.Block-level presets are filtered
theme.json
file of the TT1-blocks, add the following palette undersettings.blocks.core/paragraph.color.palette
:global-styles-inline-css
embedded stylesheet the expected result is that there's new CSS Custom Properties and classes scoped to the paragraph block: