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,429 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers/links
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Common link styles
|
6
|
+
///
|
7
|
+
/// Provides the typography and focus state, regardless of link style.
|
8
|
+
///
|
9
|
+
/// @access public
|
10
|
+
|
11
|
+
@mixin govuk-link-common {
|
12
|
+
@include govuk-typography-common;
|
13
|
+
@include govuk-link-decoration;
|
14
|
+
|
15
|
+
&:hover {
|
16
|
+
@include govuk-link-hover-decoration;
|
17
|
+
}
|
18
|
+
|
19
|
+
&:focus {
|
20
|
+
@include govuk-focused-text;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
/// Link decoration
|
25
|
+
///
|
26
|
+
/// Provides the text decoration for links, including thickness and underline
|
27
|
+
/// offset. Use this mixin only if you cannot use the `govuk-link-common` mixin.
|
28
|
+
///
|
29
|
+
/// @access public
|
30
|
+
@mixin govuk-link-decoration {
|
31
|
+
text-decoration: underline;
|
32
|
+
|
33
|
+
@if $govuk-new-link-styles {
|
34
|
+
@if $govuk-link-underline-thickness {
|
35
|
+
text-decoration-thickness: $govuk-link-underline-thickness;
|
36
|
+
}
|
37
|
+
|
38
|
+
@if $govuk-link-underline-offset {
|
39
|
+
text-underline-offset: $govuk-link-underline-offset;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
/// Link hover decoration
|
45
|
+
///
|
46
|
+
/// Provides the text decoration for links in their hover state, for you to use
|
47
|
+
/// within a `:hover` pseudo-selector. Use this mixin only if you cannot use the
|
48
|
+
/// `govuk-link-common` mixin.
|
49
|
+
///
|
50
|
+
/// @access public
|
51
|
+
|
52
|
+
@mixin govuk-link-hover-decoration {
|
53
|
+
@if $govuk-new-link-styles and $govuk-link-hover-underline-thickness {
|
54
|
+
text-decoration-thickness: $govuk-link-hover-underline-thickness;
|
55
|
+
// Disable ink skipping on underlines on hover. Browsers haven't
|
56
|
+
// standardised on this part of the spec yet, so set both properties
|
57
|
+
-webkit-text-decoration-skip-ink: none;
|
58
|
+
text-decoration-skip-ink: none; // Chromium, Firefox
|
59
|
+
-webkit-text-decoration-skip: none;
|
60
|
+
text-decoration-skip: none; // Safari
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
/// Default link styles
|
65
|
+
///
|
66
|
+
/// Makes links use the default unvisited, visited, hover and active colours.
|
67
|
+
///
|
68
|
+
/// If you use this mixin in a component, you must also include the
|
69
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
70
|
+
///
|
71
|
+
/// @example scss
|
72
|
+
/// .govuk-component__link {
|
73
|
+
/// @include govuk-link-common;
|
74
|
+
/// @include govuk-link-style-default;
|
75
|
+
/// }
|
76
|
+
///
|
77
|
+
/// @access public
|
78
|
+
|
79
|
+
@mixin govuk-link-style-default {
|
80
|
+
&:link {
|
81
|
+
color: $govuk-link-colour;
|
82
|
+
}
|
83
|
+
|
84
|
+
&:visited {
|
85
|
+
color: $govuk-link-visited-colour;
|
86
|
+
}
|
87
|
+
|
88
|
+
&:hover {
|
89
|
+
color: $govuk-link-hover-colour;
|
90
|
+
}
|
91
|
+
|
92
|
+
&:active {
|
93
|
+
color: $govuk-link-active-colour;
|
94
|
+
}
|
95
|
+
|
96
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
97
|
+
// contrast is still acceptable
|
98
|
+
&:focus {
|
99
|
+
color: $govuk-focus-text-colour;
|
100
|
+
}
|
101
|
+
|
102
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
103
|
+
// designed to make unvisited link s a slightly darker blue when focussed, so
|
104
|
+
// we need to override the text colour for that combination of selectors so
|
105
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
106
|
+
// text when focussed.
|
107
|
+
@include _govuk-compatibility(govuk_template) {
|
108
|
+
&:link:focus {
|
109
|
+
color: $govuk-focus-text-colour;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
/// Error link styles
|
115
|
+
///
|
116
|
+
/// Makes links use the error colour. The link will darken if it's active or a
|
117
|
+
/// user hovers their cursor over it.
|
118
|
+
///
|
119
|
+
/// If you use this mixin in a component, you must also include the
|
120
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
121
|
+
///
|
122
|
+
/// @example scss
|
123
|
+
/// .govuk-component__link {
|
124
|
+
/// @include govuk-link-common;
|
125
|
+
/// @include govuk-link-style-error;
|
126
|
+
/// }
|
127
|
+
///
|
128
|
+
/// @access public
|
129
|
+
|
130
|
+
@mixin govuk-link-style-error {
|
131
|
+
&:link,
|
132
|
+
&:visited {
|
133
|
+
color: $govuk-error-colour;
|
134
|
+
}
|
135
|
+
|
136
|
+
&:hover {
|
137
|
+
color: scale-color($govuk-error-colour, $lightness: -30%);
|
138
|
+
}
|
139
|
+
|
140
|
+
&:active {
|
141
|
+
color: $govuk-error-colour;
|
142
|
+
}
|
143
|
+
|
144
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
145
|
+
// contrast is still acceptable
|
146
|
+
&:focus {
|
147
|
+
color: $govuk-focus-text-colour;
|
148
|
+
}
|
149
|
+
|
150
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
151
|
+
// designed to make unvisited link s a slightly darker blue when focussed, so
|
152
|
+
// we need to override the text colour for that combination of selectors so
|
153
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
154
|
+
// text when focussed.
|
155
|
+
@include _govuk-compatibility(govuk_template) {
|
156
|
+
&:link:focus {
|
157
|
+
color: $govuk-focus-text-colour;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/// Success link styles
|
163
|
+
///
|
164
|
+
/// Makes links use the success colour. The link will darken if it's active or a
|
165
|
+
/// user hovers their cursor over it.
|
166
|
+
///
|
167
|
+
/// If you use this mixin in a component, you must also include the
|
168
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
169
|
+
///
|
170
|
+
/// @example scss
|
171
|
+
/// .govuk-component__link {
|
172
|
+
/// @include govuk-link-common;
|
173
|
+
/// @include govuk-link-style-success;
|
174
|
+
/// }
|
175
|
+
///
|
176
|
+
/// @access public
|
177
|
+
|
178
|
+
@mixin govuk-link-style-success {
|
179
|
+
&:link,
|
180
|
+
&:visited {
|
181
|
+
color: $govuk-success-colour;
|
182
|
+
}
|
183
|
+
|
184
|
+
&:hover {
|
185
|
+
color: scale-color($govuk-success-colour, $lightness: -30%);
|
186
|
+
}
|
187
|
+
|
188
|
+
&:active {
|
189
|
+
color: $govuk-success-colour;
|
190
|
+
}
|
191
|
+
|
192
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
193
|
+
// contrast is still acceptable
|
194
|
+
&:focus {
|
195
|
+
color: $govuk-focus-text-colour;
|
196
|
+
}
|
197
|
+
|
198
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
199
|
+
// designed to make unvisited link s a slightly darker blue when focussed, so
|
200
|
+
// we need to override the text colour for that combination of selectors so
|
201
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
202
|
+
// text when focussed.
|
203
|
+
@include _govuk-compatibility(govuk_template) {
|
204
|
+
&:link:focus {
|
205
|
+
color: $govuk-focus-text-colour;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
/// Muted link styles
|
211
|
+
///
|
212
|
+
/// Makes links use the secondary text colour. The link will darken if it's
|
213
|
+
/// active or a user hovers their cursor over it.
|
214
|
+
///
|
215
|
+
/// If you use this mixin in a component, you must also include the
|
216
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
217
|
+
///
|
218
|
+
/// @example scss
|
219
|
+
/// .govuk-component__link {
|
220
|
+
/// @include govuk-link-common;
|
221
|
+
/// @include govuk-link-style-muted;
|
222
|
+
/// }
|
223
|
+
///
|
224
|
+
/// @access public
|
225
|
+
|
226
|
+
@mixin govuk-link-style-muted {
|
227
|
+
&:link,
|
228
|
+
&:visited {
|
229
|
+
color: $govuk-secondary-text-colour;
|
230
|
+
}
|
231
|
+
|
232
|
+
&:hover,
|
233
|
+
&:active {
|
234
|
+
color: $govuk-text-colour;
|
235
|
+
}
|
236
|
+
|
237
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
238
|
+
// contrast is still acceptable
|
239
|
+
&:focus {
|
240
|
+
color: $govuk-focus-text-colour;
|
241
|
+
}
|
242
|
+
|
243
|
+
// alphagov/govuk_template includes a specific a:link:focus selector designed
|
244
|
+
// to make unvisited links a slightly darker blue when focussed, so we need to
|
245
|
+
// override the text colour for that combination of selectors.
|
246
|
+
@include _govuk-compatibility(govuk_template) {
|
247
|
+
&:link:focus {
|
248
|
+
@include govuk-text-colour;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
/// Text link styles
|
254
|
+
///
|
255
|
+
/// Makes links use the primary text colour, in all states. Use this mixin for
|
256
|
+
/// navigation components, such as breadcrumbs or the back link.
|
257
|
+
///
|
258
|
+
/// If you use this mixin in a component, you must also include the
|
259
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
260
|
+
///
|
261
|
+
/// @example scss
|
262
|
+
/// .govuk-component__link {
|
263
|
+
/// @include govuk-link-common;
|
264
|
+
/// @include govuk-link-style-text;
|
265
|
+
/// }
|
266
|
+
///
|
267
|
+
/// @access public
|
268
|
+
|
269
|
+
@mixin govuk-link-style-text {
|
270
|
+
&:link,
|
271
|
+
&:visited {
|
272
|
+
@include govuk-text-colour;
|
273
|
+
}
|
274
|
+
|
275
|
+
// Force a colour change on hover to work around a bug in Safari
|
276
|
+
// https://bugs.webkit.org/show_bug.cgi?id=224483
|
277
|
+
&:hover {
|
278
|
+
@if type-of($govuk-text-colour) == color {
|
279
|
+
color: rgba($govuk-text-colour, .99);
|
280
|
+
}
|
281
|
+
}
|
282
|
+
|
283
|
+
&:active,
|
284
|
+
&:focus {
|
285
|
+
@include govuk-text-colour;
|
286
|
+
}
|
287
|
+
|
288
|
+
// alphagov/govuk_template includes a specific a:link:focus selector designed
|
289
|
+
// to make unvisited links a slightly darker blue when focussed, so we need to
|
290
|
+
// override the text colour for that combination of selectors.
|
291
|
+
@include _govuk-compatibility(govuk_template) {
|
292
|
+
&:link:focus {
|
293
|
+
@include govuk-text-colour;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
/// Inverse link styles
|
299
|
+
///
|
300
|
+
/// Makes links white, in all states. Use this mixin if you're displaying links
|
301
|
+
/// against a dark background.
|
302
|
+
///
|
303
|
+
/// If you use this mixin in a component, you must also include the
|
304
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
305
|
+
///
|
306
|
+
/// @example scss
|
307
|
+
/// .govuk-component__link {
|
308
|
+
/// @include govuk-link-common;
|
309
|
+
/// @include govuk-link-style-inverse;
|
310
|
+
/// }
|
311
|
+
///
|
312
|
+
/// @access public
|
313
|
+
|
314
|
+
@mixin govuk-link-style-inverse {
|
315
|
+
&:link,
|
316
|
+
&:visited {
|
317
|
+
color: govuk-colour("white");
|
318
|
+
}
|
319
|
+
|
320
|
+
// Force a colour change on hover to work around a bug in Safari
|
321
|
+
// https://bugs.webkit.org/show_bug.cgi?id=224483
|
322
|
+
&:hover,
|
323
|
+
&:active {
|
324
|
+
color: rgba(govuk-colour("white"), .99);
|
325
|
+
}
|
326
|
+
|
327
|
+
&:focus {
|
328
|
+
color: $govuk-focus-text-colour;
|
329
|
+
}
|
330
|
+
|
331
|
+
// alphagov/govuk_template includes a specific a:link:focus selector designed
|
332
|
+
// to make unvisited links a slightly darker blue when focussed, so we need to
|
333
|
+
// override the text colour for that combination of selectors.
|
334
|
+
@include _govuk-compatibility(govuk_template) {
|
335
|
+
&:link:focus {
|
336
|
+
color: $govuk-focus-text-colour;
|
337
|
+
}
|
338
|
+
}
|
339
|
+
}
|
340
|
+
|
341
|
+
/// Default link styles, without a visited state
|
342
|
+
///
|
343
|
+
/// Makes links use the default unvisited, hover and active colours, with no
|
344
|
+
/// distinct visited state.
|
345
|
+
///
|
346
|
+
/// Use this mixin when it's not helpful to distinguish between visited and
|
347
|
+
/// non-visited links. For example, when you link to pages with
|
348
|
+
/// frequently-changing content, such as the dashboard for an admin interface.
|
349
|
+
///
|
350
|
+
/// If you use this mixin in a component, you must also include the
|
351
|
+
/// `govuk-link-common` mixin to get the correct focus and hover states.
|
352
|
+
///
|
353
|
+
/// @example scss
|
354
|
+
/// .govuk-component__link {
|
355
|
+
/// @include govuk-link-common;
|
356
|
+
/// @include govuk-link-style-no-visited-state;
|
357
|
+
/// }
|
358
|
+
///
|
359
|
+
/// @access public
|
360
|
+
|
361
|
+
@mixin govuk-link-style-no-visited-state {
|
362
|
+
&:link {
|
363
|
+
color: $govuk-link-colour;
|
364
|
+
}
|
365
|
+
|
366
|
+
&:visited {
|
367
|
+
color: $govuk-link-colour;
|
368
|
+
}
|
369
|
+
|
370
|
+
&:hover {
|
371
|
+
color: $govuk-link-hover-colour;
|
372
|
+
}
|
373
|
+
|
374
|
+
&:active {
|
375
|
+
color: $govuk-link-active-colour;
|
376
|
+
}
|
377
|
+
|
378
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
379
|
+
// contrast is still acceptable
|
380
|
+
&:focus {
|
381
|
+
color: $govuk-focus-text-colour;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
/// Remove underline from links
|
386
|
+
///
|
387
|
+
/// Remove underlines from links unless the link is active or a user hovers
|
388
|
+
/// their cursor over it. This has no effect in Internet Explorer 8 (IE8),
|
389
|
+
/// because IE8 does not support `:not`.
|
390
|
+
///
|
391
|
+
/// @example scss
|
392
|
+
/// .govuk-component__link {
|
393
|
+
/// @include govuk-link-common;
|
394
|
+
/// @include govuk-link-style-default;
|
395
|
+
/// @include govuk-link-style-no-underline;
|
396
|
+
/// }
|
397
|
+
///
|
398
|
+
/// @access public
|
399
|
+
|
400
|
+
@mixin govuk-link-style-no-underline {
|
401
|
+
&:not(:hover):not(:active) {
|
402
|
+
text-decoration: none;
|
403
|
+
}
|
404
|
+
}
|
405
|
+
|
406
|
+
/// Include link destination when printing the page
|
407
|
+
///
|
408
|
+
/// If the user prints the page, add the destination URL after the link text, if
|
409
|
+
/// the URL starts with `/`, `http://` or `https://`.
|
410
|
+
///
|
411
|
+
/// @access public
|
412
|
+
|
413
|
+
@mixin govuk-link-print-friendly {
|
414
|
+
@include govuk-media-query($media-type: print) {
|
415
|
+
&[href^="/"],
|
416
|
+
&[href^="http://"],
|
417
|
+
&[href^="https://"] {
|
418
|
+
&:after {
|
419
|
+
content: " (" attr(href) ")";
|
420
|
+
font-size: 90%;
|
421
|
+
|
422
|
+
// Because the URLs may be very long, ensure that they may be broken
|
423
|
+
// at arbitrary points if there are no otherwise acceptable break
|
424
|
+
// points in the line
|
425
|
+
word-wrap: break-word;
|
426
|
+
}
|
427
|
+
}
|
428
|
+
}
|
429
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers/layout
|
3
|
+
////
|
4
|
+
|
5
|
+
// =========================================================
|
6
|
+
// Wrangle sass-mq config...
|
7
|
+
// =========================================================
|
8
|
+
|
9
|
+
// Pass our breakpoints and static breakpoint definitions through to sass-mq.
|
10
|
+
$mq-breakpoints: if(variable-exists(govuk-breakpoints), $govuk-breakpoints, ());
|
11
|
+
$mq-static-breakpoint: if(variable-exists(govuk-ie8-breakpoint), $govuk-ie8-breakpoint, desktop);
|
12
|
+
|
13
|
+
$mq-show-breakpoints: ();
|
14
|
+
|
15
|
+
@if variable-exists(govuk-show-breakpoints) and $govuk-show-breakpoints {
|
16
|
+
$mq-show-breakpoints: map-keys($govuk-breakpoints);
|
17
|
+
}
|
18
|
+
|
19
|
+
// When building a stylesheet for IE8, set $mq-responsive to false in order to
|
20
|
+
// 'rasterize' any media queries.
|
21
|
+
|
22
|
+
$mq-responsive: true;
|
23
|
+
@if variable-exists(govuk-is-ie8) and $govuk-is-ie8 {
|
24
|
+
$mq-responsive: false;
|
25
|
+
}
|
26
|
+
|
27
|
+
// This is a horrible, horrible hack to prevent the 'dev mode' CSS to display
|
28
|
+
// the current breakpoint from being included multiple times.
|
29
|
+
//
|
30
|
+
// We can't use the `exports` mixin for this because import directives cannot be
|
31
|
+
// used within control directives 😠
|
32
|
+
$sass-mq-already-included: false !default;
|
33
|
+
|
34
|
+
@if $sass-mq-already-included {
|
35
|
+
$mq-show-breakpoints: ();
|
36
|
+
}
|
37
|
+
|
38
|
+
@import "../vendor/sass-mq";
|
39
|
+
|
40
|
+
$sass-mq-already-included: true;
|
41
|
+
|
42
|
+
// =========================================================
|
43
|
+
// Helpers
|
44
|
+
// =========================================================
|
45
|
+
|
46
|
+
/// Media Query
|
47
|
+
///
|
48
|
+
/// This is a currently a wrapper for sass-mq - abstracted so that we can
|
49
|
+
/// replace it in the future if we so choose.
|
50
|
+
///
|
51
|
+
/// @param {String | Boolean} $from [false] - One of $govuk-breakpoints
|
52
|
+
/// @param {String | Boolean} $until [false] - One of $govuk-breakpoints
|
53
|
+
/// @param {String | Boolean} $and [false] - Additional media query parameters
|
54
|
+
/// @param {String} $media-type [all] - Media type: screen, print…
|
55
|
+
///
|
56
|
+
/// @ignore Undocumented mq API, for advanced use only:
|
57
|
+
/// @ignore @param {Map} $breakpoints [$govuk-breakpoints]
|
58
|
+
/// @ignore @param {String} $static-breakpoint [$govuk-ie8-breakpoint]
|
59
|
+
/// @ignore @param {Boolean} $responsive [$govuk-is-ie8]
|
60
|
+
///
|
61
|
+
/// @content styling rules, wrapped into a @media query when $responsive is true
|
62
|
+
///
|
63
|
+
/// @example scss
|
64
|
+
/// .element {
|
65
|
+
/// @include govuk-media-query($from: mobile) {
|
66
|
+
/// color: red;
|
67
|
+
/// }
|
68
|
+
/// @include govuk-media-query($until: tablet) {
|
69
|
+
/// color: blue;
|
70
|
+
/// }
|
71
|
+
/// @include govuk-media-query(mobile, tablet) {
|
72
|
+
/// color: green;
|
73
|
+
/// }
|
74
|
+
/// @include govuk-media-query($from: tablet, $and: '(orientation: landscape)') {
|
75
|
+
/// color: teal;
|
76
|
+
/// }
|
77
|
+
/// @include govuk-media-query(950px) {
|
78
|
+
/// color: hotpink;
|
79
|
+
/// }
|
80
|
+
/// @include govuk-media-query(tablet, $media-type: screen) {
|
81
|
+
/// color: hotpink;
|
82
|
+
/// }
|
83
|
+
/// }
|
84
|
+
///
|
85
|
+
/// @access public
|
86
|
+
|
87
|
+
@mixin govuk-media-query($args...) {
|
88
|
+
@include mq($args...) {
|
89
|
+
@content;
|
90
|
+
}
|
91
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers/shapes
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Calculate the height of an equilateral triangle
|
6
|
+
///
|
7
|
+
/// Multiplying half the length of the base of an equilateral triangle by the
|
8
|
+
/// square root of three gives us its height. We use 1.732 as an approximation.
|
9
|
+
///
|
10
|
+
/// @param {Number} $base - Length of the base of the triangle
|
11
|
+
/// @return {Number} Calculated height of the triangle
|
12
|
+
/// @access private
|
13
|
+
|
14
|
+
@function _govuk-equilateral-height($base) {
|
15
|
+
$square-root-of-three: 1.732;
|
16
|
+
|
17
|
+
@return ($base / 2) * $square-root-of-three;
|
18
|
+
}
|
19
|
+
|
20
|
+
/// Arrow mixin
|
21
|
+
///
|
22
|
+
/// Generate Arrows (triangles) by using a mix of transparent (1) and coloured
|
23
|
+
/// borders. The coloured borders inherit the text colour of the element (2).
|
24
|
+
///
|
25
|
+
/// Ensure the arrow is rendered correctly if browser colours are overridden by
|
26
|
+
/// providing a clip path (3). Without this the transparent borders are
|
27
|
+
/// overridden to become visible which results in a square.
|
28
|
+
///
|
29
|
+
/// We need both because older browsers do not support clip-path.
|
30
|
+
///
|
31
|
+
/// @param {String} $direction - Direction for arrow: up, right, down, left.
|
32
|
+
/// @param {Number} $base - Length of the triangle 'base' side
|
33
|
+
/// @param {Number} $height [null] - Height of triangle. Omit for equilateral.
|
34
|
+
/// @param {String} $display [block] - CSS display property of the arrow
|
35
|
+
///
|
36
|
+
/// @access public
|
37
|
+
|
38
|
+
@mixin govuk-shape-arrow($direction, $base, $height: null, $display: block) {
|
39
|
+
display: $display;
|
40
|
+
|
41
|
+
width: 0;
|
42
|
+
height: 0;
|
43
|
+
|
44
|
+
border-style: solid;
|
45
|
+
border-color: transparent; // 1
|
46
|
+
|
47
|
+
$perpendicular: $base / 2;
|
48
|
+
|
49
|
+
@if not $height {
|
50
|
+
$height: _govuk-equilateral-height($base);
|
51
|
+
}
|
52
|
+
|
53
|
+
@if $direction == "up" {
|
54
|
+
-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
|
55
|
+
clip-path: polygon(50% 0%, 0% 100%, 100% 100%); // 3
|
56
|
+
|
57
|
+
border-width: 0 $perpendicular $height $perpendicular;
|
58
|
+
border-bottom-color: inherit; // 2
|
59
|
+
} @else if $direction == "right" {
|
60
|
+
-webkit-clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
|
61
|
+
clip-path: polygon(0% 0%, 100% 50%, 0% 100%); // 3
|
62
|
+
|
63
|
+
border-width: $perpendicular 0 $perpendicular $height;
|
64
|
+
border-left-color: inherit; // 2
|
65
|
+
} @else if $direction == "down" {
|
66
|
+
-webkit-clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
|
67
|
+
clip-path: polygon(0% 0%, 50% 100%, 100% 0%); // 3
|
68
|
+
|
69
|
+
border-width: $height $perpendicular 0 $perpendicular;
|
70
|
+
border-top-color: inherit; // 2
|
71
|
+
} @else if $direction == "left" {
|
72
|
+
-webkit-clip-path: polygon(0% 50%, 100% 100%, 100% 0%);
|
73
|
+
clip-path: polygon(0% 50%, 100% 100%, 100% 0%); // 3
|
74
|
+
|
75
|
+
border-width: $perpendicular $height $perpendicular 0;
|
76
|
+
border-right-color: inherit; // 2
|
77
|
+
} @else {
|
78
|
+
@error "Invalid arrow direction: expected `up`, `right`, `down` or `left`, got `#{$direction}`";
|
79
|
+
}
|
80
|
+
}
|