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

Comment pagination blocks: Add spacing support #43905

Closed
wants to merge 15 commits into from
Closed
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
8 changes: 4 additions & 4 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Displays a paginated navigation to next/previous set of comments, when applicabl
- **Name:** core/comments-pagination
- **Category:** theme
- **Parent:** core/comments
- **Supports:** align, color (background, gradients, link, text), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** align, color (background, gradients, link, text), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** paginationArrow

## Comments Next Page
Expand All @@ -201,7 +201,7 @@ Displays the next comment's page link. ([Source](https://github.com/WordPress/gu
- **Name:** core/comments-pagination-next
- **Category:** theme
- **Parent:** core/comments-pagination
- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** color (background, gradients, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** label

## Comments Page Numbers
Expand All @@ -211,7 +211,7 @@ Displays a list of page numbers for comments pagination. ([Source](https://githu
- **Name:** core/comments-pagination-numbers
- **Category:** theme
- **Parent:** core/comments-pagination
- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** color (background, gradients, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Comments Previous Page
Expand All @@ -221,7 +221,7 @@ Displays the previous comment's page link. ([Source](https://github.com/WordPres
- **Name:** core/comments-pagination-previous
- **Category:** theme
- **Parent:** core/comments-pagination
- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** color (background, gradients, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** label

## Comments Title
Expand Down
12 changes: 12 additions & 0 deletions packages/block-library/src/comments-pagination-next/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"background": true
}
},
"spacing": {
"margin": true,
"padding": true
},
"__experimentalStyle": {
"spacing": {
"margin": {
"right": "0.5em",
"bottom": "0.5em"
}
}
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
"supports": {
"reusable": false,
"html": false,
"spacing": {
"margin": true,
"padding": true
},
"__experimentalStyle": {
"spacing": {
"margin": {
"right": "0.5em",
"bottom": "0.5em"
}
}
},
"color": {
"gradients": true,
"text": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"background": true
}
},
"spacing": {
"margin": true,
"padding": true
},
"__experimentalStyle": {
"spacing": {
"margin": {
"right": "0.5em",
"bottom": "0.5em"
}
}
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/comments-pagination/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"type": "flex"
}
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
24 changes: 0 additions & 24 deletions packages/block-library/src/comments-pagination/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
$pagination-margin: 0.5em;

// Center flex items. This has an equivalent in style.scss.
.wp-block[data-align="center"] > .wp-block-comments-pagination {
justify-content: center;
Expand All @@ -8,27 +6,5 @@ $pagination-margin: 0.5em;
.editor-styles-wrapper {
.wp-block-comments-pagination {
max-width: 100%;
&.block-editor-block-list__layout {
margin: 0;
}
}
}

.wp-block-comments-pagination {
> .wp-block-comments-pagination-next,
> .wp-block-comments-pagination-previous,
> .wp-block-comments-pagination-numbers {
// Override editor auto block margins.
margin-left: 0;
margin-top: $pagination-margin;

/*rtl:ignore*/
margin-right: $pagination-margin;
margin-bottom: $pagination-margin;

&:last-child {
/*rtl:ignore*/
margin-right: 0;
}
}
}
4 changes: 0 additions & 4 deletions packages/block-library/src/comments-pagination/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ $pagination-margin: 0.5em;
> .wp-block-comments-pagination-next,
> .wp-block-comments-pagination-previous,
> .wp-block-comments-pagination-numbers {
/*rtl:ignore*/
margin-right: $pagination-margin;
margin-bottom: $pagination-margin;

&:last-child {
/*rtl:ignore*/
margin-right: 0;
Expand Down