Commit c60b9fd1 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Robert Knight

Add responsive layout for pagination controls

parent 9078637e
@use '../../mixins/buttons'; @use '../../mixins/buttons';
@use "../../mixins/layout"; @use "../../mixins/layout";
@use "../../mixins/responsive";
@use "../../mixins/utils"; @use "../../mixins/utils";
@use "../../variables" as var; @use "../../variables" as var;
.PaginationNavigation { .PaginationNavigation {
@include utils.font--large; @include utils.font--large;
// Lay out page navigation buttons horizontally as:
// | prevPage | numberedPages | nextPage
//
// e.g.
// | [<- prev] | [2] ... [5] [6] [7] ... [10] | [next ->] |
display: grid; display: grid;
grid-template-columns: 8em auto 8em;
align-items: center; align-items: center;
grid-template-areas: 'prevPage numberedPages nextPage'; grid-template-areas: 'prevPage nextPage';
&__prev { &__prev {
grid-area: prevPage; grid-area: prevPage;
...@@ -26,8 +21,9 @@ ...@@ -26,8 +21,9 @@
} }
&__pages { &__pages {
grid-area: numberedPages; // On narrower viewports, there isn't enough room to display all of
@include layout.row($justify: center, $align: center); // the numbered page buttons; fall back to just prev and next options
display: none;
} }
&__button, &__button,
...@@ -54,4 +50,21 @@ ...@@ -54,4 +50,21 @@
} }
padding-right: var.$layout-space--xxsmall; padding-right: var.$layout-space--xxsmall;
} }
@include responsive.wide-handheld-and-up {
// Where there's enough horizontal space,
// lay out page navigation buttons horizontally as:
// | prevPage | numberedPages | nextPage
//
// e.g.
// | [<- prev] | [2] ... [5] [6] [7] ... [10] | [next ->] |
grid-template-columns: 8em auto 8em;
grid-template-areas: 'prevPage numberedPages nextPage';
&__pages {
display: block;
grid-area: numberedPages;
@include layout.row($justify: center, $align: center);
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment