Skip to content

Commit

Permalink
Reduce specificity of block margin styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Mar 9, 2023
1 parent 338dd76 commit 6a4947b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/block-library/src/file/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.wp-block-file {
margin-bottom: 1.5em;

&:not(.wp-element-button) {
font-size: 0.8em;
}
Expand All @@ -19,6 +17,11 @@
}
}

// Lowest specificity to avoid overriding layout styles.
:where(.wp-block-file) {
margin-bottom: 1.5em;
}

.wp-block-file__embed {
margin-bottom: 1em;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/post-excerpt/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.wp-block-post-excerpt {
// Lowest specificity on wrapper margins to avoid overriding layout styles.
:where(.wp-block-post-excerpt) {
margin-top: var(--wp--style--block-gap);
margin-bottom: var(--wp--style--block-gap);
}
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/pullquote/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.wp-block-pullquote {
margin: 0 0 1em 0;
padding: 3em 0;
text-align: center; // Default text-alignment where the `textAlign` attribute value isn't specified.
overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
Expand All @@ -25,6 +24,11 @@
}
}

// Lowest specificity to avoid overriding layout styles.
:where(.wp-block-pullquote) {
margin: 0 0 1em 0;
}

// Ensure that we are reasonably specific to override theme defaults.
.wp-block-pullquote.has-text-align-left blockquote {
text-align: left;
Expand Down

0 comments on commit 6a4947b

Please sign in to comment.