From b5cea30704f8adbad54b9028b34e0e3b4bf1adca Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Sat, 12 Nov 2022 17:10:14 +0900 Subject: [PATCH 1/3] Pullquote Block: Add padding and margin support --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/pullquote/block.json | 4 ++++ packages/block-library/src/pullquote/style.scss | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 65e3cb1f65c8fc..fce6c1e0632605 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -599,7 +599,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 diff --git a/packages/block-library/src/pullquote/block.json b/packages/block-library/src/pullquote/block.json index 0732bb52f66bfb..2cad2d2c034143 100644 --- a/packages/block-library/src/pullquote/block.json +++ b/packages/block-library/src/pullquote/block.json @@ -36,6 +36,10 @@ "text": true } }, + "spacing": { + "margin": true, + "padding": true + }, "typography": { "fontSize": true, "lineHeight": true, diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss index 79591d82f157cd..3100f595bf9895 100644 --- a/packages/block-library/src/pullquote/style.scss +++ b/packages/block-library/src/pullquote/style.scss @@ -11,6 +11,10 @@ color: inherit; } + blockquote { + margin: 0; + } + &.alignleft, &.alignright { max-width: $content-width * 0.5; From e828e422e61a7163b6211980da3f4d67c5dba184 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 17 Nov 2022 22:26:40 +0900 Subject: [PATCH 2/3] Update padding styles --- packages/block-library/src/pullquote/block.json | 8 ++++++++ packages/block-library/src/pullquote/style.scss | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/pullquote/block.json b/packages/block-library/src/pullquote/block.json index 2cad2d2c034143..e669955a4ae2d5 100644 --- a/packages/block-library/src/pullquote/block.json +++ b/packages/block-library/src/pullquote/block.json @@ -70,6 +70,14 @@ "typography": { "fontSize": "1.5em", "lineHeight": "1.6" + }, + "spacing": { + "padding": { + "top": "4em", + "right": "0", + "bottom": "4em", + "left": "0" + } } } }, diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss index 3100f595bf9895..f64e831a68218e 100644 --- a/packages/block-library/src/pullquote/style.scss +++ b/packages/block-library/src/pullquote/style.scss @@ -1,6 +1,5 @@ .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. box-sizing: border-box; @@ -15,6 +14,14 @@ margin: 0; } + p { + margin-top: 0; + + &:last-child { + margin-bottom: 0; + } + } + &.alignleft, &.alignright { max-width: $content-width * 0.5; From dc689c49a25cc0edf4942ce6cbd6be4a13a926af Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Sat, 13 Jan 2024 15:50:23 +0900 Subject: [PATCH 3/3] Don't use __experimentalStyle --- packages/block-library/src/pullquote/block.json | 8 -------- packages/block-library/src/pullquote/style.scss | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/block-library/src/pullquote/block.json b/packages/block-library/src/pullquote/block.json index d01d548d9376fa..f041d46cda8cdd 100644 --- a/packages/block-library/src/pullquote/block.json +++ b/packages/block-library/src/pullquote/block.json @@ -68,14 +68,6 @@ "typography": { "fontSize": "1.5em", "lineHeight": "1.6" - }, - "spacing": { - "padding": { - "top": "4em", - "right": "0", - "bottom": "4em", - "left": "0" - } } } }, diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss index 9c117cce7b3cb6..b53dbf6561638c 100644 --- a/packages/block-library/src/pullquote/style.scss +++ b/packages/block-library/src/pullquote/style.scss @@ -1,4 +1,5 @@ .wp-block-pullquote { + 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;