Skip to content
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

Spacer: Add background color support #69263

Open
hanneslsm opened this issue Feb 20, 2025 · 2 comments
Open

Spacer: Add background color support #69263

hanneslsm opened this issue Feb 20, 2025 · 2 comments
Labels
[Block] Spacer Affects the Spacer Block [Type] Enhancement A suggestion for improvement.

Comments

@hanneslsm
Copy link

There is a PR to this feature already, but it was closed without a proper discussion.
I strongly disagree with closing the PR. Therefore, this is a separate issue for the background color support for the spacer block. This feature is very much needed.

What problem does this address?

I often need an area with a background color but no content.
It's important that the size of this area can be defined with spacing sizes, because they use clamp.
The group block is not a viable solution, as outlined in my comment: #66433 (comment) The spacer is much better suited here, therefore, let's just add the design tools.

Also, a strong argument for adding the design tools is consistency in the editor, see the corresponding tracking issue: #43245

Other arguments for adding design tools to the spacer block were outlined in #43247 (comment) and #66443

What is your proposed solution?

Add the background-color design tool to the Spacer block, as in #66433

@hanneslsm hanneslsm added the [Type] Enhancement A suggestion for improvement. label Feb 20, 2025
@t-hamano t-hamano added the [Block] Spacer Affects the Spacer Block label Feb 20, 2025
@aaronrobertshaw
Copy link
Contributor

Paraphrasing some of the discussion over on #66433, here a few of the reasons we should hold off adopting block supports on the Spacer block.

  • Semantic Clarity: The Spacer block is meant to represent negative space. Introducing visual styling shifts its purpose, potentially confusing its core meaning.
  • Increased Complexity: Introducing additional styling options complicates the block’s API, potentially confusing consumers who expect a straightforward, purpose-specific tool. Moreover, this added complexity could undermine efforts to consolidate spacer functionality into the padding and margin styles of parent containers, helping to avoid excessive markup.
  • Backward Compatibility Challenges: Once additional styling supports are introduced, there’s a long-term commitment to maintaining them. This can complicate future updates and add maintenance burdens.
  • Alternative Solutions Exist: The desired visual effects can be achieved through other means—such as using a Group block —which maintains a clearer separation between layout structure and decorative elements.

@t-hamano
Copy link
Contributor

t-hamano commented Feb 27, 2025

I think it would be helpful to move this issue forward if we had more examples of what kind of design you want to achieve.

I expect that it might make more sense to extend the Separator block.

Perhaps a dedicated "Decoration block" would be good, but how people decorate will vary, and I feel that is the role of a plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Spacer Affects the Spacer Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants