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

Percentage option for various block settings are confusing to use #38871

Open
annezazu opened this issue Feb 17, 2022 · 3 comments
Open

Percentage option for various block settings are confusing to use #38871

annezazu opened this issue Feb 17, 2022 · 3 comments
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

Description

It seems like multiple settings don't work with the % option. This was found as part of the latest FSE Outreach Program's All Things Media:

Adjusting certain dimension with ‘%’ as the variable, nothing happens in the frontend. For example: ‘Minimum height of cover’, ‘Letter spacing’ for various blocks, ‘Border radius’ for image block

Step-by-step reproduction instructions

There are a few ways to replicate this:

Cover Block - Minimum Height

  1. Add a cover block.
  2. Under the Minimum height, change the option to percentage.
  3. Try to change the percentage. Notice it adjust at first but then doesn't respond beyond.

Image Block - Border Radius

  1. Add an image block.
  2. Under the Border Radius, change the option to percentage.
  3. Try to change the percentage.

Screenshots, screen recording, code snippet

percentage.mov

Environment info

  • WordPress 5.9
  • Gutenberg 12.6
  • MacOS
  • Chrome

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

@annezazu annezazu added [Type] Bug An existing feature does not function as intended [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Feb 17, 2022
@jasmussen
Copy link
Contributor

The percentage option is very tricky because it only ever has an effect if the parent container has an explicitly defined height. Without it, it just won't do anything, and in that vein this is just the weirdness of CSS at play.

In that light, short of disabling the percentage option (perhaps by default, letting themes surface it), I don't know there's anything we can actually do here.

@annezazu
Copy link
Contributor Author

Oh wow! I like that middle ground of disabling the option by default but letting themes allow it if they want. Otherwise, it seems pretty darn confusing to include as is.

@annezazu annezazu changed the title Percentage option for various block settings do not work Feb 24, 2022
@annezazu
Copy link
Contributor Author

Updated the title to be a bit clearer.

@mtias mtias removed the [Type] Bug An existing feature does not function as intended label May 22, 2022
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
4 participants