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

Avatar: add padding support #43519

Merged
merged 18 commits into from Sep 6, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Expand Up @@ -32,7 +32,7 @@ Add a user's avatar. ([Source](https://github.com/WordPress/gutenberg/tree/trunk

- **Name:** core/avatar
- **Category:** theme
- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin), ~~alignWide~~, ~~html~~
- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~
- **Attributes:** isLink, linkTarget, size, userId

## Reusable block
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/avatar/block.json
Expand Up @@ -29,7 +29,8 @@
"align": true,
"alignWide": false,
"spacing": {
"margin": true
"margin": true,
"padding": true
},
"__experimentalBorder": {
"__experimentalSkipSerialization": true,
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/avatar/style.scss
@@ -1,4 +1,7 @@
.wp-block-avatar {
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;
Copy link
Member

Choose a reason for hiding this comment

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

This is a small nit, but can you add the comment

// This block has customizable padding, border-box makes that more predictable.

This keeps the implementation consistent with other blocks and makes it easy to understand why this has been added. Otherwise, this PR looks good to go.

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, nothing too small, and thanks for the nitpicking! I addressed the missing comment. 👍


&.aligncenter {
text-align: center;
}
Expand Down