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

Multiple blocks: Make the added padding when there is a background color optional #50813

Closed
wants to merge 12 commits into from
Closed
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
7 changes: 0 additions & 7 deletions packages/block-library/src/columns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@
margin-bottom: 1.75em;
}

// Add low specificity default padding to columns blocks with backgrounds.
:where(.wp-block-columns.has-background) {
// Matches paragraph block padding.
padding: $block-bg-padding--v $block-bg-padding--h;
}


.wp-block-column {
flex-grow: 1;

Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/columns/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Add low specificity default padding to columns blocks with backgrounds.
:where(.wp-block-columns.has-background) {
// Matches paragraph block padding.
padding: $block-bg-padding--v $block-bg-padding--h;
}
3 changes: 0 additions & 3 deletions packages/block-library/src/heading/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ h3,
h4,
h5,
h6 {
&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
&.has-text-align-right[style*="writing-mode"]:where([style*="vertical-rl"]),
&.has-text-align-left[style*="writing-mode"]:where([style*="vertical-lr"]) {
rotate: 180deg;
Expand Down
10 changes: 10 additions & 0 deletions packages/block-library/src/heading/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Add low specificity default padding to headings with backgrounds.
:where(h1.has-background),
:where(h2.has-background),
:where(h3.has-background),
:where(h4.has-background),
:where(h5.has-background),
:where(h6.has-background) {
// Matches paragraph block padding.
padding: $block-bg-padding--v $block-bg-padding--h;
}
4 changes: 0 additions & 4 deletions packages/block-library/src/list/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
ol,
ul {
box-sizing: border-box;

&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
}
6 changes: 6 additions & 0 deletions packages/block-library/src/list/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Add low specificity default padding to lists with backgrounds.
:where(ol.has-background),
:where(ul.has-background) {
// Matches paragraph block padding.
padding: $block-bg-padding--v $block-bg-padding--h;
}
4 changes: 0 additions & 4 deletions packages/block-library/src/paragraph/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ p.has-drop-cap.has-background {
overflow: hidden;
}

p.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}

// Use :where to contain the specificity of this rule
// so it's easily overrideable by any theme that targets
// links using the a element.
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/paragraph/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Add low specificity default padding to paragraphs with backgrounds.
:where(p.has-background) {
padding: $block-bg-padding--v $block-bg-padding--h;
}
5 changes: 5 additions & 0 deletions packages/block-library/src/preformatted/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Add low specificity default padding to preformatted blocks with backgrounds.
:where(.wp-block-preformatted.has-background) {
// Matches paragraph block padding.
padding: $block-bg-padding--v $block-bg-padding--h;
}
1 change: 0 additions & 1 deletion packages/block-library/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
@import "./form-input/style.scss";
@import "./gallery/style.scss";
@import "./group/style.scss";
@import "./heading/style.scss";
@import "./image/style.scss";
@import "./latest-comments/style.scss";
@import "./latest-posts/style.scss";
Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/theme.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
@import "./audio/theme.scss";
@import "./code/theme.scss";
@import "./columns/theme.scss";
@import "./embed/theme.scss";
@import "./gallery/theme.scss";
@import "./heading/theme.scss";
@import "./image/theme.scss";
@import "./list/theme.scss";
@import "./paragraph/theme.scss";
@import "./preformatted/theme.scss";
@import "./pullquote/theme.scss";
@import "./quote/theme.scss";
@import "./search/theme.scss";
Expand Down
Loading