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 12 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
18 changes: 9 additions & 9 deletions 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 Expand Up @@ -60,7 +60,7 @@ Prompt visitors to take action with a group of button-style links. ([Source](htt
- **Name:** core/buttons
- **Category:** design
- **Supports:** align (full, wide), anchor, spacing (blockGap, margin)
- **Attributes:**
- **Attributes:**

## Calendar

Expand Down Expand Up @@ -168,7 +168,7 @@ Contains the block elements used to display a comment, like the title, date, aut
- **Name:** core/comment-template
- **Category:** design
- **Supports:** align, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:**

## Comments

Expand Down Expand Up @@ -204,7 +204,7 @@ Displays a list of page numbers for comments pagination. ([Source](https://githu
- **Name:** core/comments-pagination-numbers
- **Category:** theme
- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:**

## Previous Page

Expand Down Expand Up @@ -420,7 +420,7 @@ Separate your content into a multi-page experience. ([Source](https://github.com
- **Name:** core/nextpage
- **Category:** design
- **Supports:** ~~className~~, ~~customClassName~~, ~~html~~
- **Attributes:**
- **Attributes:**

## Page List

Expand Down Expand Up @@ -519,7 +519,7 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/
- **Name:** core/post-content
- **Category:** theme
- **Supports:** align (full, wide), ~~html~~
- **Attributes:**
- **Attributes:**

## Post Date

Expand Down Expand Up @@ -564,7 +564,7 @@ Contains the block elements used to render a post, like the title, date, feature
- **Name:** core/post-template
- **Category:** theme
- **Supports:** align, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:**

## Post Terms

Expand Down Expand Up @@ -618,7 +618,7 @@ Contains the block elements used to render content when no query results are fou
- **Name:** core/query-no-results
- **Category:** theme
- **Supports:** align, color (background, gradients, link, text), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:**

## Pagination

Expand All @@ -645,7 +645,7 @@ Displays a list of page numbers for pagination ([Source](https://github.com/Word
- **Name:** core/query-pagination-numbers
- **Category:** theme
- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:**

## Previous Page

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
2 changes: 2 additions & 0 deletions packages/block-library/src/avatar/style.scss
@@ -1,4 +1,6 @@
.wp-block-avatar {
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