From 17ea920be4ae119a5828ae827f4528c30b92082e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 8 Jan 2018 15:48:25 +0000 Subject: [PATCH] Update previous/next navigation to match GOV.UK The pagination pattern on GOV.UK changed in: https://github.com/alphagov/static/pull/1051 We should update ours to match because: - consistency - the new icons looks better --- .../vendor/previous-next-navigation.scss | 116 ++++++++---------- .../components/previous-next-navigation.html | 14 ++- 2 files changed, 62 insertions(+), 68 deletions(-) diff --git a/app/assets/stylesheets/components/vendor/previous-next-navigation.scss b/app/assets/stylesheets/components/vendor/previous-next-navigation.scss index a1cf5e0ea..5f8f9f4d9 100644 --- a/app/assets/stylesheets/components/vendor/previous-next-navigation.scss +++ b/app/assets/stylesheets/components/vendor/previous-next-navigation.scss @@ -1,6 +1,6 @@ /* Taken from the GOV.UK component at -https://github.com/alphagov/static/blob/a9d462e71709d2ff6348bcce7e8c625af2b86114/app/assets/stylesheets/govuk-component/_previous-and-next-navigation.scss +https://github.com/alphagov/static/blob/3d93a762b9d7af54615c77ae3e479131c03b8175/app/assets/stylesheets/govuk-component/_previous-and-next-navigation.scss and https://github.com/alphagov/static/blob/da8aeeaa749093eab30286d7fc9f965533b66f47/app/assets/stylesheets/styleguide/_conditionals2.scss */ @@ -31,12 +31,11 @@ $is-ie: false !default; } .govuk-previous-and-next-navigation { - - @include media-down(mobile) { - margin: 2em 0 0 0; - } - display: block; + margin-top: $gutter; + margin-bottom: $gutter; + margin-left: -$gutter-half; + margin-right: -$gutter-half; ul { margin: 0; @@ -50,18 +49,17 @@ $is-ie: false !default; text-align: right; margin: 0; padding: 0; - width: 49%; + width: 50%; a { - - @include ie-lte(7) { - height: 4.5em; - } - display: block; - color: $link-colour; + padding: $gutter-half; text-decoration: none; + &:visited { + color: $link-colour; + } + &:hover, &:active { background-color: $canvas-colour; @@ -69,61 +67,47 @@ $is-ie: false !default; .pagination-part-title { @include core-27($line-height: (33.75 / 27)); - margin-bottom: 0.1em; display: block; } - - } - - &.next-page { - float: right; - text-align: right; - } - - &.next-page a:before { - background: transparent file-url("arrow-sprite.png") no-repeat -102px -11px; - margin: -4px -32px 0 0; - display: block; - float: right; - width: 30px; - height: 38px; - content: " "; - } - - &.previous-page a:before { - background: transparent file-url("arrow-sprite.png") no-repeat -20px -11px; - margin: -4px 0 0 -32px; - display: block; - float: left; - width: 30px; - height: 38px; - content: " "; - } - - &.previous-page { - float: left; - text-align: left; - } - - &.previous-page a { - padding: 0.75em 0 0.75em 3em; - } - - &.next-page a { - padding: 0.75em 3em 0.75em 0; - } - - @include media-down(mobile) { - &.previous-page, - &.next-page { - float: none; - width: 100%; - } - - &.next-page a { - text-align: right; - } } } -} \ No newline at end of file + .previous-page { + float: left; + text-align: left; + } + + .next-page { + float: right; + text-align: right; + } + + @include media-down(mobile) { + .previous-page, + .next-page { + float: none; + width: 100%; + } + + .next-page a { + text-align: right; + } + } + + .pagination-icon { + display: inline-block; + margin-bottom: 1px; + height: .482em; + width: .63em; + } + + .pagination-label { + display: inline-block; + margin-top: 0.1em; + text-decoration: underline; + + &:empty { + display: none; + } + } +} diff --git a/app/templates/components/previous-next-navigation.html b/app/templates/components/previous-next-navigation.html index 525555396..e7102d4a0 100644 --- a/app/templates/components/previous-next-navigation.html +++ b/app/templates/components/previous-next-navigation.html @@ -4,7 +4,12 @@ {% if previous_page %}
  • - {{previous_page['title']}} + + + + + {{previous_page['title']}} + {{previous_page['label']}}
  • @@ -12,7 +17,12 @@ {% if next_page %}