-
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
Fix to remove default indent from Latest Posts and Latest Comments block in various editors #32983
Fix to remove default indent from Latest Posts and Latest Comments block in various editors #32983
Conversation
Size Change: +305 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. There are some small things you might want to fix while you're in here, but they don't seem specific to the PR, so I'll leave that up to you.
TT1 blocks editor:
Frontend:
I'm happy to confirm that the auto margins are easily overridden in block themes:
There's extra padding on that block, though, on the frontend. That might be worth resetting:
Testing in "Empty Theme" from https://github.com/WordPress/theme-experiments (should be mostly the same as not loading editor styles). Editor:
Frontend:
That extra padding remains here on the frontend, not sure why. Would be nice to fix:
TT1 non-blocks:
Happy to also report here that there were no problems with the auto margins. Frontend:
It appears the padding on the latest comments is fixed in TT1. But it might still be worth fixing that in the block itself.
Overall, this seems pretty simple and safe. Nice work.
// Removes left spacing in Customizer Widgets screen. | ||
// Due to low specificity this will be safely overriden | ||
// by default wp-block layout styles in the Post/Site editor | ||
margin-left: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My biggest concern was this one, exactly because of the auto margins for centering. Thanks for adding the comment to explicitly address that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding the comment to explicitly address that.
Exactly this. I'm a big proponent of not adding random CSS rules without explaining why they are needed.
Why? Because otherwise things can get easily removed without folks understanding the consequences 😄
I wanted to also point towards this PR: #32659 — the goal of that PR is to lower specificity of default and reset styles. It could affect this PR, but shouldn't. But notably there's a section about explicit ol/ul rules, just as an FYI. |
@jasmussen any chance that's just your browser's default CSS rule? Here's what I see on my end: The only padding here is one on the latest post's list, and it comes from Chrome's default stylesheet: |
Actually I don't know how to reproduce what I saw. This exact rule, https://github.com/WordPress/gutenberg/pull/32983/files#diff-2ce6afde773c81a8c2ffe93c50e539c6e868a08da6095c45c3bbd5a263d1af93R12, seems meant to solve the problem I was describing, and works as intended. I'm testing on a different computer now than last time, that's the only difference. What you show in the screenshot I see in trunk still, though, and yes, those are the default values. Edit: In any case, checks are green, all's good! |
Thinking about this more I think this is to be expected.
So looks like we're good to merge on this one then? |
Editor and front-end would both still see block styles, and in my edgecase which I can no longer reproduce (env issues?) I was seeing padding-left: 0; in the editor, and no similar rule output for the frontend. The two should be in sync with block styles, regardless of theme styles. But yes, definitely ship this. The issue I was seeing, outside of apparently not being an issue, was a separate one anyway! |
…ock in various editors (#32983) * Remove default left spacing on Latest Posts in all Editors * Remove spacing consistently across Post/Site, Widgets and Widgets Customizer editors * Fix indentation of Comments block in Site Editor
…ock in various editors (#32983) * Remove default left spacing on Latest Posts in all Editors * Remove spacing consistently across Post/Site, Widgets and Widgets Customizer editors * Fix indentation of Comments block in Site Editor
Description
Simplified fix for #32718.
Essentially the aim of the PR is to remove any visual "indent" (left spacing) from both:
...when they are in their default state with "Theme Styles" preference turned off in the following Editors:
How has this been tested?
Repeat the above but for the following Editors:
Screenshots
Before
Screen.Capture.on.2021-06-25.at.10-14-29.mov
After
Screen.Capture.on.2021-06-25.at.10-05-28.mp4
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).