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

Add color support to the quote block #39899

Merged
merged 2 commits into from
Apr 1, 2022
Merged
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
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Ju

- **Name:** core/quote
- **Category:** text
- **Supports:** anchor, typography (fontSize, lineHeight)
- **Supports:** anchor, color (background, gradients, link, text), typography (fontSize, lineHeight)
- **Attributes:** align, citation, value

## Read More
Expand Down
8 changes: 8 additions & 0 deletions packages/block-library/src/quote/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
"fontSize": true,
"fontAppearance": true
}
},
"color": {
"gradients": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
"text": true
}
}
},
"styles": [
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/quote/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.wp-block-quote {
box-sizing: border-box;
Copy link
Contributor Author

@youknowriad youknowriad Mar 30, 2022

Choose a reason for hiding this comment

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

Applying box-sizing: border-box to the quote block might have a small impact on the themes frontend. But I expect that most themes already do this somehow, if not, this might fix some bugs if they add paddings to quotes... But it's still an impactful change we need to check.

(Similar to #39895 for lists)

Copy link
Contributor

Choose a reason for hiding this comment

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

CC: @ramonjd @scruffian

I wonder if we should re-apply this in the vanilla stylesheet. We recently removed an editor-only style so at least the frontend and backend were consistent, but without this rule applied, border rules are kind of terrible across all blocks. We can apply it one by one to every block that gets border support, but maybe this is a reason to add it in a blanket form again?

overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
// .is-style-large and .is-large are kept for backwards compatibility. The :not pseudo-class is used to enable switching styles. See PR #37580.
&.is-style-large:not(.is-style-plain),
Expand Down