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

Fix to remove default indent from Latest Posts and Latest Comments block in various editors #32983

Merged
merged 3 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/block-library/src/latest-comments/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
// Lower specificity - target list element.
ol.wp-block-latest-comments {
// 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;
Copy link
Contributor

@jasmussen jasmussen Jun 25, 2021

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.

Copy link
Contributor Author

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 😄

}

// Higher specificity - target list via wrapper.
.wp-block-latest-comments .wp-block-latest-comments {
// Remove left spacing. Higher specificity required to
// override default wp-block layout styles in the Post/Site editor.
padding-left: 0;
}

Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/latest-posts/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
}
&.wp-block-latest-posts__list {
list-style: none;
padding-left: 0;

li {
clear: both;
}
}

&.is-grid {
display: flex;
flex-wrap: wrap;
Expand Down