|
| 1 | +/* ========================================================================== |
| 2 | + COMPONENTS / #PAGINATION |
| 3 | + ========================================================================== */ |
| 4 | + |
| 5 | +/** |
| 6 | + * 1. Padding to give the icon spacing. |
| 7 | + * 2. Append the word 'page' after next and |
| 8 | + * previous on print stylesheets to make it easier |
| 9 | + * to understand in print context. |
| 10 | + */ |
| 11 | + |
| 12 | +// Previous and next pages variant |
| 13 | +.nhsuk-pagination { |
| 14 | + @include nhsuk-responsive-margin(7, "top"); |
| 15 | + @include nhsuk-responsive-margin(7, "bottom"); |
| 16 | +} |
| 17 | + |
| 18 | +.nhsuk-pagination__list { |
| 19 | + @include clearfix(); |
| 20 | +} |
| 21 | + |
| 22 | +.nhsuk-pagination-item--previous { |
| 23 | + float: left; |
| 24 | + text-align: left; |
| 25 | + width: 50%; |
| 26 | + |
| 27 | + .nhsuk-icon { |
| 28 | + left: -6px; |
| 29 | + } |
| 30 | + |
| 31 | + .nhsuk-pagination__title { |
| 32 | + padding-left: nhsuk-spacing(5); /* [1] */ |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +.nhsuk-pagination-item--next { |
| 37 | + float: right; |
| 38 | + text-align: right; |
| 39 | + width: 50%; |
| 40 | + |
| 41 | + .nhsuk-icon { |
| 42 | + right: -6px; |
| 43 | + } |
| 44 | + |
| 45 | + .nhsuk-pagination__title { |
| 46 | + padding-right: nhsuk-spacing(5); /* [1] */ |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +.nhsuk-pagination__link { |
| 51 | + display: block; |
| 52 | + position: relative; |
| 53 | + text-decoration: none; |
| 54 | + width: 100%; |
| 55 | + |
| 56 | + @include mq($media-type: print) { |
| 57 | + color: $color_nhsuk-black; |
| 58 | + } |
| 59 | + |
| 60 | + .nhsuk-icon { |
| 61 | + position: absolute; |
| 62 | + top: -2px; |
| 63 | + |
| 64 | + @include mq($media-type: print) { |
| 65 | + color: $color_nhsuk-black; |
| 66 | + margin-top: 0; |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + &:hover { |
| 71 | + color: $nhsuk-link-hover-color; |
| 72 | + |
| 73 | + .nhsuk-icon { |
| 74 | + fill: $nhsuk-link-hover-color; |
| 75 | + } |
| 76 | + |
| 77 | + .nhsuk-pagination__page { |
| 78 | + text-decoration: none; |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + &:focus { |
| 83 | + @include nhsuk-focused-text; |
| 84 | + |
| 85 | + .nhsuk-pagination__page { |
| 86 | + text-decoration: none; |
| 87 | + } |
| 88 | + |
| 89 | + &:visited, |
| 90 | + &:hover, |
| 91 | + &:active { |
| 92 | + .nhsuk-icon { |
| 93 | + fill: $nhsuk-focus-text-color; |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + &:visited { |
| 99 | + .nhsuk-icon { |
| 100 | + fill: $nhsuk-link-visited-color; |
| 101 | + } |
| 102 | + |
| 103 | + &:hover { |
| 104 | + .nhsuk-icon { |
| 105 | + fill: $nhsuk-link-hover-color; |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + &:focus { |
| 110 | + .nhsuk-icon { |
| 111 | + fill: $nhsuk-focus-text-color; |
| 112 | + } |
| 113 | + } |
| 114 | + } |
| 115 | +} |
| 116 | + |
| 117 | +.nhsuk-pagination__title { |
| 118 | + @include nhsuk-typography-responsive(24); |
| 119 | + |
| 120 | + display: block; |
| 121 | + |
| 122 | + @include mq($media-type: print) { |
| 123 | + &:after { |
| 124 | + content: " page"; /* [2] */ |
| 125 | + } |
| 126 | + } |
| 127 | +} |
| 128 | + |
| 129 | +.nhsuk-pagination__page { |
| 130 | + @include nhsuk-typography-responsive(16); |
| 131 | + |
| 132 | + display: block; |
| 133 | + text-decoration: underline; |
| 134 | +} |
| 135 | + |
| 136 | +// Numbered pages variant |
| 137 | +.nhsuk-pagination--numbered { |
| 138 | + @include clearfix(); |
| 139 | +} |
| 140 | + |
| 141 | +// In a numbered list, the previous link, numbered page links, |
| 142 | +// and next link should all line up |
| 143 | +.nhsuk-pagination--numbered__prev, |
| 144 | +.nhsuk-pagination--numbered__next, |
| 145 | +.nhsuk-pagination--numbered__item { |
| 146 | + @include nhsuk-font(19); |
| 147 | + box-sizing: border-box; |
| 148 | + position: relative; |
| 149 | + min-width: 45px; |
| 150 | + min-height: 45px; |
| 151 | + padding: nhsuk-spacing(2) nhsuk-spacing(2); |
| 152 | + text-align: center; |
| 153 | + margin: 0; |
| 154 | + float: left; |
| 155 | +} |
| 156 | + |
| 157 | +.nhsuk-pagination--numbered__link:visited:hover, |
| 158 | +.nhsuk-pagination--numbered__item a:hover { |
| 159 | + color: $nhsuk-link-hover-color; |
| 160 | +} |
| 161 | + |
| 162 | +.nhsuk-pagination--numbered__prev:hover, |
| 163 | +.nhsuk-pagination--numbered__next:hover, |
| 164 | +.nhsuk-pagination--numbered__item:hover { |
| 165 | + background-color: $color_nhsuk-grey-4; |
| 166 | + color: $color_nhsuk-blue; |
| 167 | +} |
| 168 | + |
| 169 | +// Container for the list of numbered items |
| 170 | +.nhsuk-pagination__list--numbered { |
| 171 | + margin: 0; |
| 172 | + padding: 0; |
| 173 | + list-style: none; |
| 174 | +} |
| 175 | + |
| 176 | +// Current number |
| 177 | +.nhsuk-pagination--numbered__item--current, |
| 178 | +.nhsuk-pagination--numbered__item--current:hover { |
| 179 | + background-color: $color_nhsuk-blue; |
| 180 | + font-weight: $nhsuk-font-bold; |
| 181 | + |
| 182 | + .nhsuk-pagination--numbered__link { |
| 183 | + color: $color_nhsuk-white; |
| 184 | + } |
| 185 | + |
| 186 | + .nhsuk-pagination--numbered__link:focus { |
| 187 | + color: $color_nhsuk-black; |
| 188 | + } |
| 189 | +} |
| 190 | + |
| 191 | +.nhsuk-pagination--numbered__item--ellipses { |
| 192 | + font-weight: $nhsuk-font-bold; |
| 193 | + color: $nhsuk-secondary-text-color; |
| 194 | + |
| 195 | + &:hover { |
| 196 | + background-color: transparent; |
| 197 | + } |
| 198 | +} |
| 199 | + |
| 200 | +.nhsuk-pagination--numbered__link { |
| 201 | + min-width: nhsuk-spacing(3); |
| 202 | + vertical-align: middle; |
| 203 | + color: $color_nhsuk-blue; |
| 204 | + |
| 205 | + // Increase the touch area for the link to the parent element. |
| 206 | + @media screen { |
| 207 | + &::after { |
| 208 | + content: ""; |
| 209 | + position: absolute; |
| 210 | + top: 0; |
| 211 | + right: 0; |
| 212 | + bottom: 0; |
| 213 | + left: 0; |
| 214 | + } |
| 215 | + } |
| 216 | +} |
| 217 | + |
| 218 | +.nhsuk-pagination--numbered .nhsuk-icon { |
| 219 | + margin-top: 0; |
| 220 | + margin-bottom: -12px; |
| 221 | + fill: $color_nhsuk-blue; |
| 222 | +} |
| 223 | + |
| 224 | +.nhsuk-pagination--numbered__link:visited .nhsuk-icon { |
| 225 | + fill: $nhsuk-link-visited-color; |
| 226 | +} |
| 227 | + |
| 228 | +.nhsuk-pagination--numbered__link:hover .nhsuk-icon { |
| 229 | + fill: $nhsuk-link-hover-color; |
| 230 | +} |
| 231 | + |
| 232 | +.nhsuk-pagination--numbered .nhsuk-icon__arrow-left { |
| 233 | + margin-left: -13px; |
| 234 | + margin-right: nhsuk-spacing(2); |
| 235 | +} |
| 236 | + |
| 237 | +.nhsuk-pagination--numbered .nhsuk-icon__arrow-right { |
| 238 | + margin-left: nhsuk-spacing(2); |
| 239 | + margin-right: -13px; |
| 240 | +} |
0 commit comments