-
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
Make the core color palette opt-in for themes with not theme.json
#36496
Conversation
Closes #36489 |
theme.json
theme.json
// The "default" theme doesn't have theme.json support. | ||
switch_theme( '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.
It might not be accurate in the future, but it works for now.
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.
b4c25a0
to
d3906db
Compare
This is not ready to land. We need to also cover the case in which the theme does not provide any theme palette: in that case, we still need to show the core one. Updated PR description with instructions for testing. |
@oandregal, I'm going to add the "In Progress", so we don't merge it by accident 😄 |
@fabiankaegy @Mamaduka This is now ready to test. I've run this by some folks (Matías and others) and they think it's best to add new theme supports that classic themes can use to opt-in into this, so I've done that as well. Another point of feedback was that we should rename |
I'm going to go ahead and merge this one to unblock #36622 Please, feel free to do post-merge reviews and I'll address any issue left. |
theme.json
theme.json
I did another test run and works as expected 👍 |
…json` (#36496) Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com>
This is not fixed in Gutenberg 12.0.1 . Still broken there. I have a wall of ugly "core". I assume that's intentional? Is there a timeline for this patch to make it into the released plugin? |
Hey Steve, this is going to be part of the 12.1 release, which should be a few days away. |
Follow-up to #36492 #35970
In #35970 we introduced the ability to show three different palettes (default, theme, user) in the color UI component. We also have a couple of flags for themes to disable this should they want (
corePalette
,coreGradients
). However, by introducing this change, themes that don't usetheme.json
will now see the default colors as well.This PR introduces the following changes:
theme.json
that declare its own palette.theme.json
to opt-in into the default solid and gradient palettes, so they can show both the default and the theme one:default-color-palette
which mimic the existingeditor-color-palette
theme supportsdefault-gradient-presets
which mimics the existingeditor-gradient-presets
theme supportHow to test
Test a theme that does not provide a palette:
Test a theme that provides a palette:
Test a theme that provides a palette and opts-in into the core palette:
add_theme_support( 'default-color-palette' )
andadd_theme_support( 'default-gradient-presets' )
in itsfunctions.php
.