-
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
Allow overwrite of colors for PanelColor component #7806
Comments
Hi @florianbrinkmann, Is passing a colors array by default with add_theme_support( 'editor-color-palette' ) that is used by the core blocks (paragraph etc...) and using different arrays on your own blocks an option? From your description, It seems currently you define all the colors with add_theme_support( 'editor-color-palette' ) and on your blocks, you use subsets of this colors. And you wanted to use a different subset on paragraph. Maybe the solution passes by using non-subsets on the colors of your blocks. The downside is that you may lose access to some of our abstractions on blocks not using editor colors like the withColors. |
thanks for your comment!
Hm, not really, because that would mean that the background color controls provided by the core blocks would have the same colors as the text color controls of the core. And I want them to be different :) In short: I want to be able to define the colors X, Y, and Z and use them for all text controls, and use the colros A, B, and C for all background color controls. Regardless if that are controls of custom blocks or core blocks. And I could get this working if I would be able to define custom color overwrites for the Hope that makes it clearer :) Thanks, |
👍 On this ask. Currently, we are creating tons of custom modules that may not be needed if we have the ability to use block nesting with simple |
This isn't quite what @florianbrinkmann may be asking for, but it would be really nice to simply be able to define separate color palettes for background and text. I think his use case seems quite reasonable, and I found this ticket because I was hoping to do the same thing. In terms of the PHP API, this might look like this:
add_theme_support( 'editor-color-palette', array(
array(
// define your first color
),
array(
// define your second color
)
) );
add_theme_support( 'editor-color-palette', array(
'color' => array(
array(
// define your first color
),
array(
// define your second color
)
),
'background-color' => array(
array(
// define your first color
),
array(
// define your second color
)
)
) ); |
It makes me wonder whether the proposal from @youknowriad https://make.wordpress.org/core/2020/01/23/controlling-the-block-editor/ and filed under #20588 doesn't share the same characteristics. In general, it also overlaps with the Global Styles project (https://github.com/WordPress/gutenberg/projects/40). |
Been a couple years since last updated; this component is now known as PanelColorSettings; is this still applicable? |
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks. |
Closing following triage policy |
Is your feature request related to a problem? Please describe.
I have a project that needs two different color palettes for text and background colors. I got this working for my own block with
add_theme_support( 'editor-color-palette' )
call.colors
param of theColorPalette
component.But now I have a new problem with that: I want to modify the text color palette of paragraph blocks, so it only shows the wanted colors. I wanted to create a similar solution fopr that like for my own block via the
editor.BlockEdit
filter, but that was not really successful.Describe the solution you'd like
Being able to define
colors
for thePanelColor
component, like it was done forColorPalette
, would be really nice :)The text was updated successfully, but these errors were encountered: