Skip to content

Commit

Permalink
Pullquote Block: Add padding and margin support (#45731)
Browse files Browse the repository at this point in the history
* Pullquote Block: Add padding and margin support

* Update padding styles

* Don't use __experimentalStyle
  • Loading branch information
t-hamano authored Jan 16, 2024
1 parent 33b6e64 commit d452cb4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ Give special visual emphasis to a quote from your text. ([Source](https://github

- **Name:** core/pullquote
- **Category:** text
- **Supports:** align (full, left, right, wide), anchor, color (background, gradients, link, text), typography (fontSize, lineHeight)
- **Supports:** align (full, left, right, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight)
- **Attributes:** citation, textAlign, value

## Query Loop
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/pullquote/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"text": true
}
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
14 changes: 13 additions & 1 deletion packages/block-library/src/pullquote/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wp-block-pullquote {
padding: 3em 0;
padding: 4em 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.
box-sizing: border-box;
Expand All @@ -10,6 +10,18 @@
color: inherit;
}

blockquote {
margin: 0;
}

p {
margin-top: 0;

&:last-child {
margin-bottom: 0;
}
}

&.alignleft,
&.alignright {
max-width: $content-width * 0.5;
Expand Down

0 comments on commit d452cb4

Please sign in to comment.