-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Feedback: It is confusing that adding background color also adds padding. #30725
Comments
The fifth call for testing for the FSE program also led to similar feedback being shared:
I imagine this will be implemented as more padding controls are explored but wanted to pass this feedback along! |
Associated: |
Just want to chime in here with a +1. The confusing thing about this behavior for me is that the padding changed, but wasn't communicated to me in any way. I'm not sure it should work this way, but even if it was, it would be really nice if somehow the new padding number would be displayed to me. Because my user experience was padding was blank before there was a background color and it was blank after there was a background color. |
Definitely agree that this is confusing behaviour. It came up in this forum thread, when a user was confused by the large amount of padding added automatically the moment a background colour was put on a paragraph block within a column: https://wordpress.org/support/topic/how-can-i-make-all-blocks-within-a-row-with-one-height/ |
This continues to come up in the FSE Outreach Program as well, including the fifteenth call for testing:
Since we have more dimension controls, it would be interesting to iterate on this! |
+1 on this ... I was very confused why adding a background color to a column would also add padding. |
This came up in the nineteenth call for testing for the FSE Outreach program:
|
Is there any way to remove this behavior (padding added automatically when a background color is applied) without affecting existing blocks? |
Didn’t realise this issue existed and created another one today based on this issue. Really confusing and frustrating functionality IMO, especially when the UI can control padding easily so the opinionated CSS being applied is irrelevant and more confusing than helpful. My notes from duplicated issue #49230 What problem does this address? I am currently trying to move more and more away from ACF blocks in favour of core blocks, and today while setting up a header template part for my navigation, I wrapped it in a group block to enable the sticky functionality, added a white background colour so the navigation is still visible on scroll, and for some random reason there is padding now added to the group block on the basis that it has a background colour. The CSS being applied: :where(.wp-block-group.has-background) { There is already a padding UI setting for the group block so it makes no sense really for this opinionated CSS to be applied. I can think of some use cases when this may be helpful but it is so easy to add in the UI, it doesn't seem necessary to have a blanket CSS rule on background colours. What is your proposed solution? Remove the unneccesary CSS targeting blocks when they have a background colour to apply padding. It isn't needed and only gets in the way. I could very easily add padding, if that is what I needed or wanted. The opposite isn't true. |
It might difficult to remove it in a backwards compatible way, as the padding is applied using the I can't think of any way to safely remove that style without doing something ugly. Possibly it could be opted out of at a theme level, that way newer themes could gradually move away from this behavior. edit: worth noting that there's a more in-depth technical discussion about removing it in this issue - #43110. |
Block themes opt out of it by default. |
Ok, I still see it in some blocks in TT3. |
It's supposed to have been fixed in 6.2 🤔 the file that adds the padding isn't supposed to be loaded unless the block theme opts-in. |
I found padding on |
|
The issue is quite old, but just got the same problem with interesting side effects: |
I recently had problems with opinionated styles. Adding ugly paddings to my blocks when I added background color. I really dislike that WordPress decides that is good for me to add paddings that I don't want. It required me to override them adding extra lines to my block styles in theme.json IMHO opinionated styles should be removed. |
Hi @VariantT505. I understand your frustration, it is an unexpected behavior AND as @carolinan said it isn't so easy to make this change or decide to change this behavior now that it is implemented in so many sites. I don't understand the intricacies of changing something on this scale but it seems that it's core and if it changes many sites will break. I think we need to consider that at some point the person (release cycle cohort) who made it this way thought it was beneficial for the community but since then, it is true, we have seen many frustrated people wanting the padding taken away. For a user that isn't proficient in the block editor this can really slow them down trying to find the solution. Before I started to become more involved in WordPress I was often confused and definitely frustrated with some of the block editor's behaviors. I now realize, after getting involved in some tickets for design and feedback in GitHub that it is a consensus process with many many people involved and trying their best to provide good experience for the user. I would love to invite you to look deeper into the process of making a change like the one you (and myself) are requesting in this thread. Maybe, looking further into it, you will become inspired to be involved. Many of the changes that are made come from people who feel passionate about "fixing" or modifying a behavior. At learn.wordpress.org there are lots of lessons for helping with and using WP. This lesson, in particualar, came to mind when reading your response. It says: "Because contributions to open source projects are usually volunteer work, contributors are usually driven by some personal reason to work on a bug or feature. This usually results in a developer (or other kind of volunteer) who approaches a problem with strong motivation and a passion for solving it, plus some personal experience informing their direction and creating empathy for the end users of the feature/program." You should get involved if you have time. Maybe we can work on some tickets together. |
Just popping in to say, +1 confusing. Someone brought this up to me in a meeting today and all I thought was, "there must already be an issue on the WordPress/gutenberg github for this" |
I have likely mentioned this before, but when there is a pre defined setting the UI should reflect it, so the user can see that in this case that padding is added and should also be able to see it and can remove the padding with using the UI. |
Following this thread, this needs to be opt-ed out |
This is the bare minimum of what should be done regarding this issue. Obviously, automatically adding padding was a bad idea and not even having the UI reflect that was an even worse idea. @carolinan has made the case that
Even if we grant that, there still is ZERO reason that has ever been articulated as to why there would be padding (or any other styling value) applied yet not see those values in the panel where those values are edited. This part should be fixed now and not discussed ad nauseam for another 3 years. Make all applied values show in the panel. |
Just chiming in on the latter comment as there's work underway to show some of the style inheritance options including this PR that sets the stage technically. This is related to individual blocks showing inherited values from Styles and theme.json. I'll note this overall feedback on the last issue as I think these various efforts can collide in a way that creates a better experience for all where anything inherited, whether through adding background color or from Styles, can be easily understood. |
+1 to the idea of allowing themes to opt out of this behavior. Or updating it so that the values come from the spacing presets included in the theme instead of the current arbitrary values.
One tricky part here is that the values can come from .css files, which cannot be read by the control. Setting padding locally in the editor will take priority in those cases though, so one option we might consider is: when a block has a background color; display the Padding controls automatically. This might make it more obvious how to change the padding, or set it to 0 if required? |
i get the idea of a default padding on a bg colored paragraph but this should come from the spacing padding control like other conversations above mentioned. I ended up with prefix my tailwind theme with a important strategy on 'body' I hope this padding will be removed soon instead, an opt-out from out the theme.json would be acceptable |
With WordPress 6.6 Beta 1 being targeted for tomorrow: June 4 and no assigned developer or pull request for this issue. The Editor Triage Leads will move this to |
I'm a wondering why this was moved to a minor release? As opposed to being punted to any future major released and not placed on a board for now. It is not a new bug or regression, nor is there any progress made. |
I need some clarification on the ask here. For clarity: Editor Triage Leads for WordPress 6.6 release cycle triaged items to prepare for the WordPress 6.6 Beta 1 release. We aimed to triage items on the WordPress 6.6 Editor Tasks GitHub project board to keep it focused on general Roadmap features. Since this issue has no associated pull request, we (Editor Triage Leads) decided it would be best to move it to the Hopefully that helps clarify how this landed in the |
I only wanted it to be clarified wether it was truly expected for this to be added in a minor release, because usually features like this are not added in minor releases. Please understand that these boards are also used by contributors who are planning and choosing what to work on next, and to better understand what needs to be prioritised. |
I would agree that it's not going to end up in a minor release. A fix would probably be something to release in the plugin early during a major release cycle. I'll move it to 'Punted to 6.7'.
In contrast to my earlier response, I now think it might be possible. The The potential issues:
I'll try something out on a PR. |
Hmm, actually I'm not so sure having looked at it again. It seems like there are a lot of classes like edit: also |
maybe a |
That's a good idea: When it's not in the theme.json and parsed by php it won't affect the current styling. New themes can adopt a Boolean true (which can have the value that it has now). Or a custom value. False, won't add the padding at all. |
I'm adding in another +1 for this to be resolved. No rhyme or reason for padding to be added because a BG color is added. |
Now that there's For example setting |
During a user testing session on April 9, several users asked why adding a background color to a block also adds padding, this result was unexpected for them.
Comments included:
Coloring the background of my text, the text automatically moves to the right. I can’t get it back.
Why does the column change size when changing the color in the settings? At least it definitely seemed like it happened that way. That’s unnecessary and unexpected
The text was updated successfully, but these errors were encountered: