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

Inability to distinguish between default and none margin/padding values #68069

Open
3 of 6 tasks
luisherranz opened this issue Dec 17, 2024 · 5 comments
Open
3 of 6 tasks
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended

Comments

@luisherranz
Copy link
Member

Description

In the Editor, it is not possible to visually differentiate between a margin or padding value that is set to the default and one that is explicitly set to "none" (0). Additionally, the UI does not clearly indicate that clicking the blue circle next to a margin/padding value will set it to "none." This lack of clarity can lead to confusion and make it difficult to manage spacing effectively.

Step-by-step reproduction instructions

  1. Select a block that has margin or padding settings (e.g., Group, Columns).
  2. Observe the margin/padding values in the Dimensions panel.
  3. Note that there is no visual distinction between a default value and a value explicitly set to "none."
  4. Click the blue circle next to a margin/padding value.
  5. Observe that the value is reset to "none," but there was no prior indication that this would happen.

Screenshots, screen recording, code snippet

Image Image

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Layout Layout block support, its UI controls, and style output. and removed Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Dec 17, 2024
@ramonjd
Copy link
Member

ramonjd commented Dec 18, 2024

Thanks for the issue.

This represents a smaller part of a wider issue:

Since #65071, global styles changed from being only able to be read by admins, to any users that can edit posts. Which is a long way of saying that global styles are now available in the post editor context.

This means that "default" values, by which I think you mean values inherited from the theme or global styles, can be referenced and even set in the control.

An example of this working is the background image control. Other controls, such as spacing, haven't had the same treatment.

It think it needs some UX and design thoughts, but the low-fi approach would be to set the control values with the default if any are found. Easy to say that 😄 but it might work for things like spacing.

@luisherranz
Copy link
Member Author

"default" values, by which I think you mean values inherited from the theme or global styles

Yes, I do.

can be referenced and even set in the control

But no, I don't mean that the values of Global Styles can be changed in the invididual block settings if that's what you mean.

Let me describe a specific example that will be simpler.

  1. The user finds that there is a margin in one of their blocks.
  2. The user wants to remove that margin and looks at the UI. This is what they see:
Image
  1. There is no indication that there is a default margin.
  2. At the moment the user clicks on the blue circle, the block changes from inheriting the default margin to having a set margin, in this case, to zero ("none"). This is what they see:
Image
  1. There is no difference from the previous state, and therefore, it is also not possible to differentiate between a block that inherits the margin and one that has it set to zero.

In my opinion, this is confusing.

@ramonjd
Copy link
Member

ramonjd commented Dec 18, 2024

Thanks for the follow up comments @luisherranz

But no, I don't mean that the values of Global Styles can be changed in the invididual block settings if that's what you mean.

Sorry, I meant, for block styles:

  1. Where a block-level value has not be set in the controls, and
  2. there's a global styles (default) value, then
  3. set the "default" a.k.a global styles value as the control value.

Any changes to the control's value would only affect the block. And "resetting" the control would "reset" to the default global styles value. If there's none, then to null/zero/whatever.

Background image controls already do this, I'm pretty sure.

I think we're on the same page 😄 and I agree - I hope one day #64670 will get some momentum.

@luisherranz
Copy link
Member Author

Perfect, thanks, @ramonjd 🙂

@hanneslsm
Copy link

Noting that @krokodok added in #69082 some design proposals of how the SpacingSizesControl when no value is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants