Allow Saving Custom Colors to the unique Color Palettes for color or background
What problem does this address?
One can save a custom color to one palette.
What is your proposed solution?
It would be nice to save a color into a palette for text, background or other needed color palettes.
Reiterating and expanding on a comment from #28146:
I dug into the button block source code for hours to figure out if it is in any way possible to alter or remove just the background color palette while leaving the text color palette alone. It doesn't appear that there is any way to treat a block's text and background color palettes differently, whether the aim is to have different palettes for text vs background or to remove/hide one of the panels entirely.
This is very frustrating as a theme developer, especially regarding the button block. It's simple enough to restrict the overall palette for the block, but I simply don't need/want two separate palettes handling the background and text separately. While that is useful in a broad sense (for example, if the background color selected makes the text hard to read), my theme handles text color for colored backgrounds automatically.
It would be really useful if each block had a registered set of "slugs" for each color palette that applies, with the ability to change those specific palettes via theme.json while the rest inherit from the block's color palette which in turn inherits from the global palette.
With a system like that in place, I could see the potential for being able to add new palettes to blocks on the fly, which would automatically output .has-#color-slug#-#palette-slug#-color CSS custom properties, which already maps to .has-#color-slug#-text-color and .has-#color-slug#-background-color.
@jorgefilipecosta has this issue already been taken care of for Global Styling etc?
It would be nice to save a color into a palette for text, background or other needed color palettes.
As far as I know, there are no plans to have different palettes for text, background, etc. The plan is still to have all the palettes the same.
+1 for this idea. Surprised it's not being actively addressed. I don't think that theme/block developers will necessarily want to offer separate palettes within each block. But separating the text color and the background color palettes seems to be a no-brainer.
- If the same palette is defined for both the text and a background color, it will ALWAYS be possible to set the text color and the background color as the SAME color. Probably not what you'd want. 😁
- Colors that you might want as background color options will generally NOT make for good foreground color options. Example: #c1f2bd is a nice cool green color, great for backgrounds. But, you'd almost NEVER want to make that a foreground color for fear that people with color blindness won't be able to see the text within your site.
Is this issue being addressed? I also need to separate text colors from background colors.
Any luck with this issue? I took would like to separate text colors from background colors.
Commenting back here as this open issue can probably be closed. (Although I am not sure which PR might have closed it.)
But by using theme.json it is now possible to define unique color palettes for each of the supported color selectors of an individual block.
The resource at https://fullsiteediting.com has an outstanding write up on this feature: https://fullsiteediting.com/lessons/theme-json-color-options/
@SteveRyan-ASU the issue is that it is not possible to save distinct color palettes for use with background colors versus text colors. Currently, background and text colors can only use identical palettes. That has not been addressed in the linked documentation, as, as far as I can tell, there still appears to be no way to do so in theme.json.
+1 for this feature.
| Gutenberg: Text tab also include a color for the background | Notion: Separate colors for background and text |
|
|
This is acceptable if the theme has a small color palette, but it becomes unacceptable for themes with a large color palette.
+1 for this feature.
The Developer Blog article by @ndiego highlights so many excellent ways to curate the experience in the editor. For me, not being able to have separate color palettes feels like a big limitation. I notice this most with the cover block—where I often want to restrict the overlay colors, but the text colors naturally need to be different. Right now, I work around this by using section styles, but it doesn’t feel intuitive for the user.
Hopping over here from #28146, I wanted to share my CSS hack that at least curates the shared palette a bit for users to understand which colors should be used for what: https://github.com/WordPress/gutenberg/issues/28146#issuecomment-2596139270
I've been doing some triage, @paaljoachim, and both this and #28146 are both very old issues, but still both very relevant and with active participations and suggestions. If you have time, would you be up for slightly refreshing these issues, perhaps with a quick sketch of a proposed solution, and clearer titles? No worries if you don't have time to do so, just wondering how we can make these two the most actionable.