katalyst-govuk-formbuilder 1.3.2 → 1.5.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 +8 -0
- data/app/assets/builds/katalyst/govuk/formbuilder.css +58 -5
- data/app/assets/builds/katalyst/govuk/formbuilder.js +98 -64
- data/app/assets/builds/katalyst/govuk/formbuilder.min.js +1 -1
- data/app/assets/stylesheets/katalyst/govuk/components/richtextarea/_index.scss +7 -6
- data/app/assets/stylesheets/katalyst/govuk/formbuilder.scss +1 -1
- data/lib/katalyst/govuk/formbuilder/engine.rb +1 -0
- data/lib/katalyst/govuk/formbuilder/version.rb +1 -1
- data/vendor/assets/stylesheets/govuk-frontend/govuk/_base.scss +3 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/all-ie8.scss +14 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/all.scss +9 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/_all.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_index.scss +392 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_index.scss +99 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_index.scss +147 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_button.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_index.scss +297 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_index.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_index.scss +335 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_index.scss +49 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_details.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_index.scss +88 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_index.scss +12 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_index.scss +43 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_index.scss +55 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_footer.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_index.scss +193 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_header.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_index.scss +349 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_hint.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_index.scss +42 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_index.scss +193 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_input.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_label.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_index.scss +247 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_index.scss +56 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_panel.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_index.scss +349 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_radios.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_index.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_select.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_index.scss +47 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_index.scss +276 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_index.scss +71 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_table.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_index.scss +130 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_index.scss +81 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_tag.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_index.scss +54 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_index.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_all.scss +6 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_global-styles.scss +19 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_govuk-frontend-version.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_links.scss +35 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_lists.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_section-break.scss +56 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_typography.scss +186 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_all.scss +12 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_clearfix.scss +15 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_colour.scss +98 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_device-pixels.scss +37 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_focused.scss +33 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_grid.scss +61 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_links.scss +429 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_media-queries.scss +91 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_shape-arrow.scss +80 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_spacing.scss +171 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_typography.scss +214 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_visually-hidden.scss +84 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_all.scss +6 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_button-group.scss +85 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_form-group.scss +23 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_grid.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_main-wrapper.scss +53 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_template.scss +32 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_width-container.scss +84 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_all.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_display.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_spacing.scss +102 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_text-align.scss +14 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_typography.scss +21 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_width.scss +46 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_all.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_assets.scss +82 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-applied.scss +155 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-organisations.scss +146 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-palette.scss +120 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_compatibility.scss +100 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_global-styles.scss +13 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_ie8.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_links.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_measurements.scss +95 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_media-queries.scss +23 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_spacing.scss +76 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font-families.scss +32 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font.scss +112 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-responsive.scss +195 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_warnings.scss +53 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_all.scss +7 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_compatibility.scss +50 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_exports.scss +33 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_font-url.scss +25 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_ie8.scss +87 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_image-url.scss +25 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-em.scss +20 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-rem.scss +20 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_all.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_clearfix.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_visually-hidden.scss +9 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/vendor/_sass-mq.scss +347 -0
- metadata +132 -4
- data/app/assets/builds/katalyst/govuk/formbuilder.min.css +0 -1
@@ -0,0 +1,297 @@
|
|
1
|
+
////
|
2
|
+
/// @group components/button
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Button component background colour
|
6
|
+
///
|
7
|
+
/// @type Colour
|
8
|
+
/// @access public
|
9
|
+
|
10
|
+
$govuk-button-background-colour: govuk-colour("green", $legacy: #00823b) !default;
|
11
|
+
|
12
|
+
/// Button component text colour
|
13
|
+
///
|
14
|
+
/// @type Colour
|
15
|
+
/// @access public
|
16
|
+
|
17
|
+
$govuk-button-text-colour: govuk-colour("white") !default;
|
18
|
+
|
19
|
+
@include govuk-exports("govuk/component/button") {
|
20
|
+
$govuk-button-colour: $govuk-button-background-colour;
|
21
|
+
$govuk-button-hover-colour: govuk-shade($govuk-button-colour, 20%);
|
22
|
+
$govuk-button-shadow-colour: govuk-shade($govuk-button-colour, 60%);
|
23
|
+
$govuk-button-text-colour: $govuk-button-text-colour;
|
24
|
+
|
25
|
+
// Secondary button variables
|
26
|
+
$govuk-secondary-button-colour: govuk-colour("light-grey", $legacy: "grey-3");
|
27
|
+
$govuk-secondary-button-hover-colour: govuk-shade($govuk-secondary-button-colour, 10%);
|
28
|
+
$govuk-secondary-button-shadow-colour: govuk-shade($govuk-secondary-button-colour, 40%);
|
29
|
+
$govuk-secondary-button-text-colour: govuk-colour("black");
|
30
|
+
|
31
|
+
// Warning button variables
|
32
|
+
$govuk-warning-button-colour: govuk-colour("red");
|
33
|
+
$govuk-warning-button-hover-colour: govuk-shade($govuk-warning-button-colour, 20%);
|
34
|
+
$govuk-warning-button-shadow-colour: govuk-shade($govuk-warning-button-colour, 60%);
|
35
|
+
$govuk-warning-button-text-colour: govuk-colour("white");
|
36
|
+
|
37
|
+
// Because the shadow (s0) is visually 'part of' the button, we need to reduce
|
38
|
+
// the height of the button to compensate by adjusting its padding (s1) and
|
39
|
+
// increase the bottom margin to include it (s2).
|
40
|
+
$button-shadow-size: $govuk-border-width-form-element;
|
41
|
+
|
42
|
+
.govuk-button {
|
43
|
+
@include govuk-font($size: 19, $line-height: 19px);
|
44
|
+
|
45
|
+
box-sizing: border-box;
|
46
|
+
display: inline-block;
|
47
|
+
position: relative;
|
48
|
+
width: 100%;
|
49
|
+
margin-top: 0;
|
50
|
+
margin-right: 0;
|
51
|
+
margin-left: 0;
|
52
|
+
@include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2
|
53
|
+
padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2) (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)); // s1
|
54
|
+
border: $govuk-border-width-form-element solid transparent;
|
55
|
+
border-radius: 0;
|
56
|
+
color: $govuk-button-text-colour;
|
57
|
+
background-color: $govuk-button-colour;
|
58
|
+
box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
|
59
|
+
text-align: center;
|
60
|
+
vertical-align: top;
|
61
|
+
cursor: pointer;
|
62
|
+
-webkit-appearance: none;
|
63
|
+
|
64
|
+
@include _govuk-if-ie8 {
|
65
|
+
border-bottom: $button-shadow-size solid $govuk-button-shadow-colour;
|
66
|
+
}
|
67
|
+
|
68
|
+
@include govuk-media-query($from: tablet) {
|
69
|
+
width: auto;
|
70
|
+
}
|
71
|
+
|
72
|
+
// Ensure that any global link styles are overridden
|
73
|
+
&:link,
|
74
|
+
&:visited,
|
75
|
+
&:active,
|
76
|
+
&:hover {
|
77
|
+
color: $govuk-button-text-colour;
|
78
|
+
text-decoration: none;
|
79
|
+
}
|
80
|
+
|
81
|
+
// Fix unwanted button padding in Firefox
|
82
|
+
&::-moz-focus-inner {
|
83
|
+
padding: 0;
|
84
|
+
border: 0;
|
85
|
+
}
|
86
|
+
|
87
|
+
&:hover {
|
88
|
+
background-color: $govuk-button-hover-colour;
|
89
|
+
}
|
90
|
+
|
91
|
+
&:active {
|
92
|
+
// Bump the button down so it looks like its being pressed in
|
93
|
+
top: $button-shadow-size;
|
94
|
+
|
95
|
+
@include _govuk-if-ie8 {
|
96
|
+
border-bottom-width: 0;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
&:focus {
|
101
|
+
border-color: $govuk-focus-colour;
|
102
|
+
// When colours are overridden, for example when users have a dark mode,
|
103
|
+
// backgrounds and box-shadows disappear, so we need to ensure there's a
|
104
|
+
// transparent outline which will be set to a visible colour.
|
105
|
+
// Since Internet Explorer 8 does not support box-shadow, we want to force the user-agent outlines
|
106
|
+
@include _govuk-not-ie8 {
|
107
|
+
outline: $govuk-focus-width solid transparent;
|
108
|
+
}
|
109
|
+
// Since Internet Explorer does not support `:not()` we set a clearer focus style to match user-agent outlines.
|
110
|
+
@include _govuk-if-ie8 {
|
111
|
+
color: $govuk-focus-text-colour;
|
112
|
+
background-color: $govuk-focus-colour;
|
113
|
+
}
|
114
|
+
box-shadow: inset 0 0 0 1px $govuk-focus-colour;
|
115
|
+
}
|
116
|
+
|
117
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
118
|
+
// designed to make unvisited links a slightly darker blue when focussed, so
|
119
|
+
// we need to override the text colour for that combination of selectors so
|
120
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
121
|
+
// text when focussed.
|
122
|
+
@include _govuk-compatibility(govuk_template) {
|
123
|
+
&:link:focus {
|
124
|
+
color: $govuk-button-text-colour;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
&:focus:not(:active):not(:hover) {
|
129
|
+
border-color: $govuk-focus-colour;
|
130
|
+
color: $govuk-focus-text-colour;
|
131
|
+
background-color: $govuk-focus-colour;
|
132
|
+
box-shadow: 0 2px 0 $govuk-focus-text-colour;
|
133
|
+
}
|
134
|
+
|
135
|
+
// The following adjustments do not work for <input type="button"> as
|
136
|
+
// non-container elements cannot include pseudo elements (i.e. ::before).
|
137
|
+
|
138
|
+
// Use a pseudo element to expand the click target area to include the
|
139
|
+
// button's shadow as well, in case users try to click it.
|
140
|
+
&:before {
|
141
|
+
content: "";
|
142
|
+
display: block;
|
143
|
+
|
144
|
+
position: absolute;
|
145
|
+
|
146
|
+
top: -$govuk-border-width-form-element;
|
147
|
+
right: -$govuk-border-width-form-element;
|
148
|
+
bottom: -($govuk-border-width-form-element + $button-shadow-size);
|
149
|
+
left: -$govuk-border-width-form-element;
|
150
|
+
|
151
|
+
background: transparent;
|
152
|
+
}
|
153
|
+
|
154
|
+
// When the button is active it is shifted down by $button-shadow-size to
|
155
|
+
// denote a 'pressed' state. If the user happened to click at the very top
|
156
|
+
// of the button, their mouse is no longer over the button (because it has
|
157
|
+
// 'moved beneath them') and so the click event is not fired.
|
158
|
+
//
|
159
|
+
// This corrects that by shifting the top of the pseudo element so that it
|
160
|
+
// continues to cover the area that the user originally clicked, which means
|
161
|
+
// the click event is still fired.
|
162
|
+
//
|
163
|
+
// 🎉
|
164
|
+
&:active:before {
|
165
|
+
top: -($govuk-border-width-form-element + $button-shadow-size);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
// @deprecated Disabling buttons using the .govuk-button--disabled class is
|
170
|
+
// deprecated and will be removed in the next major version.
|
171
|
+
.govuk-button--disabled,
|
172
|
+
.govuk-button[disabled="disabled"],
|
173
|
+
.govuk-button[disabled] {
|
174
|
+
opacity: (.5);
|
175
|
+
|
176
|
+
&:hover {
|
177
|
+
background-color: $govuk-button-colour;
|
178
|
+
cursor: not-allowed;
|
179
|
+
}
|
180
|
+
|
181
|
+
&:active {
|
182
|
+
top: 0;
|
183
|
+
box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
|
184
|
+
@include _govuk-if-ie8 {
|
185
|
+
border-bottom: $button-shadow-size solid $govuk-button-shadow-colour; // s0
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
.govuk-button--secondary {
|
191
|
+
background-color: $govuk-secondary-button-colour;
|
192
|
+
box-shadow: 0 $button-shadow-size 0 $govuk-secondary-button-shadow-colour;
|
193
|
+
|
194
|
+
&,
|
195
|
+
&:link,
|
196
|
+
&:visited,
|
197
|
+
&:active,
|
198
|
+
&:hover {
|
199
|
+
color: $govuk-secondary-button-text-colour;
|
200
|
+
}
|
201
|
+
|
202
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
203
|
+
// designed to make unvisited links a slightly darker blue when focussed, so
|
204
|
+
// we need to override the text colour for that combination of selectors so
|
205
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
206
|
+
// text when focussed.
|
207
|
+
@include _govuk-compatibility(govuk_template) {
|
208
|
+
&:link:focus {
|
209
|
+
color: $govuk-secondary-button-text-colour;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
&:hover {
|
214
|
+
background-color: $govuk-secondary-button-hover-colour;
|
215
|
+
|
216
|
+
&[disabled] {
|
217
|
+
background-color: $govuk-secondary-button-colour;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
.govuk-button--warning {
|
223
|
+
background-color: $govuk-warning-button-colour;
|
224
|
+
box-shadow: 0 $button-shadow-size 0 $govuk-warning-button-shadow-colour;
|
225
|
+
|
226
|
+
&,
|
227
|
+
&:link,
|
228
|
+
&:visited,
|
229
|
+
&:active,
|
230
|
+
&:hover {
|
231
|
+
color: $govuk-warning-button-text-colour;
|
232
|
+
}
|
233
|
+
|
234
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
235
|
+
// designed to make unvisited links a slightly darker blue when focussed, so
|
236
|
+
// we need to override the text colour for that combination of selectors so
|
237
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
238
|
+
// text when focussed.
|
239
|
+
@include _govuk-compatibility(govuk_template) {
|
240
|
+
&:link:focus {
|
241
|
+
color: $govuk-warning-button-text-colour;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
&:hover {
|
246
|
+
background-color: $govuk-warning-button-hover-colour;
|
247
|
+
|
248
|
+
&[disabled] {
|
249
|
+
background-color: $govuk-warning-button-colour;
|
250
|
+
}
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
.govuk-button--start {
|
255
|
+
@include govuk-typography-weight-bold;
|
256
|
+
@include govuk-typography-responsive($size: 24, $override-line-height: 1);
|
257
|
+
|
258
|
+
display: -ms-inline-flexbox;
|
259
|
+
|
260
|
+
display: inline-flex;
|
261
|
+
min-height: auto;
|
262
|
+
|
263
|
+
-ms-flex-pack: center;
|
264
|
+
|
265
|
+
justify-content: center;
|
266
|
+
}
|
267
|
+
|
268
|
+
.govuk-button__start-icon {
|
269
|
+
margin-left: govuk-spacing(1);
|
270
|
+
|
271
|
+
@include govuk-media-query($from: desktop) {
|
272
|
+
margin-left: govuk-spacing(2);
|
273
|
+
}
|
274
|
+
vertical-align: middle;
|
275
|
+
-ms-flex-negative: 0;
|
276
|
+
flex-shrink: 0;
|
277
|
+
-ms-flex-item-align: center;
|
278
|
+
align-self: center;
|
279
|
+
// Work around SVGs not inheriting color from parent in forced color mode
|
280
|
+
// (https://github.com/w3c/csswg-drafts/issues/6310)
|
281
|
+
forced-color-adjust: auto;
|
282
|
+
}
|
283
|
+
|
284
|
+
@if $govuk-use-legacy-font {
|
285
|
+
// Begin adjustments for font baseline offset when using v1 of nta
|
286
|
+
$offset: 2;
|
287
|
+
|
288
|
+
.govuk-button {
|
289
|
+
padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
|
290
|
+
padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
|
291
|
+
}
|
292
|
+
|
293
|
+
.govuk-button__start-icon {
|
294
|
+
margin-top: -3px;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@import "../error-message/index";
|
2
|
+
@import "../hint/index";
|
3
|
+
@import "../label/index";
|
4
|
+
@import "../textarea/index";
|
5
|
+
|
6
|
+
@include govuk-exports("govuk/component/character-count") {
|
7
|
+
.govuk-character-count {
|
8
|
+
@include govuk-responsive-margin(6, "bottom");
|
9
|
+
|
10
|
+
.govuk-form-group,
|
11
|
+
.govuk-textarea {
|
12
|
+
margin-bottom: govuk-spacing(1);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
.govuk-character-count__message {
|
17
|
+
@include govuk-font($size: false, $tabular: true);
|
18
|
+
margin-top: 0;
|
19
|
+
margin-bottom: 0;
|
20
|
+
|
21
|
+
&:after {
|
22
|
+
// Zero-width space that will reserve vertical space when no hint is provided
|
23
|
+
// as:
|
24
|
+
// - setting a min-height is not possible without a magic number
|
25
|
+
// because the line-height is set by the `govuk-font` call above
|
26
|
+
// - using `:empty` is not possible as the hint macro outputs line breaks
|
27
|
+
content: "\200B";
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
.govuk-character-count__message--disabled {
|
32
|
+
visibility: hidden;
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,335 @@
|
|
1
|
+
@import "../error-message/index";
|
2
|
+
@import "../fieldset/index";
|
3
|
+
@import "../hint/index";
|
4
|
+
@import "../label/index";
|
5
|
+
|
6
|
+
@include govuk-exports("govuk/component/checkboxes") {
|
7
|
+
|
8
|
+
$govuk-touch-target-size: 44px;
|
9
|
+
$govuk-checkboxes-size: 40px;
|
10
|
+
$govuk-small-checkboxes-size: 24px;
|
11
|
+
$govuk-checkboxes-label-padding-left-right: govuk-spacing(3);
|
12
|
+
|
13
|
+
.govuk-checkboxes__item {
|
14
|
+
@include govuk-font($size: 19);
|
15
|
+
|
16
|
+
display: block;
|
17
|
+
position: relative;
|
18
|
+
|
19
|
+
min-height: $govuk-checkboxes-size;
|
20
|
+
|
21
|
+
margin-bottom: govuk-spacing(2);
|
22
|
+
padding-left: $govuk-checkboxes-size;
|
23
|
+
|
24
|
+
clear: left;
|
25
|
+
}
|
26
|
+
|
27
|
+
.govuk-checkboxes__item:last-child,
|
28
|
+
.govuk-checkboxes__item:last-of-type {
|
29
|
+
margin-bottom: 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
.govuk-checkboxes__input {
|
33
|
+
$input-offset: ($govuk-touch-target-size - $govuk-checkboxes-size) / 2;
|
34
|
+
|
35
|
+
cursor: pointer;
|
36
|
+
|
37
|
+
// IE8 doesn’t support pseudo-elements, so we don’t want to hide native
|
38
|
+
// elements there.
|
39
|
+
@include _govuk-not-ie8 {
|
40
|
+
position: absolute;
|
41
|
+
|
42
|
+
z-index: 1;
|
43
|
+
top: $input-offset * -1;
|
44
|
+
left: $input-offset * -1;
|
45
|
+
|
46
|
+
width: $govuk-touch-target-size;
|
47
|
+
height: $govuk-touch-target-size;
|
48
|
+
margin: 0;
|
49
|
+
|
50
|
+
opacity: 0;
|
51
|
+
}
|
52
|
+
|
53
|
+
@include _govuk-if-ie8 {
|
54
|
+
margin-top: 10px;
|
55
|
+
margin-right: $govuk-checkboxes-size / -2;
|
56
|
+
margin-left: $govuk-checkboxes-size / -2;
|
57
|
+
float: left;
|
58
|
+
|
59
|
+
// add focus outline to input
|
60
|
+
&:focus {
|
61
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
.govuk-checkboxes__label {
|
67
|
+
display: inline-block;
|
68
|
+
margin-bottom: 0;
|
69
|
+
padding: 8px $govuk-checkboxes-label-padding-left-right govuk-spacing(1);
|
70
|
+
cursor: pointer;
|
71
|
+
// remove 300ms pause on mobile
|
72
|
+
-ms-touch-action: manipulation;
|
73
|
+
touch-action: manipulation;
|
74
|
+
}
|
75
|
+
|
76
|
+
@include _govuk-not-ie8 {
|
77
|
+
// [ ] Check box
|
78
|
+
.govuk-checkboxes__label:before {
|
79
|
+
content: "";
|
80
|
+
box-sizing: border-box;
|
81
|
+
position: absolute;
|
82
|
+
top: 0;
|
83
|
+
left: 0;
|
84
|
+
width: $govuk-checkboxes-size;
|
85
|
+
height: $govuk-checkboxes-size;
|
86
|
+
border: $govuk-border-width-form-element solid currentcolor;
|
87
|
+
background: transparent;
|
88
|
+
}
|
89
|
+
|
90
|
+
// ✔ Check mark
|
91
|
+
//
|
92
|
+
// The check mark is a box with a border on the left and bottom side (└──),
|
93
|
+
// rotated 45 degrees
|
94
|
+
.govuk-checkboxes__label:after {
|
95
|
+
content: "";
|
96
|
+
box-sizing: border-box;
|
97
|
+
|
98
|
+
position: absolute;
|
99
|
+
top: 11px;
|
100
|
+
left: 9px;
|
101
|
+
width: 23px;
|
102
|
+
height: 12px;
|
103
|
+
|
104
|
+
-webkit-transform: rotate(-45deg);
|
105
|
+
|
106
|
+
-ms-transform: rotate(-45deg);
|
107
|
+
|
108
|
+
transform: rotate(-45deg);
|
109
|
+
border: solid;
|
110
|
+
border-width: 0 0 5px 5px;
|
111
|
+
// Fix bug in IE11 caused by transform rotate (-45deg).
|
112
|
+
// See: alphagov/govuk_elements/issues/518
|
113
|
+
border-top-color: transparent;
|
114
|
+
|
115
|
+
opacity: 0;
|
116
|
+
|
117
|
+
background: transparent;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
.govuk-checkboxes__hint {
|
122
|
+
display: block;
|
123
|
+
padding-right: $govuk-checkboxes-label-padding-left-right;
|
124
|
+
padding-left: $govuk-checkboxes-label-padding-left-right;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Focused state
|
128
|
+
.govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
129
|
+
border-width: 4px;
|
130
|
+
|
131
|
+
// When colours are overridden, the yellow box-shadow becomes invisible
|
132
|
+
// which means the focus state is less obvious. By adding a transparent
|
133
|
+
// outline, which becomes solid (text-coloured) in that context, we ensure
|
134
|
+
// the focus remains clearly visible.
|
135
|
+
outline: $govuk-focus-width solid transparent;
|
136
|
+
outline-offset: 1px;
|
137
|
+
|
138
|
+
// When in an explicit forced-color mode, we can use the Highlight system
|
139
|
+
// color for the outline to better match focus states of native controls
|
140
|
+
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
|
141
|
+
outline-color: Highlight;
|
142
|
+
}
|
143
|
+
|
144
|
+
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
145
|
+
}
|
146
|
+
|
147
|
+
// Selected state
|
148
|
+
.govuk-checkboxes__input:checked + .govuk-checkboxes__label:after {
|
149
|
+
opacity: 1;
|
150
|
+
}
|
151
|
+
|
152
|
+
// Disabled state
|
153
|
+
.govuk-checkboxes__input:disabled,
|
154
|
+
.govuk-checkboxes__input:disabled + .govuk-checkboxes__label {
|
155
|
+
cursor: not-allowed;
|
156
|
+
}
|
157
|
+
|
158
|
+
.govuk-checkboxes__input:disabled + .govuk-checkboxes__label,
|
159
|
+
.govuk-checkboxes__input:disabled ~ .govuk-hint {
|
160
|
+
opacity: .5;
|
161
|
+
}
|
162
|
+
|
163
|
+
// =========================================================
|
164
|
+
// Dividers ('or')
|
165
|
+
// =========================================================
|
166
|
+
|
167
|
+
.govuk-checkboxes__divider {
|
168
|
+
$govuk-divider-size: $govuk-checkboxes-size !default;
|
169
|
+
@include govuk-font($size: 19);
|
170
|
+
@include govuk-text-colour;
|
171
|
+
width: $govuk-divider-size;
|
172
|
+
margin-bottom: govuk-spacing(2);
|
173
|
+
text-align: center;
|
174
|
+
}
|
175
|
+
|
176
|
+
// =========================================================
|
177
|
+
// Conditional reveals
|
178
|
+
// =========================================================
|
179
|
+
|
180
|
+
// The narrow border is used in the conditional reveals because the border has
|
181
|
+
// to be an even number in order to be centred under the 40px checkbox or radio.
|
182
|
+
$conditional-border-width: $govuk-border-width-narrow;
|
183
|
+
// Calculate the amount of padding needed to keep the border centered against the checkbox.
|
184
|
+
$conditional-border-padding: ($govuk-checkboxes-size / 2) - ($conditional-border-width / 2);
|
185
|
+
// Move the border centered with the checkbox
|
186
|
+
$conditional-margin-left: $conditional-border-padding;
|
187
|
+
// Move the contents of the conditional inline with the label
|
188
|
+
$conditional-padding-left: $conditional-border-padding + $govuk-checkboxes-label-padding-left-right;
|
189
|
+
|
190
|
+
.govuk-checkboxes__conditional {
|
191
|
+
@include govuk-responsive-margin(4, "bottom");
|
192
|
+
margin-left: $conditional-margin-left;
|
193
|
+
padding-left: $conditional-padding-left;
|
194
|
+
border-left: $conditional-border-width solid $govuk-border-colour;
|
195
|
+
|
196
|
+
.js-enabled &--hidden {
|
197
|
+
display: none;
|
198
|
+
}
|
199
|
+
|
200
|
+
& > :last-child {
|
201
|
+
margin-bottom: 0;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
// =========================================================
|
206
|
+
// Small checkboxes
|
207
|
+
// =========================================================
|
208
|
+
|
209
|
+
.govuk-checkboxes--small {
|
210
|
+
|
211
|
+
$input-offset: ($govuk-touch-target-size - $govuk-small-checkboxes-size) / 2;
|
212
|
+
$label-offset: $govuk-touch-target-size - $input-offset;
|
213
|
+
|
214
|
+
.govuk-checkboxes__item {
|
215
|
+
@include govuk-clearfix;
|
216
|
+
min-height: 0;
|
217
|
+
margin-bottom: 0;
|
218
|
+
padding-left: $label-offset;
|
219
|
+
float: left;
|
220
|
+
}
|
221
|
+
|
222
|
+
// Shift the touch target into the left margin so that the visible edge of
|
223
|
+
// the control is aligned
|
224
|
+
//
|
225
|
+
// ┆What colours do you like?
|
226
|
+
// ┌┆───┐
|
227
|
+
// │┆[] │ Purple
|
228
|
+
// └┆▲──┘
|
229
|
+
// ▲┆└─ Check box pseudo element, aligned with margin
|
230
|
+
// └─── Touch target (invisible input), shifted into the margin
|
231
|
+
.govuk-checkboxes__input {
|
232
|
+
@include _govuk-not-ie8 {
|
233
|
+
left: $input-offset * -1;
|
234
|
+
}
|
235
|
+
|
236
|
+
@include _govuk-if-ie8 {
|
237
|
+
margin-left: $govuk-small-checkboxes-size * -1;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
// Adjust the size and position of the label.
|
242
|
+
//
|
243
|
+
// Unlike larger checkboxes, we also have to float the label in order to
|
244
|
+
// 'shrink' it, preventing the hover state from kicking in across the full
|
245
|
+
// width of the parent element.
|
246
|
+
.govuk-checkboxes__label {
|
247
|
+
margin-top: -2px;
|
248
|
+
padding: 13px govuk-spacing(3) 13px 1px;
|
249
|
+
float: left;
|
250
|
+
|
251
|
+
@include govuk-media-query($from: tablet) {
|
252
|
+
padding: 11px govuk-spacing(3) 10px 1px;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
// [ ] Check box
|
257
|
+
//
|
258
|
+
// Reduce the size of the check box [1], vertically center it within the
|
259
|
+
// touch target [2]
|
260
|
+
.govuk-checkboxes__label:before {
|
261
|
+
top: $input-offset - $govuk-border-width-form-element; // 2
|
262
|
+
width: $govuk-small-checkboxes-size; // 1
|
263
|
+
height: $govuk-small-checkboxes-size; // 1
|
264
|
+
}
|
265
|
+
|
266
|
+
// ✔ Check mark
|
267
|
+
//
|
268
|
+
// Reduce the size of the check mark and re-align within the checkbox
|
269
|
+
.govuk-checkboxes__label:after {
|
270
|
+
top: 15px;
|
271
|
+
left: 6px;
|
272
|
+
width: 12px;
|
273
|
+
height: 6.5px;
|
274
|
+
border-width: 0 0 3px 3px;
|
275
|
+
}
|
276
|
+
|
277
|
+
// Fix position of hint with small checkboxes
|
278
|
+
//
|
279
|
+
// Do not use hints with small checkboxes – because they're within the input
|
280
|
+
// wrapper they trigger the hover state, but clicking them doesn't actually
|
281
|
+
// activate the control.
|
282
|
+
//
|
283
|
+
// (If you do use them, they won't look completely broken... but seriously,
|
284
|
+
// don't use them)
|
285
|
+
.govuk-checkboxes__hint {
|
286
|
+
padding: 0;
|
287
|
+
clear: both;
|
288
|
+
}
|
289
|
+
|
290
|
+
// Align conditional reveals with small checkboxes
|
291
|
+
.govuk-checkboxes__conditional {
|
292
|
+
$margin-left: ($govuk-small-checkboxes-size / 2) - ($conditional-border-width / 2);
|
293
|
+
margin-left: $margin-left;
|
294
|
+
padding-left: $label-offset - ($margin-left + $conditional-border-width);
|
295
|
+
clear: both;
|
296
|
+
}
|
297
|
+
|
298
|
+
// Hover state for small checkboxes.
|
299
|
+
//
|
300
|
+
// We use a hover state for small checkboxes because the touch target size
|
301
|
+
// is so much larger than their visible size, and so we need to provide
|
302
|
+
// feedback to the user as to which checkbox they will select when their
|
303
|
+
// cursor is outside of the visible area.
|
304
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
|
305
|
+
box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
|
306
|
+
}
|
307
|
+
|
308
|
+
// Because we've overridden the border-shadow provided by the focus state,
|
309
|
+
// we need to redefine that too.
|
310
|
+
//
|
311
|
+
// We use two box shadows, one that restores the original focus state [1]
|
312
|
+
// and another that then applies the hover state [2].
|
313
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
314
|
+
box-shadow:
|
315
|
+
0 0 0 $govuk-focus-width $govuk-focus-colour, // 1
|
316
|
+
0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
|
317
|
+
}
|
318
|
+
|
319
|
+
// For devices that explicitly don't support hover, don't provide a hover
|
320
|
+
// state (e.g. on touch devices like iOS).
|
321
|
+
//
|
322
|
+
// We can't use `@media (hover: hover)` because we wouldn't get the hover
|
323
|
+
// state in browsers that don't support `@media (hover)` (like Internet
|
324
|
+
// Explorer) – so we have to 'undo' the hover state instead.
|
325
|
+
@media (hover: none), (pointer: coarse) {
|
326
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
|
327
|
+
box-shadow: initial;
|
328
|
+
}
|
329
|
+
|
330
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
331
|
+
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
332
|
+
}
|
333
|
+
}
|
334
|
+
}
|
335
|
+
}
|