|
3 | 3 | @use "../../core/settings" as *;
|
4 | 4 | @use "../../core/tools" as *;
|
5 | 5 |
|
| 6 | +$_header-item-padding: 12px; |
| 7 | + |
6 | 8 | ////
|
7 | 9 | /// Header component
|
8 | 10 | ///
|
|
85 | 87 | /// Account
|
86 | 88 |
|
87 | 89 | .nhsuk-header__account {
|
88 |
| - background: nhsuk-shade($color_nhsuk-blue, 20%); |
| 90 | + position: relative; |
89 | 91 | border-radius: $nhsuk-border-radius;
|
90 | 92 | flex-grow: 1;
|
91 |
| - outline: 1px solid nhsuk-shade($color_nhsuk-blue, 20%); |
92 | 93 | margin-bottom: 1px;
|
93 | 94 |
|
94 |
| - @include nhsuk-media-query($from: tablet) { |
95 |
| - align-self: start; |
96 |
| - } |
97 |
| - |
98 | 95 | .nhsuk-icon__user {
|
99 | 96 | height: 24px;
|
100 | 97 | width: 24px;
|
101 | 98 | flex-shrink: 0;
|
102 | 99 | }
|
| 100 | + |
| 101 | + &, |
| 102 | + &::before { |
| 103 | + background-color: nhsuk-shade($color_nhsuk-blue, 20%); |
| 104 | + } |
| 105 | + |
| 106 | + // Expand header account by 1px to ensure the search |
| 107 | + // input does not appear to be taller when inline |
| 108 | + &::before { |
| 109 | + content: ""; |
| 110 | + display: block; |
| 111 | + position: absolute; |
| 112 | + top: -1px; |
| 113 | + right: 0; |
| 114 | + bottom: -1px; |
| 115 | + left: 0; |
| 116 | + border: 1px solid nhsuk-shade($color_nhsuk-blue, 20%); |
| 117 | + border-radius: $nhsuk-border-radius + 1px; |
| 118 | + } |
| 119 | + |
| 120 | + @include nhsuk-media-query($from: tablet) { |
| 121 | + align-self: start; |
| 122 | + } |
103 | 123 | }
|
104 | 124 |
|
105 | 125 | .nhsuk-header__account-list {
|
| 126 | + position: relative; |
| 127 | + z-index: 1; |
106 | 128 | display: flex;
|
107 | 129 | flex-wrap: wrap;
|
108 | 130 | gap: 1px;
|
|
113 | 135 | }
|
114 | 136 |
|
115 | 137 | .nhsuk-header__account-item {
|
116 |
| - background-color: nhsuk-shade($color_nhsuk-blue, 20%); |
117 | 138 | display: flex;
|
118 | 139 | flex-grow: 1;
|
119 | 140 | gap: nhsuk-spacing(2);
|
120 | 141 | margin: 0;
|
121 | 142 | outline: 1px solid $color_nhsuk-blue;
|
122 | 143 | overflow-wrap: anywhere;
|
123 |
| - padding: nhsuk-spacing(2) 12px; |
| 144 | + padding: nhsuk-spacing(2) $_header-item-padding; |
124 | 145 | @include nhsuk-font(16);
|
125 | 146 |
|
126 | 147 | &:nth-last-child(2) {
|
|
159 | 180 | flex-grow: 1;
|
160 | 181 | position: relative;
|
161 | 182 | z-index: 13;
|
| 183 | + |
162 | 184 | @include nhsuk-print-hide;
|
163 | 185 |
|
164 | 186 | .nhsuk-icon__search {
|
165 | 187 | height: 28px;
|
166 | 188 | width: 28px;
|
| 189 | + |
| 190 | + // Adjust optical alignment due to the handle appearing |
| 191 | + // to push the magnifying glass circle to the top left |
| 192 | + margin: 0 -2px -2px 0; |
167 | 193 | }
|
168 | 194 | }
|
169 | 195 |
|
170 | 196 | .nhsuk-header__search-form {
|
171 | 197 | display: flex;
|
172 | 198 | height: 100%;
|
173 | 199 | overflow: visible;
|
174 |
| - |
175 |
| - @include nhsuk-media-query($until: tablet) { |
176 |
| - position: relative; |
177 |
| - } |
178 | 200 | }
|
179 | 201 |
|
180 |
| -.nhsuk-header__search-input { |
181 |
| - border: 1px solid $color_nhsuk-white; |
| 202 | +// 1. Disable default search input appearance |
| 203 | +.nhsuk-header__search-input.nhsuk-input { |
| 204 | + border-color: transparent; |
182 | 205 | border-radius: $nhsuk-border-radius 0 0 $nhsuk-border-radius;
|
183 |
| - font-size: $nhsuk-base-font-size; |
184 | 206 | height: 40px;
|
185 |
| - padding: 0 12px; |
| 207 | + margin-right: -$nhsuk-border-width-form-element; |
| 208 | + padding-right: $_header-item-padding; |
| 209 | + padding-left: $_header-item-padding - $nhsuk-border-width-form-element; |
186 | 210 | width: 100%;
|
| 211 | + @include nhsuk-font-size(16); |
187 | 212 |
|
188 | 213 | &:focus {
|
189 |
| - border: nhsuk-spacing(1) solid $nhsuk-focus-text-color; |
190 |
| - box-shadow: 0 0 0 $nhsuk-focus-width $nhsuk-focus-color; |
191 |
| - outline: $nhsuk-focus-width solid transparent; |
192 |
| - outline-offset: $nhsuk-focus-width; |
193 |
| - padding: 0 9px; |
| 214 | + z-index: 10; |
194 | 215 | }
|
195 | 216 |
|
196 | 217 | &::placeholder {
|
197 | 218 | color: $color_nhsuk-grey-1;
|
198 | 219 | opacity: 1; // Fixes low contrast of placeholder text in firefox
|
199 | 220 | }
|
200 | 221 |
|
| 222 | + // Hide search input clear button (IE) |
| 223 | + &::-ms-clear { |
| 224 | + display: none; |
| 225 | + } |
| 226 | + |
| 227 | + // Hide search input icon and cancel button (WebKit, Blink) |
| 228 | + &::-webkit-search-decoration, |
| 229 | + &::-webkit-search-cancel-button { |
| 230 | + appearance: none; |
| 231 | + } |
| 232 | + |
201 | 233 | @include nhsuk-media-query($until: tablet) {
|
202 |
| - border-radius: $nhsuk-border-radius; |
| 234 | + font-size: inherit; |
203 | 235 | }
|
204 | 236 | }
|
205 | 237 |
|
|
208 | 240 | border: 0;
|
209 | 241 | border-radius: 0 $nhsuk-border-radius $nhsuk-border-radius 0;
|
210 | 242 | color: $color_nhsuk-blue;
|
| 243 | + flex-shrink: 0; |
211 | 244 | height: nhsuk-spacing(6);
|
212 | 245 | line-height: 1;
|
213 |
| - outline: none; |
214 | 246 | margin: 0;
|
215 | 247 | width: 44px;
|
216 |
| - |
217 |
| - @include nhsuk-media-query($until: tablet) { |
218 |
| - position: absolute; |
219 |
| - right: 0; |
220 |
| - top: 0; |
221 |
| - z-index: 9; |
222 |
| - } |
| 248 | + z-index: 9; |
223 | 249 |
|
224 | 250 | &:hover {
|
225 | 251 | background-color: $color_shade_nhsuk-blue-35;
|
|
235 | 261 | &:focus {
|
236 | 262 | background-color: $nhsuk-focus-color;
|
237 | 263 | box-shadow: inset 0 -4px 0 0 $nhsuk-focus-text-color;
|
| 264 | + |
238 | 265 | @include nhsuk-focused-button;
|
239 | 266 | }
|
240 | 267 | }
|
|
447 | 474 | }
|
448 | 475 |
|
449 | 476 | .nhsuk-header__account,
|
450 |
| - .nhsuk-header__account-item { |
| 477 | + .nhsuk-header__account::before { |
451 | 478 | background-color: $color_nhsuk-grey-5;
|
| 479 | + } |
| 480 | + |
| 481 | + .nhsuk-header__account::before { |
| 482 | + border-color: $color_nhsuk-grey-4; |
| 483 | + } |
| 484 | + |
| 485 | + .nhsuk-header__account-item { |
452 | 486 | outline-color: $color_nhsuk-grey-4;
|
453 | 487 | }
|
454 | 488 |
|
455 | 489 | .nhsuk-header__account-link {
|
456 | 490 | @include nhsuk-link-style-no-visited-state;
|
457 | 491 | }
|
458 | 492 |
|
459 |
| - .nhsuk-header__search-input { |
| 493 | + .nhsuk-header__search-input.nhsuk-input { |
460 | 494 | border-color: $color_nhsuk-grey-3;
|
| 495 | + border-width: 1px; |
| 496 | + margin-right: -1px; |
461 | 497 |
|
462 | 498 | &:focus {
|
463 | 499 | border-color: $nhsuk-focus-text-color;
|
| 500 | + border-width: 2px; |
| 501 | + margin-right: -2px; |
464 | 502 | }
|
465 | 503 | }
|
466 | 504 |
|
|
513 | 551 | }
|
514 | 552 |
|
515 | 553 | .nhsuk-header__navigation-container {
|
516 |
| - border-top-color: $color_nhsuk-grey-5; |
| 554 | + border-color: $color_nhsuk-grey-4; |
517 | 555 | border-top-width: 1px;
|
518 | 556 | }
|
519 | 557 |
|
|
0 commit comments