dxw_govuk_frontend_rails 2.13.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/Rakefile +8 -8
- data/dxw_govuk_frontend_rails.gemspec +3 -3
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +3 -3
- data/package.json +1 -1
- data/vendor/assets/fonts/bold-affa96571d-v2.woff +0 -0
- data/vendor/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/vendor/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/vendor/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- data/vendor/assets/javascripts/govuk_frontend_rails.js +116 -63
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +48 -28
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +17 -9
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +10 -11
- data/vendor/assets/stylesheets/components/button/_button.scss +70 -47
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +4 -6
- data/vendor/assets/stylesheets/components/details/_details.scss +12 -13
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +4 -17
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +63 -1
- data/vendor/assets/stylesheets/components/footer/_footer.scss +47 -16
- data/vendor/assets/stylesheets/components/header/_header.scss +34 -20
- data/vendor/assets/stylesheets/components/input/_input.scss +24 -1
- data/vendor/assets/stylesheets/components/panel/_panel.scss +1 -1
- data/vendor/assets/stylesheets/components/radios/_radios.scss +7 -9
- data/vendor/assets/stylesheets/components/select/_select.scss +23 -1
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +6 -1
- data/vendor/assets/stylesheets/components/table/_table.scss +1 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +63 -51
- data/vendor/assets/stylesheets/components/tag/_tag.scss +18 -7
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +24 -1
- data/vendor/assets/stylesheets/helpers/_all.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_colour.scss +23 -1
- data/vendor/assets/stylesheets/helpers/_focused.scss +28 -0
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +10 -36
- data/vendor/assets/stylesheets/helpers/_grid.scss +11 -58
- data/vendor/assets/stylesheets/helpers/_links.scss +15 -1
- data/vendor/assets/stylesheets/helpers/_typography.scss +22 -4
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +4 -2
- data/vendor/assets/stylesheets/objects/_grid.scss +2 -2
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -1
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +9 -8
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +70 -6
- data/vendor/assets/stylesheets/settings/_compatibility.scss +31 -7
- data/vendor/assets/stylesheets/settings/_measurements.scss +2 -2
- data/vendor/assets/stylesheets/settings/_typography-font-families.scss +11 -1
- data/vendor/assets/stylesheets/settings/_typography-font.scss +27 -7
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +9 -10
- metadata +10 -22
- data/vendor/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/vendor/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/vendor/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/vendor/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/vendor/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/vendor/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/vendor/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/vendor/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/vendor/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/vendor/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/vendor/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/vendor/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/vendor/assets/images/icon-arrow-left.png +0 -0
- data/vendor/assets/images/icon-important.png +0 -0
- data/vendor/assets/images/icon-pointer-2x.png +0 -0
- data/vendor/assets/images/icon-pointer.png +0 -0
- data/vendor/assets/stylesheets/helpers/_focusable.scss +0 -34
@@ -9,7 +9,6 @@
|
|
9
9
|
@include govuk-exports("govuk/component/input") {
|
10
10
|
.govuk-input {
|
11
11
|
@include govuk-font($size: 19);
|
12
|
-
@include govuk-focusable;
|
13
12
|
|
14
13
|
box-sizing: border-box;
|
15
14
|
width: 100%;
|
@@ -26,6 +25,23 @@
|
|
26
25
|
-webkit-appearance: none;
|
27
26
|
-moz-appearance: none;
|
28
27
|
appearance: none;
|
28
|
+
|
29
|
+
&:focus {
|
30
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
31
|
+
// Ensure outline appears outside of the element
|
32
|
+
outline-offset: 0;
|
33
|
+
// Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width` - this is for consistency with
|
34
|
+
// components such as textarea where we avoid changing `border-width` as
|
35
|
+
// it will change the element size. Also, `outline` cannot be utilised
|
36
|
+
// here as it is already used for the yellow focus state.
|
37
|
+
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
38
|
+
|
39
|
+
@include govuk-if-ie8 {
|
40
|
+
// IE8 doesn't support `box-shadow` so double the border with
|
41
|
+
// `border-width`.
|
42
|
+
border-width: $govuk-border-width-form-element * 2;
|
43
|
+
}
|
44
|
+
}
|
29
45
|
}
|
30
46
|
|
31
47
|
.govuk-input::-webkit-outer-spin-button,
|
@@ -40,6 +56,13 @@
|
|
40
56
|
|
41
57
|
.govuk-input--error {
|
42
58
|
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
59
|
+
|
60
|
+
&:focus {
|
61
|
+
border-color: $govuk-input-border-colour;
|
62
|
+
// Remove `box-shadow` inherited from `:focus` as `input--error`
|
63
|
+
// already has the thicker border.
|
64
|
+
box-shadow: none;
|
65
|
+
}
|
43
66
|
}
|
44
67
|
|
45
68
|
// The ex measurements are based on the number of W's that can fit inside the input
|
@@ -124,11 +124,7 @@
|
|
124
124
|
|
125
125
|
// Focused state
|
126
126
|
.govuk-radios__input:focus + .govuk-radios__label::before {
|
127
|
-
|
128
|
-
// transparent outline that is shown instead.
|
129
|
-
// https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
|
130
|
-
outline: $govuk-focus-width solid transparent;
|
131
|
-
outline-offset: $govuk-focus-width;
|
127
|
+
border-width: 4px;
|
132
128
|
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
133
129
|
}
|
134
130
|
|
@@ -188,7 +184,9 @@
|
|
188
184
|
// Conditional reveals
|
189
185
|
// =========================================================
|
190
186
|
|
191
|
-
|
187
|
+
// The narrow border is used in the conditional reveals because the border has
|
188
|
+
// to be an even number in order to be centred under the 40px checkbox or radio.
|
189
|
+
$conditional-border-width: $govuk-border-width-narrow;
|
192
190
|
// Calculate the amount of padding needed to keep the border centered against the radios.
|
193
191
|
$conditional-border-padding: ($govuk-radios-size / 2) - ($conditional-border-width / 2);
|
194
192
|
// Move the border centered with the radios
|
@@ -276,9 +274,9 @@
|
|
276
274
|
//
|
277
275
|
// Reduce the size of the 'button' and center it within the ring
|
278
276
|
.govuk-radios__label::after {
|
279
|
-
top:
|
280
|
-
left:
|
281
|
-
border-width:
|
277
|
+
top: 15px;
|
278
|
+
left: 7px;
|
279
|
+
border-width: 5px;
|
282
280
|
}
|
283
281
|
|
284
282
|
// Fix position of hint with small radios
|
@@ -9,13 +9,28 @@
|
|
9
9
|
@include govuk-exports("govuk/component/select") {
|
10
10
|
.govuk-select {
|
11
11
|
@include govuk-font($size: 19, $line-height: 1.25);
|
12
|
-
@include govuk-focusable;
|
13
12
|
|
14
13
|
box-sizing: border-box; // should this be global?
|
15
14
|
max-width: 100%;
|
16
15
|
height: 40px;
|
17
16
|
padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
|
18
17
|
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
18
|
+
|
19
|
+
&:focus {
|
20
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
21
|
+
// Ensure outline appears outside of the element
|
22
|
+
outline-offset: 0;
|
23
|
+
// Double the border by adding its width again. Use `box-shadow` to do
|
24
|
+
// this instead of changing `border-width` (which changes element size) and
|
25
|
+
// since `outline` is already used for the yellow focus state.
|
26
|
+
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
27
|
+
|
28
|
+
@include govuk-if-ie8 {
|
29
|
+
// IE8 doesn't support `box-shadow` so double the border with
|
30
|
+
// `border-width`.
|
31
|
+
border-width: $govuk-border-width-form-element * 2;
|
32
|
+
}
|
33
|
+
}
|
19
34
|
}
|
20
35
|
|
21
36
|
.govuk-select option:active,
|
@@ -27,6 +42,13 @@
|
|
27
42
|
|
28
43
|
.govuk-select--error {
|
29
44
|
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
45
|
+
|
46
|
+
&:focus {
|
47
|
+
border-color: $govuk-input-border-colour;
|
48
|
+
// Remove `box-shadow` inherited from `:focus` as `select--error`
|
49
|
+
// already has the thicker border.
|
50
|
+
box-shadow: none;
|
51
|
+
}
|
30
52
|
}
|
31
53
|
|
32
54
|
}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
@include govuk-exports("govuk/component/skip-link") {
|
6
6
|
.govuk-skip-link {
|
7
7
|
@include govuk-visually-hidden-focusable;
|
8
|
-
@include govuk-
|
8
|
+
@include govuk-typography-common;
|
9
9
|
@include govuk-link-style-text;
|
10
10
|
@include govuk-typography-responsive($size: 16);
|
11
11
|
|
@@ -22,5 +22,10 @@
|
|
22
22
|
padding-right: unquote("max(#{govuk-spacing(3)}, #{$padding-safe-area-right})");
|
23
23
|
padding-left: unquote("max(#{govuk-spacing(3)}, #{$padding-safe-area-left})");
|
24
24
|
}
|
25
|
+
|
26
|
+
&:focus {
|
27
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
28
|
+
background-color: $govuk-focus-colour;
|
29
|
+
}
|
25
30
|
}
|
26
31
|
}
|
@@ -22,6 +22,7 @@
|
|
22
22
|
padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
|
23
23
|
border-bottom: 1px solid $govuk-border-colour;
|
24
24
|
text-align: left;
|
25
|
+
vertical-align: top;
|
25
26
|
// GOV.UK Elements sets the font-size and line-height for all headers and cells
|
26
27
|
// in tables.
|
27
28
|
@include govuk-compatibility(govuk_elements) {
|
@@ -5,30 +5,29 @@
|
|
5
5
|
@include govuk-exports("govuk/component/tabs") {
|
6
6
|
|
7
7
|
.govuk-tabs {
|
8
|
-
@include govuk-font($size: 19);
|
9
|
-
@include govuk-text-colour;
|
10
8
|
@include govuk-responsive-margin(1, "top");
|
11
9
|
@include govuk-responsive-margin(6, "bottom");
|
12
10
|
}
|
13
11
|
|
14
12
|
.govuk-tabs__title {
|
15
13
|
@include govuk-font($size: 19);
|
16
|
-
|
14
|
+
@include govuk-text-colour;
|
15
|
+
margin-bottom: govuk-spacing(2);
|
17
16
|
}
|
18
17
|
|
19
18
|
.govuk-tabs__list {
|
20
19
|
margin: 0;
|
21
20
|
padding: 0;
|
22
21
|
list-style: none;
|
23
|
-
@include
|
24
|
-
@include govuk-responsive-margin(6, "bottom");
|
25
|
-
}
|
22
|
+
@include govuk-responsive-margin(6, "bottom");
|
26
23
|
}
|
27
24
|
|
28
25
|
.govuk-tabs__list-item {
|
26
|
+
@include govuk-font($size: 19);
|
29
27
|
margin-left: govuk-spacing(5);
|
30
28
|
|
31
29
|
&::before {
|
30
|
+
@include govuk-text-colour;
|
32
31
|
content: "\2014 "; // "— "
|
33
32
|
margin-left: - govuk-spacing(5);
|
34
33
|
padding-right: govuk-spacing(1);
|
@@ -36,17 +35,15 @@
|
|
36
35
|
}
|
37
36
|
|
38
37
|
.govuk-tabs__tab {
|
39
|
-
@include govuk-link-common;
|
40
38
|
@include govuk-link-style-default;
|
41
|
-
@include govuk-font($size: 19);
|
42
39
|
|
43
40
|
display: inline-block;
|
44
|
-
|
45
|
-
padding-bottom: govuk-spacing(2);
|
41
|
+
margin-bottom: govuk-spacing(2);
|
46
42
|
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
// Focus state for mobile and when JavaScript is disabled
|
44
|
+
// It is removed for JS-enabled desktop styles
|
45
|
+
&:focus {
|
46
|
+
@include govuk-focused-text;
|
50
47
|
}
|
51
48
|
}
|
52
49
|
|
@@ -57,73 +54,88 @@
|
|
57
54
|
// JavaScript enabled
|
58
55
|
.js-enabled {
|
59
56
|
|
60
|
-
@include
|
57
|
+
@include govuk-media-query($from: tablet) {
|
61
58
|
|
62
59
|
.govuk-tabs__list {
|
63
60
|
@include govuk-clearfix;
|
61
|
+
margin-bottom: 0;
|
64
62
|
border-bottom: 1px solid $govuk-border-colour;
|
65
63
|
}
|
66
64
|
|
65
|
+
.govuk-tabs__title {
|
66
|
+
display: none;
|
67
|
+
}
|
68
|
+
|
67
69
|
.govuk-tabs__list-item {
|
70
|
+
position: relative;
|
71
|
+
|
72
|
+
margin-right: govuk-spacing(1);
|
73
|
+
margin-bottom: 0;
|
68
74
|
margin-left: 0;
|
75
|
+
padding: govuk-spacing(2) govuk-spacing(4);
|
76
|
+
|
77
|
+
float: left;
|
78
|
+
background-color: govuk-colour("light-grey", $legacy: "grey-4");
|
79
|
+
text-align: center;
|
69
80
|
|
70
81
|
&::before {
|
71
82
|
content: none;
|
72
83
|
}
|
73
84
|
}
|
74
85
|
|
75
|
-
.govuk-
|
76
|
-
|
86
|
+
.govuk-tabs__list-item--selected {
|
87
|
+
$border-width: 1px;
|
88
|
+
|
89
|
+
position: relative;
|
90
|
+
|
91
|
+
margin-top: - govuk-spacing(1);
|
92
|
+
|
93
|
+
// Compensation for border (otherwise we get a shift)
|
94
|
+
margin-bottom: -$border-width;
|
95
|
+
padding-top: govuk-spacing(3) - $border-width;
|
96
|
+
padding-right: govuk-spacing(4) - $border-width;
|
97
|
+
padding-bottom: govuk-spacing(3) + $border-width;
|
98
|
+
padding-left: govuk-spacing(4) - $border-width;
|
99
|
+
|
100
|
+
border: $border-width solid $govuk-border-colour;
|
101
|
+
border-bottom: 0;
|
102
|
+
|
103
|
+
background-color: $govuk-body-background-colour;
|
104
|
+
|
105
|
+
.govuk-tabs__tab {
|
106
|
+
text-decoration: none;
|
107
|
+
}
|
77
108
|
}
|
78
109
|
|
79
110
|
.govuk-tabs__tab {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
margin-bottom: -1px;
|
92
|
-
|
93
|
-
// 1px is compensation for border (otherwise we get a 1px shift)
|
94
|
-
padding-top: govuk-spacing(3) - 1px;
|
95
|
-
padding-right: govuk-spacing(4) - 1px;
|
96
|
-
padding-bottom: govuk-spacing(3) + 1px;
|
97
|
-
padding-left: govuk-spacing(4) - 1px;
|
98
|
-
|
99
|
-
border: 1px solid $govuk-border-colour;
|
100
|
-
border-bottom: 0;
|
101
|
-
color: govuk-colour("black");
|
102
|
-
background-color: govuk-colour("white");
|
103
|
-
|
104
|
-
&:focus {
|
105
|
-
background-color: transparent;
|
106
|
-
}
|
111
|
+
@include govuk-link-style-text;
|
112
|
+
|
113
|
+
margin-bottom: 0;
|
114
|
+
|
115
|
+
&::after {
|
116
|
+
content: "";
|
117
|
+
position: absolute;
|
118
|
+
top: 0;
|
119
|
+
right: 0;
|
120
|
+
bottom: 0;
|
121
|
+
left: 0;
|
107
122
|
}
|
108
123
|
}
|
109
124
|
|
110
125
|
.govuk-tabs__panel {
|
111
126
|
@include govuk-responsive-margin(0, "bottom");
|
112
|
-
padding
|
113
|
-
padding-right: govuk-spacing(4);
|
114
|
-
padding-bottom: govuk-spacing(6);
|
115
|
-
padding-left: govuk-spacing(4);
|
127
|
+
padding: govuk-spacing(6) govuk-spacing(4);
|
116
128
|
border: 1px solid $govuk-border-colour;
|
117
129
|
border-top: 0;
|
118
130
|
|
119
|
-
&--hidden {
|
120
|
-
display: none;
|
121
|
-
}
|
122
|
-
|
123
131
|
& > :last-child {
|
124
132
|
margin-bottom: 0;
|
125
133
|
}
|
126
134
|
}
|
135
|
+
|
136
|
+
.govuk-tabs__panel--hidden {
|
137
|
+
display: none;
|
138
|
+
}
|
127
139
|
}
|
128
140
|
|
129
141
|
}
|
@@ -4,14 +4,8 @@
|
|
4
4
|
|
5
5
|
@include govuk-exports("govuk/component/tag") {
|
6
6
|
.govuk-tag {
|
7
|
-
@include govuk-font($size: 16, $weight: bold, $line-height: 1.25);
|
8
7
|
|
9
8
|
display: inline-block;
|
10
|
-
padding: 4px 8px;
|
11
|
-
// Since New Transport sits slightly higher than other common fonts.
|
12
|
-
// We use intentionally uneven padding to make it balanced, this can be
|
13
|
-
// removed using the version of the font that has a more common vertical spacing.
|
14
|
-
padding-bottom: 1px;
|
15
9
|
|
16
10
|
// When a user customises their colours often the background is removed,
|
17
11
|
// by adding a outline we ensure that the tag component still keeps it's meaning.
|
@@ -25,9 +19,26 @@
|
|
25
19
|
|
26
20
|
text-decoration: none;
|
27
21
|
text-transform: uppercase;
|
22
|
+
|
23
|
+
@if $govuk-use-legacy-font {
|
24
|
+
// Since New Transport sits slightly higher than other common fonts.
|
25
|
+
// We use intentionally uneven padding to make it balanced, this can be
|
26
|
+
// removed using the version of the font that has a more common vertical spacing.
|
27
|
+
@include govuk-font($size: 16, $weight: bold, $line-height: 1.25);
|
28
|
+
padding-top: 4px;
|
29
|
+
padding-right: 8px;
|
30
|
+
padding-bottom: 1px;
|
31
|
+
padding-left: 8px;
|
32
|
+
} @else {
|
33
|
+
@include govuk-font($size: 16, $weight: bold, $line-height: 1);
|
34
|
+
padding-top: 5px;
|
35
|
+
padding-right: 8px;
|
36
|
+
padding-bottom: 4px;
|
37
|
+
padding-left: 8px;
|
38
|
+
}
|
28
39
|
}
|
29
40
|
|
30
41
|
.govuk-tag--inactive {
|
31
|
-
background-color: govuk-colour("grey-1");
|
42
|
+
background-color: govuk-colour("dark-grey", $legacy: "grey-1");
|
32
43
|
}
|
33
44
|
}
|
@@ -9,7 +9,6 @@
|
|
9
9
|
@include govuk-exports("govuk/component/textarea") {
|
10
10
|
.govuk-textarea {
|
11
11
|
@include govuk-font($size: 19, $line-height: 1.25);
|
12
|
-
@include govuk-focusable;
|
13
12
|
|
14
13
|
box-sizing: border-box; // should this be global?
|
15
14
|
display: block;
|
@@ -24,9 +23,33 @@
|
|
24
23
|
border-radius: 0;
|
25
24
|
|
26
25
|
-webkit-appearance: none;
|
26
|
+
|
27
|
+
&:focus {
|
28
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
29
|
+
// Ensure outline appears outside of the element
|
30
|
+
outline-offset: 0;
|
31
|
+
// Double the border by adding its width again. Use `box-shadow` to do
|
32
|
+
// this instead of changing `border-width` (which changes element size) and
|
33
|
+
// since `outline` is already used for the yellow focus state.
|
34
|
+
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
35
|
+
|
36
|
+
@include govuk-if-ie8 {
|
37
|
+
// IE8 doesn't support `box-shadow` so double the border with
|
38
|
+
// `border-width`.
|
39
|
+
border-width: $govuk-border-width-form-element * 2;
|
40
|
+
}
|
41
|
+
}
|
27
42
|
}
|
28
43
|
|
29
44
|
.govuk-textarea--error {
|
30
45
|
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
46
|
+
|
47
|
+
&:focus {
|
48
|
+
border-color: $govuk-input-border-colour;
|
49
|
+
// Remove `box-shadow` inherited from `:focus` as `textarea--error`
|
50
|
+
// already has the thicker border.
|
51
|
+
box-shadow: none;
|
52
|
+
}
|
53
|
+
|
31
54
|
}
|
32
55
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
@import "../settings/compatibility";
|
1
2
|
@import "../settings/colours-palette";
|
2
3
|
@import "../settings/colours-organisations";
|
3
4
|
|
@@ -9,11 +10,32 @@
|
|
9
10
|
///
|
10
11
|
/// @param {String} $colour - Name of colour from the colour palette
|
11
12
|
/// (`$govuk-colours`)
|
13
|
+
/// @param {String} $legacy - Either the name of colour from the legacy palette
|
14
|
+
/// or a colour literal, to return instead when in 'legacy mode' - matching
|
15
|
+
/// the palette from GOV.UK Template, Elements or Frontend Toolkit
|
12
16
|
/// @return {Colour} Representation of named colour
|
17
|
+
///
|
18
|
+
/// @example scss - Using legacy colours from the palette
|
19
|
+
/// .foo {
|
20
|
+
/// background-colour: govuk-colour("mid-grey", $legacy: "grey-2");
|
21
|
+
/// }
|
22
|
+
///
|
23
|
+
/// @example scss - Using legacy colour literals
|
24
|
+
/// .foo {
|
25
|
+
/// background-colour: govuk-colour("green", $legacy: #BADA55);
|
26
|
+
/// }
|
27
|
+
///
|
13
28
|
/// @throw if `$colour` is not a colour from the colour palette
|
14
29
|
/// @access public
|
15
30
|
|
16
|
-
@function govuk-colour($colour) {
|
31
|
+
@function govuk-colour($colour, $legacy: false) {
|
32
|
+
@if ($govuk-use-legacy-palette and $legacy) {
|
33
|
+
@if (type-of($legacy) == "color") {
|
34
|
+
@return $legacy;
|
35
|
+
}
|
36
|
+
$colour: $legacy;
|
37
|
+
}
|
38
|
+
|
17
39
|
$colour: quote($colour);
|
18
40
|
|
19
41
|
@if not map-has-key($govuk-colours, $colour) {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Focused text
|
6
|
+
///
|
7
|
+
/// Provides an outline to clearly indicate when the target element is focused.
|
8
|
+
/// Used for interactive text-based elements.
|
9
|
+
///
|
10
|
+
/// @access public
|
11
|
+
|
12
|
+
@mixin govuk-focused-text {
|
13
|
+
// When colours are overridden, for example when users have a dark mode,
|
14
|
+
// backgrounds and box-shadows disappear, so we need to ensure there's a
|
15
|
+
// transparent outline which will be set to a visible colour.
|
16
|
+
|
17
|
+
// Since Internet Explorer 8 does not support box-shadow, we want to force the
|
18
|
+
// user-agent outlines
|
19
|
+
@include govuk-not-ie8 {
|
20
|
+
outline: $govuk-focus-width solid transparent;
|
21
|
+
}
|
22
|
+
color: $govuk-focus-text-colour;
|
23
|
+
background-color: $govuk-focus-colour;
|
24
|
+
box-shadow: 0 -2px $govuk-focus-colour, 0 4px $govuk-focus-text-colour;
|
25
|
+
// When link is focussed, hide the default underline since the
|
26
|
+
// box shadow adds the "underline"
|
27
|
+
text-decoration: none;
|
28
|
+
}
|
@@ -7,57 +7,31 @@
|
|
7
7
|
|
8
8
|
@import "../tools/exports";
|
9
9
|
|
10
|
-
/// Font Face -
|
10
|
+
/// Font Face - GDS Transport
|
11
11
|
///
|
12
|
-
/// Outputs the font-face declaration for
|
12
|
+
/// Outputs the font-face declaration for GDS Transport at the root of the CSS document
|
13
13
|
/// the first time it is called.
|
14
14
|
///
|
15
15
|
/// @access private
|
16
16
|
|
17
|
-
@mixin _govuk-font-face-
|
18
|
-
@include govuk-exports("govuk/helpers/font-
|
17
|
+
@mixin _govuk-font-face-gds-transport {
|
18
|
+
@include govuk-exports("govuk/helpers/font-faces") {
|
19
19
|
@at-root {
|
20
20
|
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */
|
21
21
|
|
22
22
|
@font-face {
|
23
|
-
font-family: "
|
24
|
-
src: govuk-font-url("light-
|
25
|
-
|
26
|
-
govuk-font-url("light-f38ad40456-v1.woff2") format("woff2"),
|
27
|
-
govuk-font-url("light-458f8ea81c-v1.woff") format("woff");
|
23
|
+
font-family: "GDS Transport";
|
24
|
+
src: govuk-font-url("light-94a07e06a1-v2.woff2") format("woff2"),
|
25
|
+
govuk-font-url("light-f591b13f7d-v2.woff") format("woff");
|
28
26
|
font-weight: normal;
|
29
27
|
font-style: normal;
|
30
28
|
font-display: fallback;
|
31
29
|
}
|
32
30
|
|
33
31
|
@font-face {
|
34
|
-
font-family: "
|
35
|
-
src: govuk-font-url("bold-
|
36
|
-
|
37
|
-
govuk-font-url("bold-a2452cb66f-v1.woff2") format("woff2"),
|
38
|
-
govuk-font-url("bold-f38c792ac2-v1.woff") format("woff");
|
39
|
-
font-weight: bold;
|
40
|
-
font-style: normal;
|
41
|
-
font-display: fallback;
|
42
|
-
}
|
43
|
-
|
44
|
-
@font-face {
|
45
|
-
font-family: "ntatabularnumbers";
|
46
|
-
src: govuk-font-url("light-tabular-498ea8ffe2-v1.eot");
|
47
|
-
src: govuk-font-url("light-tabular-498ea8ffe2-v1.eot?#iefix") format("embedded-opentype"),
|
48
|
-
govuk-font-url("light-tabular-851b10ccdd-v1.woff2") format("woff2"),
|
49
|
-
govuk-font-url("light-tabular-62cc6f0a28-v1.woff") format("woff");
|
50
|
-
font-weight: normal;
|
51
|
-
font-style: normal;
|
52
|
-
font-display: fallback;
|
53
|
-
}
|
54
|
-
|
55
|
-
@font-face {
|
56
|
-
font-family: "ntatabularnumbers";
|
57
|
-
src: govuk-font-url("bold-tabular-357fdfbcc3-v1.eot");
|
58
|
-
src: govuk-font-url("bold-tabular-357fdfbcc3-v1.eot?#iefix") format("embedded-opentype"),
|
59
|
-
govuk-font-url("bold-tabular-b89238d840-v1.woff2") format("woff2"),
|
60
|
-
govuk-font-url("bold-tabular-784c21afb8-v1.woff") format("woff");
|
32
|
+
font-family: "GDS Transport";
|
33
|
+
src: govuk-font-url("bold-b542beb274-v2.woff2") format("woff2"),
|
34
|
+
govuk-font-url("bold-affa96571d-v2.woff") format("woff");
|
61
35
|
font-weight: bold;
|
62
36
|
font-style: normal;
|
63
37
|
font-display: fallback;
|