Skip to content

Commit 1839ea5

Browse files
fix styling issues
1 parent 9f66941 commit 1839ea5

File tree

1 file changed

+66
-19
lines changed

1 file changed

+66
-19
lines changed

src/lib/components/ui/Masthead.svelte

Lines changed: 66 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,31 @@
169169
170170
/* GOV.UK Button Styles - Scoped to our component with high specificity */
171171
.app-masthead .govuk-button.govuk-button {
172+
/* @include govuk-font($size: 19, $line-height: 19px); */
172173
font-family: "GDS Transport", arial, sans-serif;
173174
font-weight: 400;
174-
font-size: 1rem;
175-
line-height: 1.1875;
175+
font-size: 1.1875rem; /* 19px */
176+
line-height: 1.1875; /* 19px line height */
176177
box-sizing: border-box;
177178
display: inline-block;
178179
position: relative;
179180
width: 100%;
180181
margin-top: 0;
181182
margin-right: 0;
182183
margin-left: 0;
183-
margin-bottom: 1.375rem;
184-
padding: 0.5rem 0.625rem 0.4375rem;
185-
border: 0.125rem solid transparent;
184+
margin-bottom: 1.375rem; /* 22px - adjusted for shadow */
185+
/* Padding calculation: govuk-spacing(2) - border-width - shadow adjustment */
186+
padding: 0.4375rem 0.625rem 0.3125rem; /* 7px 10px 5px */
187+
border: 0.125rem solid transparent; /* 2px border */
186188
border-radius: 0;
187-
color: #ffffff;
188-
background-color: #00703c;
189-
box-shadow: 0 0.125rem 0 #002d18;
189+
color: #ffffff; /* $govuk-button-text-colour */
190+
background-color: #00703c; /* $govuk-button-colour (green) */
191+
box-shadow: 0 0.125rem 0 #002d18; /* 2px shadow */
190192
text-align: center;
191193
vertical-align: top;
192194
cursor: pointer;
193195
text-decoration: none;
196+
-webkit-appearance: none;
194197
}
195198
196199
@media (min-width: 40.0625em) {
@@ -200,37 +203,81 @@
200203
}
201204
}
202205
206+
/* Link states for buttons */
207+
.app-masthead .govuk-button.govuk-button:link,
208+
.app-masthead .govuk-button.govuk-button:visited,
209+
.app-masthead .govuk-button.govuk-button:active {
210+
color: #ffffff;
211+
text-decoration: none;
212+
}
213+
203214
.app-masthead .govuk-button.govuk-button:hover {
204-
background-color: #005a30;
205-
box-shadow: 0 0.25rem 0 #002d18;
215+
background-color: #005a30; /* $govuk-button-hover-colour */
216+
box-shadow: 0 0.25rem 0 #002d18; /* 4px shadow on hover */
217+
color: #ffffff;
218+
text-decoration: none;
206219
}
207220
208221
.app-masthead .govuk-button.govuk-button:active {
209-
top: 0.125rem;
210-
box-shadow: 0 0 0 #002d18;
222+
top: 0.125rem; /* 2px - button pressed down */
223+
box-shadow: 0 0 0 #002d18; /* No shadow when pressed */
211224
}
212225
213-
.app-masthead .govuk-button.govuk-button--inverse {
214-
background-color: #ffffff;
226+
.app-masthead .govuk-button.govuk-button:focus {
227+
border-color: #ffdd00; /* $govuk-focus-colour */
228+
outline: 0.1875rem solid transparent; /* 3px */
229+
box-shadow: inset 0 0 0 1px #ffdd00;
230+
}
231+
232+
.app-masthead .govuk-button.govuk-button:focus:not(:active):not(:hover) {
233+
border-color: #ffdd00;
234+
color: #0b0c0c; /* $govuk-focus-text-colour */
235+
background-color: #ffdd00;
215236
box-shadow: 0 0.125rem 0 #0b0c0c;
216-
color: #0b0c0c;
237+
}
238+
239+
/* Inverse button styles - white button with blue text */
240+
.app-masthead .govuk-button.govuk-button--inverse {
241+
background-color: #ffffff; /* $govuk-inverse-button-colour */
242+
box-shadow: 0 0.125rem 0 #0b0c0c; /* $govuk-inverse-button-shadow-colour */
243+
color: #1d70b8; /* $govuk-inverse-button-text-colour - BLUE text, not white! */
244+
}
245+
246+
.app-masthead .govuk-button.govuk-button--inverse:link,
247+
.app-masthead .govuk-button.govuk-button--inverse:visited,
248+
.app-masthead .govuk-button.govuk-button--inverse:active {
249+
color: #1d70b8; /* Blue text for all states */
217250
}
218251
219252
.app-masthead .govuk-button.govuk-button--inverse:hover {
220-
background-color: #f3f2f1;
221-
color: #0b0c0c;
253+
background-color: #f3f2f1; /* $govuk-inverse-button-hover-colour */
254+
color: #1d70b8; /* Keep blue text on hover */
222255
}
223256
257+
/* Start button styles */
224258
.app-masthead .govuk-button.govuk-button--start {
259+
/* @include govuk-typography-weight-bold; @include govuk-font-size($size: 24, $line-height: 1); */
225260
font-weight: 700;
261+
font-size: 1.5rem; /* 24px */
262+
line-height: 1;
226263
display: inline-flex;
227-
align-items: center;
264+
min-height: auto;
265+
justify-content: center;
228266
}
229267
230268
.app-masthead .govuk-button .govuk-button__start-icon {
231-
margin-left: 0.5rem;
269+
/* margin-left: govuk-spacing(1); on mobile, govuk-spacing(2) on desktop */
270+
margin-left: 0.3125rem; /* 5px - govuk-spacing(1) */
232271
vertical-align: middle;
233272
flex-shrink: 0;
273+
align-self: center;
274+
forced-color-adjust: auto;
275+
}
276+
277+
@media (min-width: 48.0625em) {
278+
.app-masthead .govuk-button .govuk-button__start-icon {
279+
margin-left: 0.625rem; /* 10px - govuk-spacing(2) */
280+
}
234281
}
235282
236283
/* GOV.UK Typography - Scoped to our component with high specificity */

0 commit comments

Comments
 (0)