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

Post Terms: Add spacing support #43646

Merged
merged 2 commits into from
Sep 28, 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 @@ -572,7 +572,7 @@ Post terms. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages

- **Name:** core/post-terms
- **Category:** theme
- **Supports:** color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~
- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** prefix, separator, suffix, term, textAlign

## Post Title
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/post-terms/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"link": true
}
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
9 changes: 7 additions & 2 deletions packages/block-library/src/post-terms/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.wp-block-post-terms__separator {
white-space: pre-wrap;
.wp-block-post-terms {
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;
Comment on lines +2 to +3
Copy link
Contributor

Choose a reason for hiding this comment

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

This rule is currently only targeting the separator, so it looks like we need to add a separate rule to target the wrapper classname 🙂

image

E.g.

.wp-block-post-terms {
	// This block has customizable padding, border-box makes that more predictable.
	box-sizing: border-box;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, my sloppy mistake. I will correct that.


.wp-block-post-terms__separator {
white-space: pre-wrap;
}
}