close
Skip to content

SpacingSizesControl: Differenciate between default and zero #69082

@krokodok

Description

@krokodok

What problem does this address?

Right now it is not clear from the controls if the smallest value (most times "0") is set or no value at all. I often encounter this confusing scenario when working with the block editor in an existing theme when I want to unset theme spacings by explicitly selecting the 0 value in the SpacingSizesControl.

I feel this issue relates to #43082. However, since we could improve the UX for this singular Control-Element only, I think we could keep this as a separate issue.

No spacings set

Image

<!-- wp:paragraph -->
<p>Test</p>
<!-- /wp:paragraph -->

Spacings set to zero

Image

(I took the effort to take a new screenshot, which is, in fact, pointless, as it looks identical to the default state, which is the point of this issue…)

<!-- wp:paragraph {"style":{"spacing":{"padding":{"top":"0","bottom":"0","left":"0","right":"0"},"margin":{"top":"0","bottom":"0","left":"0","right":"0"}}}} -->
<p style="margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0">Test</p>
<!-- /wp:paragraph -->

What is your proposed solution?

We should try to find an easy, accessible design solution that immediately improves the editing experience. I am not too familiar with the Block Editor design guidelines, so these are just some examples I just came up with.

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] LayoutLayout block support, its UI controls, and style output.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions