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

Comments Pagination: Add border and spacing support #66470

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open
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 @@ -197,7 +197,7 @@ Displays a paginated navigation to next/previous set of comments, when applicabl
- **Category:** theme
- **Parent:** core/comments
- **Allowed Blocks:** core/comments-pagination-previous, core/comments-pagination-numbers, core/comments-pagination-next
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** paginationArrow

## Comments Next Page
Expand Down
20 changes: 18 additions & 2 deletions packages/block-library/src/comments-pagination/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"name": "core/comments-pagination",
"title": "Comments Pagination",
"category": "theme",
"parent": [ "core/comments" ],
"parent": [
"core/comments"
],
"allowedBlocks": [
"core/comments-pagination-previous",
"core/comments-pagination-numbers",
Expand Down Expand Up @@ -54,10 +56,24 @@
"fontSize": true
}
},
"spacing": {
"margin": true,
"padding": true,
"__experimentalDefaultControls": {
"padding": false,
"margin": false
}
},
"__experimentalBorder": {
"radius": true,
"color": true,
"width": true,
"style": true
},
"interactivity": {
"clientNavigation": true
}
},
"editorStyle": "wp-block-comments-pagination-editor",
"style": "wp-block-comments-pagination"
}
}
10 changes: 6 additions & 4 deletions packages/block-library/src/comments-pagination/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
$pagination-margin: 0.5em;
.wp-block-comments-pagination {
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;
// Increased specificity to override blocks default margin.
rinkalpagdar marked this conversation as resolved.
Show resolved Hide resolved
> .wp-block-comments-pagination-next,
> .wp-block-comments-pagination-previous,
Expand All @@ -18,18 +20,18 @@ $pagination-margin: 0.5em;
margin-right: 1ch;
display: inline-block; // Needed so that the transform works.
// chevron(`»`) symbol doesn't need the mirroring by us.
&:not(.is-arrow-chevron) {
&:not( .is-arrow-chevron ) {
// Flip for RTL.
transform: scaleX(1) #{"/*rtl:scaleX(-1);*/"}; // This points the arrow right for LTR and left for RTL.
transform: scaleX( 1 ) #{'/*rtl:scaleX(-1);*/'}; // This points the arrow right for LTR and left for RTL.
}
}
.wp-block-comments-pagination-next-arrow {
margin-left: 1ch;
display: inline-block; // Needed so that the transform works.
// chevron(`»`) symbol doesn't need the mirroring by us.
&:not(.is-arrow-chevron) {
&:not( .is-arrow-chevron ) {
// Flip for RTL.
transform: scaleX(1) #{"/*rtl:scaleX(-1);*/"}; // This points the arrow right for LTR and left for RTL.
transform: scaleX( 1 ) #{'/*rtl:scaleX(-1);*/'}; // This points the arrow right for LTR and left for RTL.
}
}

Expand Down
Loading