Skip to content

Commit

Permalink
Query Pagination: Correctly position the "next" link on the first pag…
Browse files Browse the repository at this point in the history
…e. (#42764)

* Move the next link to the right when it's the only one displayed

* add explanatory comment

* use margin-inline-start for RTL

* Add margin-inline-end to the previous link

* restrict CSS to first and last children
  • Loading branch information
scruffian authored Aug 2, 2022
1 parent dcbcbfb commit 784b331
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/block-library/src/query-pagination/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ $pagination-margin: 0.5em;
margin-right: 0;
}
}

// This moves the next link to the right side of the container,
// which is important when it's the only block displayed
// and the block has a "space-between" justification.
&.is-content-justification-space-between {
> .wp-block-query-pagination-next:last-child {
margin-inline-start: auto;
}
> .wp-block-query-pagination-previous:first-child {
margin-inline-end: auto;
}
}


.wp-block-query-pagination-previous-arrow {
margin-right: 1ch;
display: inline-block; // Needed so that the transform works.
Expand Down

0 comments on commit 784b331

Please sign in to comment.