|
1 | 1 | @use "../../base"; |
| 2 | +@use "../generic-header/mixin" as genericHeader; |
2 | 3 |
|
3 | 4 | /// @access private |
4 | 5 | @mixin styles { |
5 | 6 | $logo-bottom-margin: 2px; |
6 | 7 |
|
7 | 8 | .govuk-header { |
8 | | - @include base.govuk-font($size: 16, $line-height: 1); |
9 | | - |
10 | | - // Add a transparent bottom border for forced-colour modes |
11 | | - border-bottom: 1px solid transparent; |
12 | | - color: base.govuk-colour("white"); |
13 | | - background: base.govuk-functional-colour(brand); |
| 9 | + @include genericHeader.header-styles($background: base.govuk-functional-colour("brand")); |
14 | 10 | } |
15 | 11 |
|
16 | 12 | .govuk-header__container--full-width { |
17 | 13 | padding: 0 base.govuk-spacing(3); |
18 | 14 | } |
19 | 15 |
|
20 | 16 | .govuk-header__logo { |
21 | | - box-sizing: border-box; |
22 | | - |
23 | 17 | // Magic numbers, set padding to vertically centre align the logo |
24 | | - padding-top: 16px; |
25 | | - padding-bottom: 14px - $logo-bottom-margin; |
| 18 | + @include genericHeader.header-logo-styles($padding-top: 16px, $padding-bottom: 14px - $logo-bottom-margin); |
26 | 19 | } |
27 | 20 |
|
28 | 21 | .govuk-header__homepage-link { |
29 | | - // Avoid using the `base.govuk-link-common` mixin because the links in the |
30 | | - // header get a special treatment, because: |
31 | | - // |
32 | | - // - underlines are only visible on hover |
33 | | - // - all links get a 3px underline regardless of text size, as there are |
34 | | - // multiple grouped elements close to one another and having slightly |
35 | | - // different underline widths looks unbalanced |
36 | | - // |
37 | | - // Font size needs to be set on the link so that the box sizing is correct |
38 | | - // in Firefox |
39 | | - display: inline; |
40 | | - margin-right: base.govuk-spacing(2); |
41 | | - font-size: 30px; // We don't have a mixin that produces 30px font size |
42 | | - text-decoration: none; |
| 22 | + @include genericHeader.header-link-styles; |
| 23 | + |
43 | 24 | // Remove word-spacing from within the logo so we can ignore |
44 | 25 | // whitespace characters in the HTML |
45 | 26 | word-spacing: base.govuk-px-to-rem(-6px); |
46 | 27 | // Reset word-spacing for child elements |
47 | 28 | > * { |
48 | 29 | word-spacing: 0; |
49 | 30 | } |
50 | | - @include base.govuk-link-style-inverse; |
51 | | - |
52 | | - &:link, |
53 | | - &:visited { |
54 | | - text-decoration: none; |
55 | | - } |
56 | | - |
57 | | - &:hover, |
58 | | - &:active { |
59 | | - // Negate the added border |
60 | | - $link-underline-thickness: 3px; |
61 | | - margin-bottom: $link-underline-thickness * -1; |
62 | | - border-bottom: $link-underline-thickness solid; |
63 | | - } |
64 | | - |
65 | | - &:focus { |
66 | | - // Remove any borders that show when focused and hovered. |
67 | | - margin-bottom: 0; |
68 | | - border-bottom: 0; |
69 | | - |
70 | | - @include base.govuk-focused-text; |
71 | | - } |
72 | 31 | } |
73 | 32 |
|
74 | 33 | .govuk-header__logotype { |
|
146 | 105 | } |
147 | 106 |
|
148 | 107 | @media print { |
149 | | - .govuk-header { |
150 | | - border-bottom-width: 0; |
151 | | - color: base.govuk-colour("black"); |
152 | | - background: transparent; |
153 | | - } |
154 | | - |
155 | | - .govuk-header__homepage-link { |
156 | | - &:link, |
157 | | - &:visited { |
158 | | - color: base.govuk-colour("black"); |
159 | | - } |
160 | | - |
161 | | - // Do not append link href to GOV.UK link when printing (e.g. '(/)') |
162 | | - &::after { |
163 | | - display: none; |
164 | | - } |
165 | | - } |
166 | | - |
167 | 108 | .govuk-header__product-name { |
168 | 109 | // Fix product name alignment in Firefox when printing |
169 | 110 | @-moz-document url-prefix() { |
|
0 commit comments