-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix: theme colors cannot override defaults #36811
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
|
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). |
jorgefilipecosta
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.
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
blackslug, which is already part of the color default presets.How to test
Global presets are filtered
theme.jsonupdate the value of the colors whose slug isblackandwhiteto a color that is easily inspectable for debugging purposes. For example:{ "slug": "black", "color": "#FF69B4", "name": "Black" }, { "slug": "white", "color": "#FF69B4", "name": "White" }global-styles-inline-cssembedded stylesheet.--wp--preset--color--blackwhose value is#000000and a single--wp--preset--color--whitewhose value is#FFFFFF(they come from the default palette).#FF69B4.Block-level presets are filtered
theme.jsonfile of the TT1-blocks, add the following palette undersettings.blocks.core/paragraph.color.palette:[ { "slug": "black", "color": "#FF69B4", "name": "Black" }, { "slug": "yellow", "color": "#EEEADD", "name": "Yellow" }, { "slug": "white", "color": "#FF69B4", "name": "White" } ]global-styles-inline-cssembedded stylesheet the expected result is that there's new CSS Custom Properties and classes scoped to the paragraph block: