Global Styles: Add background color control to global styles Background panel#74386
Global Styles: Add background color control to global styles Background panel#74386amitraj2203 wants to merge 5 commits into
Conversation
|
Size Change: +1.22 kB (+0.04%) Total Size: 3.08 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Hi @t-hamano, When you have a moment, could you please review this new PR? |
t-hamano
left a comment
There was a problem hiding this comment.
@amitraj2203 Thank you for your continued efforts!
As I understand it, the problem we're trying to solve with this PR is to improve the discoverability of the background color control in global styles. This PR seems to work fine for global styles, but I noticed that it looks odd for block instances.
| trunk | This PR |
|---|---|
![]() |
![]() |
That is, the background color control appears duplicated in the following places:
- Color > Background
- Background image > Color
I know a lot of work has been done on this issue, but perhaps we should start by discussing what the UI should look like at the block instance level. My guess is that maybe at the block instance level, we should remove the background panel from the color section entirely.
cc @ramonjd @WordPress/gutenberg-design
|
Thanks for the feedback. I’ll wait for the design team’s input and, once we have clearer direction, I’ll actively work on incorporating the suggested changes and any additional feedback that comes up. |
|
The current interaction in global styles is tricky. You can set a background color, then go to Background, select an image, and the color is replaced. Even when going to Colors to set a new background color, this doesn't replace the new one. I agree with @t-hamano that address this at the block level is better to scale the feature more consistently. In that vein, I think the approach of "image or color" leads to confusion as these are incompatible. I lean towards shifting the approach and configure blocks to have both image and color, depending on the block type. This would expand the feature more consistently and leaves room for having, for instance, gradients in text. If images and colors work as layers, other features like opacity and layers mode could exist. Duotone filter already does this. Here is a very rough mockup of the idea. See how the approach changes from setting colors to setting text and/or background.
Curious about what @jameskoster and @jasmussen think of this as we've lightly touched on this topic before. |
|
Dedicated "Background" (not background image) panel seems the way to go. Among the good thoughts I also see a Color → Text rename of the existing panel, I don't think we should do that quite yet since in many cases that same panel is used not for text but for cases that feature inheritance, such as social icon colors. It can still be explored as a separate change if strongly felt. |
|
I love your exploration @jameskoster ❤️. It makes way more sense to put the text color inside Typography, and the way of stacking layers for the background is clean and clear.
Agree. My suggestion was to introduce the approach change. Glad that we're aligned in the value the shift brings so we can continue exploring it. Based on the design shared in #62752, it seems safe to move the color control for texts to be in Typography while keeping it as Colors (current) in social icons and any other block where it controls non-text elements. |
|
Hi @t-hamano, could you please let me know if there is anything that needs to be done in this PR from my side? Thanks! |
|
@amitraj2203 At this point, I believe we can improve the background image UI in a separate new PR. See #74386 (comment) It seems to me that a bit more design work might be required to move this PR forward. |
|
+1 to @t-hamano's idea. That improvement in the control feels safer as the approach change requires more thought. |








What?
Closes #63096
Why?
Introduces a new
BackgroundColorControlcomponent that allows users to set solid colors and gradients for backgrounds in the global styles interface.The control appears in the Background panel alongside the existing background image control and respects theme.json settings for both color and background image features independently.
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Recording.2026-01-06.at.5.18.11.PM.mov