|
63 | 63 | } |
64 | 64 | } |
65 | 65 |
|
| 66 | + .govuk-header__logo { |
| 67 | + box-sizing: border-box; |
| 68 | + @include govuk-responsive-margin($govuk-header-vertical-spacing-value, "bottom"); |
| 69 | + |
| 70 | + @media #{govuk-from-breakpoint(desktop)} { |
| 71 | + width: 33.33%; |
| 72 | + padding-right: $govuk-gutter-half; |
| 73 | + float: left; |
| 74 | + vertical-align: top; |
| 75 | + |
| 76 | + // Reset float when logo is the last child, without a navigation |
| 77 | + &:last-child { |
| 78 | + width: auto; |
| 79 | + padding-right: 0; |
| 80 | + float: none; |
| 81 | + } |
| 82 | + } |
| 83 | + |
| 84 | + @include _govuk-rebrand { |
| 85 | + // Apply margins to internal elements to emulate padding |
| 86 | + margin-bottom: 0; |
| 87 | + |
| 88 | + // Magic numbers, set padding to vertically centre align the logo |
| 89 | + padding-top: 16px; |
| 90 | + padding-bottom: 14px - $govuk-header-rebrand-logo-bottom-margin; |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + .govuk-header__homepage-link { |
| 95 | + // Avoid using the `govuk-link-common` mixin because the links in the |
| 96 | + // header get a special treatment, because: |
| 97 | + // |
| 98 | + // - underlines are only visible on hover |
| 99 | + // - all links get a 3px underline regardless of text size, as there are |
| 100 | + // multiple grouped elements close to one another and having slightly |
| 101 | + // different underline widths looks unbalanced |
| 102 | + // |
| 103 | + // Font size needs to be set on the link so that the box sizing is correct |
| 104 | + // in Firefox |
| 105 | + display: inline-block; |
| 106 | + margin-right: govuk-spacing(2); |
| 107 | + font-size: 30px; // We don't have a mixin that produces 30px font size |
| 108 | + text-decoration: none; |
| 109 | + @include govuk-link-style-inverse; |
| 110 | + |
| 111 | + @media #{govuk-from-breakpoint(desktop)} { |
| 112 | + display: inline; |
| 113 | + } |
| 114 | + |
| 115 | + &:link, |
| 116 | + &:visited { |
| 117 | + text-decoration: none; |
| 118 | + } |
| 119 | + |
| 120 | + &:hover, |
| 121 | + &:active { |
| 122 | + // Negate the added border |
| 123 | + margin-bottom: $govuk-header-link-underline-thickness * -1; |
| 124 | + border-bottom: $govuk-header-link-underline-thickness solid; |
| 125 | + } |
| 126 | + |
| 127 | + &:hover { |
| 128 | + text-decoration: underline; |
| 129 | + text-decoration-thickness: $govuk-header-link-underline-thickness; |
| 130 | + |
| 131 | + @if $govuk-link-underline-offset { |
| 132 | + text-underline-offset: $govuk-link-underline-offset; |
| 133 | + } |
| 134 | + } |
| 135 | + |
| 136 | + &:focus { |
| 137 | + // Remove any borders that show when focused and hovered. |
| 138 | + margin-bottom: 0; |
| 139 | + border-bottom: 0; |
| 140 | + |
| 141 | + @include govuk-focused-text; |
| 142 | + } |
| 143 | + |
| 144 | + @include _govuk-rebrand { |
| 145 | + display: inline; |
| 146 | + |
| 147 | + // Remove word-spacing from within the logo so we can ignore |
| 148 | + // whitespace characters in the HTML |
| 149 | + word-spacing: govuk-px-to-rem(-6px); |
| 150 | + |
| 151 | + // Reset word-spacing for child elements |
| 152 | + > * { |
| 153 | + word-spacing: 0; |
| 154 | + } |
| 155 | + |
| 156 | + &:not(:focus) { |
| 157 | + background-color: $govuk-header-rebrand-background; |
| 158 | + } |
| 159 | + } |
| 160 | + } |
| 161 | + |
66 | 162 | .govuk-header__logotype { |
67 | 163 | display: inline-block; |
68 | 164 | position: relative; |
|
180 | 276 | } |
181 | 277 | } |
182 | 278 |
|
183 | | - .govuk-header__link { |
184 | | - // Avoid using the `govuk-link-common` mixin because the links in the header |
185 | | - // get a special treatment, because: |
186 | | - // |
187 | | - // - underlines are only visible on hover |
188 | | - // - all links get a 3px underline regardless of text size, as there are |
189 | | - // multiple grouped elements close to one another and having slightly |
190 | | - // different underline widths looks unbalanced |
191 | | - @include govuk-link-style-inverse; |
192 | | - |
193 | | - text-decoration: none; |
194 | | - |
195 | | - &:hover { |
196 | | - text-decoration: underline; |
197 | | - text-decoration-thickness: $govuk-header-link-underline-thickness; |
198 | | - |
199 | | - @if $govuk-link-underline-offset { |
200 | | - text-underline-offset: $govuk-link-underline-offset; |
201 | | - } |
202 | | - } |
203 | | - |
204 | | - &:focus { |
205 | | - @include govuk-focused-text; |
206 | | - } |
207 | | - } |
208 | | - |
209 | | - .govuk-header__link--homepage { |
210 | | - // Font size needs to be set on the link so that the box sizing is correct |
211 | | - // in Firefox |
212 | | - display: inline-block; |
213 | | - margin-right: govuk-spacing(2); |
214 | | - font-size: 30px; // We don't have a mixin that produces 30px font size |
215 | | - |
216 | | - @media #{govuk-from-breakpoint(desktop)} { |
217 | | - display: inline; |
218 | | - } |
219 | | - |
220 | | - &:link, |
221 | | - &:visited { |
222 | | - text-decoration: none; |
223 | | - } |
224 | | - |
225 | | - &:hover, |
226 | | - &:active { |
227 | | - // Negate the added border |
228 | | - margin-bottom: $govuk-header-link-underline-thickness * -1; |
229 | | - border-bottom: $govuk-header-link-underline-thickness solid; |
230 | | - } |
231 | | - |
232 | | - // Remove any borders that show when focused and hovered. |
233 | | - &:focus { |
234 | | - margin-bottom: 0; |
235 | | - border-bottom: 0; |
236 | | - } |
237 | | - |
238 | | - @include _govuk-rebrand { |
239 | | - display: inline; |
240 | | - |
241 | | - // Remove word-spacing from within the logo so we can ignore |
242 | | - // whitespace characters in the HTML |
243 | | - word-spacing: govuk-px-to-rem(-6px); |
244 | | - |
245 | | - // Reset word-spacing for child elements |
246 | | - > * { |
247 | | - word-spacing: 0; |
248 | | - } |
249 | | - |
250 | | - &:not(:focus) { |
251 | | - background-color: $govuk-header-rebrand-background; |
252 | | - } |
253 | | - } |
254 | | - } |
255 | | - |
256 | | - .govuk-header__logo { |
257 | | - box-sizing: border-box; |
258 | | - @include govuk-responsive-margin($govuk-header-vertical-spacing-value, "bottom"); |
259 | | - |
260 | | - @media #{govuk-from-breakpoint(desktop)} { |
261 | | - width: 33.33%; |
262 | | - padding-right: $govuk-gutter-half; |
263 | | - float: left; |
264 | | - vertical-align: top; |
265 | | - |
266 | | - // Reset float when logo is the last child, without a navigation |
267 | | - &:last-child { |
268 | | - width: auto; |
269 | | - padding-right: 0; |
270 | | - float: none; |
271 | | - } |
272 | | - } |
273 | | - |
274 | | - @include _govuk-rebrand { |
275 | | - // Apply margins to internal elements to emulate padding |
276 | | - margin-bottom: 0; |
277 | | - |
278 | | - // Magic numbers, set padding to vertically centre align the logo |
279 | | - padding-top: 16px; |
280 | | - padding-bottom: 14px - $govuk-header-rebrand-logo-bottom-margin; |
281 | | - } |
282 | | - } |
283 | | - |
284 | 279 | @media print { |
285 | 280 | .govuk-header { |
286 | 281 | border-bottom-width: 0; |
287 | 282 | color: govuk-colour("black"); |
288 | 283 | background: transparent; |
289 | 284 | } |
290 | 285 |
|
291 | | - .govuk-header__link { |
| 286 | + .govuk-header__homepage-link { |
292 | 287 | &:link, |
293 | 288 | &:visited { |
294 | 289 | color: govuk-colour("black"); |
|
0 commit comments