Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Make padding more specific to heading block
  • Loading branch information
mikachan committed Oct 30, 2025
commit 633e370752434c4cb7747ed628061106793a1eef
6 changes: 0 additions & 6 deletions packages/block-library/src/accordion-heading/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// The .wp-block-accordion selector is needed to make this CSS stronger
// than the default heading padding when background color is applied.
.wp-block-accordion .wp-block-accordion-heading {
padding: 0;
}

.wp-block-accordion-heading__toggle {
font-family: inherit;
font-size: inherit;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/heading/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ h3,
h4,
h5,
h6 {
&.has-background {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this raise the specificity of all theme authors that are targeting h#.has-background? If so, I could see that breaking a lot of sites.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh yes, it will raise the specificity and make it so theme authors would need to add .wp-block-heading to any existing selectors targeting h#.has-background.

I wonder if we could use :where here to ensure theme authors don't need to update any existing selectors. Maybe this would work: &:where(.wp-block-heading).has-background? I'll do some testing.

&.wp-block-heading.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
&.has-text-align-right[style*="writing-mode"]:where([style*="vertical-rl"]),
Expand Down
Loading