Commit 22677587 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Refactor pagination-control layout (use CSS-grid)

parent 8b774bd0
...@@ -5,22 +5,29 @@ ...@@ -5,22 +5,29 @@
.PaginationNavigation { .PaginationNavigation {
@include utils.font--large; @include utils.font--large;
@include layout.row;
&__relative { // Lay out page navigation buttons horizontally as:
// Set a minimum width for the previous and next button containers so that // | prevPage | numberedPages | nextPage
// there is no jumping around as they appear and disappear. //
min-width: 5em; // e.g.
// | [<- prev] | [2] ... [5] [6] [7] ... [10] | [next ->] |
display: grid;
grid-template-columns: 8em auto 8em;
align-items: center;
grid-template-areas: 'prevPage numberedPages nextPage';
&__prev {
grid-area: prevPage;
} }
&__next { &__next {
// Make sure "next" button is flush right grid-area: nextPage;
@include layout.row($justify: flex-end); justify-self: end;
} }
&__pages { &__pages {
grid-area: numberedPages;
@include layout.row($justify: center, $align: center); @include layout.row($justify: center, $align: center);
flex-grow: 1;
} }
&__button, &__button,
...@@ -34,17 +41,17 @@ ...@@ -34,17 +41,17 @@
&__page-button { &__page-button {
margin: var.$layout-space--xxsmall; margin: var.$layout-space--xxsmall;
padding: var.$layout-space--small var.$layout-space; padding: var.$layout-space--small var.$layout-space;
&[aria-pressed='true'] {
background-color: var.$grey-3;
}
} }
&__button-right { &__button-right {
// TODO TEMPORARY adjustment until we can adjust the actual icon // FIXME Button SVG margins assume that the icon is on the left
svg { svg {
margin-left: var.$layout-space--xxsmall; margin-left: var.$layout-space--xxsmall;
} }
padding-right: var.$layout-space--xxsmall; padding-right: var.$layout-space--xxsmall;
} }
&__page-button[aria-pressed='true'] {
background-color: var.$grey-3;
}
} }
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