govuk_publishing_components 9.3.6 → 9.4.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 +13 -0
- data/app/assets/stylesheets/component_guide/application.scss +10 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/admin_styles.scss +13 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +66 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -0
- data/app/models/govuk_publishing_components/component_doc.rb +12 -0
- data/app/views/govuk_publishing_components/component_guide/component_doc/_preview.html.erb +7 -5
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +22 -0
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +39 -0
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +10 -0
- data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +142 -0
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +28 -0
- data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -0
- data/app/views/layouts/govuk_publishing_components/application.html.erb +5 -0
- data/config/initializers/assets.rb +12 -0
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +13 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/README.md +96 -0
- data/node_modules/govuk-frontend/all-ie8.scss +6 -0
- data/node_modules/govuk-frontend/all.js +1720 -0
- data/node_modules/govuk-frontend/all.scss +11 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-crest-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-crest.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/assets/images/govuk-mask-icon.svg +7 -0
- data/node_modules/govuk-frontend/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-arrow-left.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-important.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer.png +0 -0
- data/node_modules/govuk-frontend/common.js +39 -0
- data/node_modules/govuk-frontend/components/_all.scss +26 -0
- data/node_modules/govuk-frontend/components/back-link/README.md +142 -0
- data/node_modules/govuk-frontend/components/back-link/_back-link.scss +54 -0
- data/node_modules/govuk-frontend/components/back-link/back-link.njk +3 -0
- data/node_modules/govuk-frontend/components/back-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/back-link/template.njk +2 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/README.md +335 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/_breadcrumbs.scss +119 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/breadcrumbs.njk +14 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/template.njk +13 -0
- data/node_modules/govuk-frontend/components/button/README.md +319 -0
- data/node_modules/govuk-frontend/components/button/_button.scss +185 -0
- data/node_modules/govuk-frontend/components/button/button.js +548 -0
- data/node_modules/govuk-frontend/components/button/button.njk +3 -0
- data/node_modules/govuk-frontend/components/button/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/button/template.njk +35 -0
- data/node_modules/govuk-frontend/components/checkboxes/README.md +782 -0
- data/node_modules/govuk-frontend/components/checkboxes/_checkboxes.scss +151 -0
- data/node_modules/govuk-frontend/components/checkboxes/checkboxes.js +730 -0
- data/node_modules/govuk-frontend/components/checkboxes/checkboxes.njk +27 -0
- data/node_modules/govuk-frontend/components/checkboxes/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/checkboxes/template.njk +86 -0
- data/node_modules/govuk-frontend/components/date-input/README.md +640 -0
- data/node_modules/govuk-frontend/components/date-input/_date-input.scss +35 -0
- data/node_modules/govuk-frontend/components/date-input/date-input.njk +23 -0
- data/node_modules/govuk-frontend/components/date-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/date-input/template.njk +76 -0
- data/node_modules/govuk-frontend/components/details/README.md +237 -0
- data/node_modules/govuk-frontend/components/details/_details.scss +86 -0
- data/node_modules/govuk-frontend/components/details/details.js +836 -0
- data/node_modules/govuk-frontend/components/details/details.njk +7 -0
- data/node_modules/govuk-frontend/components/details/implementation.md +43 -0
- data/node_modules/govuk-frontend/components/details/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/details/template.njk +10 -0
- data/node_modules/govuk-frontend/components/error-message/README.md +143 -0
- data/node_modules/govuk-frontend/components/error-message/_error-message.scss +15 -0
- data/node_modules/govuk-frontend/components/error-message/error-message.njk +7 -0
- data/node_modules/govuk-frontend/components/error-message/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/error-message/template.njk +3 -0
- data/node_modules/govuk-frontend/components/error-summary/README.md +215 -0
- data/node_modules/govuk-frontend/components/error-summary/_error-summary.scss +68 -0
- data/node_modules/govuk-frontend/components/error-summary/error-summary.js +520 -0
- data/node_modules/govuk-frontend/components/error-summary/error-summary.njk +17 -0
- data/node_modules/govuk-frontend/components/error-summary/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/error-summary/template.njk +25 -0
- data/node_modules/govuk-frontend/components/fieldset/README.md +213 -0
- data/node_modules/govuk-frontend/components/fieldset/_fieldset.scss +58 -0
- data/node_modules/govuk-frontend/components/fieldset/fieldset.njk +13 -0
- data/node_modules/govuk-frontend/components/fieldset/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/fieldset/template.njk +17 -0
- data/node_modules/govuk-frontend/components/file-upload/README.md +332 -0
- data/node_modules/govuk-frontend/components/file-upload/_file-upload.scss +19 -0
- data/node_modules/govuk-frontend/components/file-upload/file-upload.njk +9 -0
- data/node_modules/govuk-frontend/components/file-upload/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/file-upload/template.njk +42 -0
- data/node_modules/govuk-frontend/components/footer/README.md +284 -0
- data/node_modules/govuk-frontend/components/footer/_footer.scss +216 -0
- data/node_modules/govuk-frontend/components/footer/footer.njk +3 -0
- data/node_modules/govuk-frontend/components/footer/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/footer/template.njk +80 -0
- data/node_modules/govuk-frontend/components/header/README.md +524 -0
- data/node_modules/govuk-frontend/components/header/_header.scss +285 -0
- data/node_modules/govuk-frontend/components/header/header.js +717 -0
- data/node_modules/govuk-frontend/components/header/header.njk +3 -0
- data/node_modules/govuk-frontend/components/header/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/header/template.njk +82 -0
- data/node_modules/govuk-frontend/components/hint/README.md +157 -0
- data/node_modules/govuk-frontend/components/hint/_hint.scss +29 -0
- data/node_modules/govuk-frontend/components/hint/hint.njk +7 -0
- data/node_modules/govuk-frontend/components/hint/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/hint/template.njk +4 -0
- data/node_modules/govuk-frontend/components/input/README.md +416 -0
- data/node_modules/govuk-frontend/components/input/_input.scss +62 -0
- data/node_modules/govuk-frontend/components/input/input.njk +9 -0
- data/node_modules/govuk-frontend/components/input/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/input/template.njk +42 -0
- data/node_modules/govuk-frontend/components/inset-text/README.md +157 -0
- data/node_modules/govuk-frontend/components/inset-text/_inset-text.scss +28 -0
- data/node_modules/govuk-frontend/components/inset-text/inset-text.njk +7 -0
- data/node_modules/govuk-frontend/components/inset-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/inset-text/template.njk +4 -0
- data/node_modules/govuk-frontend/components/label/README.md +193 -0
- data/node_modules/govuk-frontend/components/label/_label.scss +45 -0
- data/node_modules/govuk-frontend/components/label/label.njk +6 -0
- data/node_modules/govuk-frontend/components/label/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/label/template.njk +15 -0
- data/node_modules/govuk-frontend/components/panel/README.md +151 -0
- data/node_modules/govuk-frontend/components/panel/_panel.scss +42 -0
- data/node_modules/govuk-frontend/components/panel/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/panel/panel.njk +7 -0
- data/node_modules/govuk-frontend/components/panel/template.njk +12 -0
- data/node_modules/govuk-frontend/components/phase-banner/README.md +152 -0
- data/node_modules/govuk-frontend/components/phase-banner/_phase-banner.scss +31 -0
- data/node_modules/govuk-frontend/components/phase-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/phase-banner/phase-banner.njk +7 -0
- data/node_modules/govuk-frontend/components/phase-banner/template.njk +17 -0
- data/node_modules/govuk-frontend/components/radios/README.md +686 -0
- data/node_modules/govuk-frontend/components/radios/_radios.scss +157 -0
- data/node_modules/govuk-frontend/components/radios/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/radios/radios.js +730 -0
- data/node_modules/govuk-frontend/components/radios/radios.njk +27 -0
- data/node_modules/govuk-frontend/components/radios/template.njk +85 -0
- data/node_modules/govuk-frontend/components/select/README.md +387 -0
- data/node_modules/govuk-frontend/components/select/_select.scss +35 -0
- data/node_modules/govuk-frontend/components/select/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/select/select.njk +24 -0
- data/node_modules/govuk-frontend/components/select/template.njk +44 -0
- data/node_modules/govuk-frontend/components/skip-link/README.md +142 -0
- data/node_modules/govuk-frontend/components/skip-link/_skip-link.scss +15 -0
- data/node_modules/govuk-frontend/components/skip-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/skip-link/skip-link.njk +3 -0
- data/node_modules/govuk-frontend/components/skip-link/template.njk +3 -0
- data/node_modules/govuk-frontend/components/table/README.md +585 -0
- data/node_modules/govuk-frontend/components/table/_table.scss +50 -0
- data/node_modules/govuk-frontend/components/table/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/table/table.njk +45 -0
- data/node_modules/govuk-frontend/components/table/template.njk +39 -0
- data/node_modules/govuk-frontend/components/tabs/README.md +375 -0
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +120 -0
- data/node_modules/govuk-frontend/components/tabs/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/tabs/tabs.js +1302 -0
- data/node_modules/govuk-frontend/components/tabs/tabs.njk +3 -0
- data/node_modules/govuk-frontend/components/tabs/template.njk +29 -0
- data/node_modules/govuk-frontend/components/tag/README.md +150 -0
- data/node_modules/govuk-frontend/components/tag/_tag.scss +23 -0
- data/node_modules/govuk-frontend/components/tag/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/tag/tag.njk +7 -0
- data/node_modules/govuk-frontend/components/tag/template.njk +3 -0
- data/node_modules/govuk-frontend/components/textarea/README.md +350 -0
- data/node_modules/govuk-frontend/components/textarea/_textarea.scss +31 -0
- data/node_modules/govuk-frontend/components/textarea/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/textarea/template.njk +41 -0
- data/node_modules/govuk-frontend/components/textarea/textarea.njk +11 -0
- data/node_modules/govuk-frontend/components/warning-text/README.md +148 -0
- data/node_modules/govuk-frontend/components/warning-text/_warning-text.scss +50 -0
- data/node_modules/govuk-frontend/components/warning-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/components/warning-text/template.njk +9 -0
- data/node_modules/govuk-frontend/components/warning-text/warning-text.njk +9 -0
- data/node_modules/govuk-frontend/core/_all.scss +6 -0
- data/node_modules/govuk-frontend/core/_global-styles.scss +19 -0
- data/node_modules/govuk-frontend/core/_links.scss +40 -0
- data/node_modules/govuk-frontend/core/_lists.scss +63 -0
- data/node_modules/govuk-frontend/core/_section-break.scss +56 -0
- data/node_modules/govuk-frontend/core/_template.scss +16 -0
- data/node_modules/govuk-frontend/core/_typography.scss +186 -0
- data/node_modules/govuk-frontend/helpers/_all.scss +12 -0
- data/node_modules/govuk-frontend/helpers/_clearfix.scss +15 -0
- data/node_modules/govuk-frontend/helpers/_colour.scss +51 -0
- data/node_modules/govuk-frontend/helpers/_device-pixels.scss +38 -0
- data/node_modules/govuk-frontend/helpers/_focusable.scss +34 -0
- data/node_modules/govuk-frontend/helpers/_font-faces.scss +67 -0
- data/node_modules/govuk-frontend/helpers/_grid.scss +100 -0
- data/node_modules/govuk-frontend/helpers/_links.scss +149 -0
- data/node_modules/govuk-frontend/helpers/_media-queries.scss +95 -0
- data/node_modules/govuk-frontend/helpers/_shape-arrow.scss +80 -0
- data/node_modules/govuk-frontend/helpers/_spacing.scss +152 -0
- data/node_modules/govuk-frontend/helpers/_typography.scss +153 -0
- data/node_modules/govuk-frontend/helpers/_visually-hidden.scss +76 -0
- data/node_modules/govuk-frontend/objects/_all.scss +4 -0
- data/node_modules/govuk-frontend/objects/_form-group.scss +21 -0
- data/node_modules/govuk-frontend/objects/_grid.scss +10 -0
- data/node_modules/govuk-frontend/objects/_main-wrapper.scss +37 -0
- data/node_modules/govuk-frontend/objects/_width-container.scss +28 -0
- data/node_modules/govuk-frontend/overrides/_all.scss +4 -0
- data/node_modules/govuk-frontend/overrides/_display.scss +14 -0
- data/node_modules/govuk-frontend/overrides/_spacing.scss +58 -0
- data/node_modules/govuk-frontend/overrides/_typography.scss +21 -0
- data/node_modules/govuk-frontend/overrides/_width.scss +41 -0
- data/node_modules/govuk-frontend/package.json +89 -0
- data/node_modules/govuk-frontend/settings/_all.scss +21 -0
- data/node_modules/govuk-frontend/settings/_assets.scss +82 -0
- data/node_modules/govuk-frontend/settings/_colours-applied.scss +130 -0
- data/node_modules/govuk-frontend/settings/_colours-organisations.scss +136 -0
- data/node_modules/govuk-frontend/settings/_colours-palette.scss +37 -0
- data/node_modules/govuk-frontend/settings/_compatibility.scss +51 -0
- data/node_modules/govuk-frontend/settings/_global-styles.scss +13 -0
- data/node_modules/govuk-frontend/settings/_ie8.scss +18 -0
- data/node_modules/govuk-frontend/settings/_measurements.scss +85 -0
- data/node_modules/govuk-frontend/settings/_media-queries.scss +23 -0
- data/node_modules/govuk-frontend/settings/_spacing.scss +80 -0
- data/node_modules/govuk-frontend/settings/_typography-font-families.scss +22 -0
- data/node_modules/govuk-frontend/settings/_typography-font.scss +48 -0
- data/node_modules/govuk-frontend/settings/_typography-responsive.scss +138 -0
- data/node_modules/govuk-frontend/template.njk +56 -0
- data/node_modules/govuk-frontend/tools/_all.scss +7 -0
- data/node_modules/govuk-frontend/tools/_compatibility.scss +36 -0
- data/node_modules/govuk-frontend/tools/_exports.scss +33 -0
- data/node_modules/govuk-frontend/tools/_font-url.scss +28 -0
- data/node_modules/govuk-frontend/tools/_ie8.scss +51 -0
- data/node_modules/govuk-frontend/tools/_iff.scss +15 -0
- data/node_modules/govuk-frontend/tools/_image-url.scss +28 -0
- data/node_modules/govuk-frontend/tools/_px-to-em.scss +20 -0
- data/node_modules/govuk-frontend/utilities/_all.scss +2 -0
- data/node_modules/govuk-frontend/utilities/_clearfix.scss +5 -0
- data/node_modules/govuk-frontend/utilities/_visually-hidden.scss +9 -0
- data/node_modules/govuk-frontend/vendor/_sass-mq.scss +351 -0
- data/node_modules/govuk-frontend/vendor/polyfills/DOMTokenList.js +272 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Document.js +34 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Element.js +147 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Element/prototype/classList.js +449 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Event.js +504 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Function/prototype/bind.js +252 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Object/defineProperty.js +94 -0
- data/node_modules/govuk-frontend/vendor/polyfills/Window.js +28 -0
- metadata +249 -2
@@ -0,0 +1,153 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers
|
3
|
+
////
|
4
|
+
|
5
|
+
/// 'Common typography' helper
|
6
|
+
///
|
7
|
+
/// Sets the font family and associated properties, such as font smoothing. Also
|
8
|
+
/// overrides the font for print.
|
9
|
+
///
|
10
|
+
/// @param {List} $font-family [$govuk-font-family] Font family to use
|
11
|
+
/// @access public
|
12
|
+
|
13
|
+
@mixin govuk-typography-common($font-family: $govuk-font-family) {
|
14
|
+
font-family: $font-family;
|
15
|
+
-webkit-font-smoothing: antialiased;
|
16
|
+
-moz-osx-font-smoothing: grayscale;
|
17
|
+
|
18
|
+
// If using NTA, include the font-face definition
|
19
|
+
@if ($govuk-font-family == $govuk-font-family-nta) {
|
20
|
+
@include _govuk-font-face-nta;
|
21
|
+
}
|
22
|
+
|
23
|
+
@include govuk-media-query($media-type: print) {
|
24
|
+
font-family: $govuk-font-family-print;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
/// Text colour helper
|
29
|
+
///
|
30
|
+
/// Sets the text colour, including a suitable override for print.
|
31
|
+
///
|
32
|
+
/// @access public
|
33
|
+
|
34
|
+
@mixin govuk-text-colour {
|
35
|
+
color: $govuk-text-colour;
|
36
|
+
|
37
|
+
@include govuk-media-query($media-type: print) {
|
38
|
+
color: $govuk-print-text-colour;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
/// Regular font weight helper
|
43
|
+
///
|
44
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
45
|
+
/// `!important`. Generally Used to create override classes.
|
46
|
+
/// @access public
|
47
|
+
|
48
|
+
@mixin govuk-typography-weight-regular($important: false) {
|
49
|
+
font-weight: $govuk-font-weight-regular iff($important, !important);
|
50
|
+
}
|
51
|
+
|
52
|
+
/// Bold font weight helper
|
53
|
+
///
|
54
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
55
|
+
/// `!important`. Generally Used to create override classes.
|
56
|
+
/// @access public
|
57
|
+
|
58
|
+
@mixin govuk-typography-weight-bold($important: false) {
|
59
|
+
font-weight: $govuk-font-weight-bold iff($important, !important);
|
60
|
+
}
|
61
|
+
|
62
|
+
/// Responsive typography helper
|
63
|
+
///
|
64
|
+
/// Takes a 'font map' as an argument and uses it to create font-size and
|
65
|
+
/// line-height declarations for different breakpoints, and for print.
|
66
|
+
///
|
67
|
+
/// Example font map:
|
68
|
+
///
|
69
|
+
/// $my-font-map: (
|
70
|
+
/// null: (
|
71
|
+
/// font-size: 16px,
|
72
|
+
/// line-height: 20px
|
73
|
+
/// ),
|
74
|
+
/// tablet: (
|
75
|
+
/// font-size: 19px,
|
76
|
+
/// line-height: 25px
|
77
|
+
/// ),
|
78
|
+
/// print: (
|
79
|
+
/// font-size: 14pt,
|
80
|
+
/// line-height: 1.15
|
81
|
+
/// )
|
82
|
+
/// );
|
83
|
+
///
|
84
|
+
/// @param {Map} $font-map - Font map
|
85
|
+
/// @param {Number} $override-line-height [false] - Non responsive custom line
|
86
|
+
/// height. Omit to use the line height from the font map.
|
87
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
88
|
+
/// `!important`.
|
89
|
+
///
|
90
|
+
/// @access public
|
91
|
+
|
92
|
+
@mixin govuk-typography-responsive($size, $override-line-height: false, $important: false) {
|
93
|
+
|
94
|
+
@if not map-has-key($govuk-typography-scale, $size) {
|
95
|
+
@error "Unknown font size `#{$size}` - expected a point from the typography scale.";
|
96
|
+
}
|
97
|
+
|
98
|
+
$font-map: map-get($govuk-typography-scale, $size);
|
99
|
+
|
100
|
+
@each $breakpoint, $breakpoint-map in $font-map {
|
101
|
+
$font-size: map-get($breakpoint-map, "font-size") iff($important, !important);
|
102
|
+
$line-height: map-get($breakpoint-map, "line-height") iff($important, !important);
|
103
|
+
|
104
|
+
// Sometimes we need to use a custom non-responsive line height for
|
105
|
+
// a component.
|
106
|
+
@if $override-line-height {
|
107
|
+
$line-height: $override-line-height iff($important, !important);
|
108
|
+
}
|
109
|
+
|
110
|
+
@if $breakpoint == null {
|
111
|
+
font-size: $font-size;
|
112
|
+
line-height: $line-height;
|
113
|
+
} @elseif $breakpoint == "print" {
|
114
|
+
@include govuk-media-query($media-type: print) {
|
115
|
+
font-size: $font-size;
|
116
|
+
line-height: $line-height;
|
117
|
+
}
|
118
|
+
} @else {
|
119
|
+
@include govuk-media-query($from: $breakpoint) {
|
120
|
+
font-size: $font-size;
|
121
|
+
line-height: $line-height;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
/// Font helper
|
128
|
+
///
|
129
|
+
/// @param {Number} $size - Size of the font as it would appear on desktop -
|
130
|
+
/// uses the responsive font size map
|
131
|
+
/// @param {String} $weight [regular] - Weight: `bold` or `regular`
|
132
|
+
/// @param {Boolean} $tabular [false] - Whether to use tabular numbers or not
|
133
|
+
/// @param {Number} $line-height [false] - Line-height, if overriding the default
|
134
|
+
///
|
135
|
+
/// @access public
|
136
|
+
|
137
|
+
@mixin govuk-font($size, $weight: regular, $tabular: false, $line-height: false) {
|
138
|
+
@if $tabular {
|
139
|
+
@include govuk-typography-common($font-family: $govuk-font-family-tabular);
|
140
|
+
} @else {
|
141
|
+
@include govuk-typography-common;
|
142
|
+
}
|
143
|
+
|
144
|
+
@if $weight == regular {
|
145
|
+
@include govuk-typography-weight-regular;
|
146
|
+
} @else if $weight == bold {
|
147
|
+
@include govuk-typography-weight-bold;
|
148
|
+
}
|
149
|
+
|
150
|
+
@if $size {
|
151
|
+
@include govuk-typography-responsive($size, $override-line-height: $line-height);
|
152
|
+
}
|
153
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Hide an element visually, but have it available for screen readers
|
6
|
+
///
|
7
|
+
/// @link https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
8
|
+
/// - Hiding Content for Accessibility, Jonathan Snook, February 2011
|
9
|
+
/// @link https://github.com/h5bp/html5-boilerplate/blob/9f13695d21ff92c55c78dfa9f16bb02a1b6e911f/src/css/main.css#L121-L158
|
10
|
+
/// - h5bp/html5-boilerplate - Thanks!
|
11
|
+
///
|
12
|
+
/// @access public
|
13
|
+
|
14
|
+
@mixin govuk-visually-hidden {
|
15
|
+
position: absolute;
|
16
|
+
|
17
|
+
width: 1px;
|
18
|
+
height: 1px;
|
19
|
+
margin: -1px;
|
20
|
+
padding: 0;
|
21
|
+
|
22
|
+
overflow: hidden;
|
23
|
+
clip: rect(0 0 0 0);
|
24
|
+
-webkit-clip-path: inset(50%);
|
25
|
+
clip-path: inset(50%);
|
26
|
+
|
27
|
+
border: 0;
|
28
|
+
|
29
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
30
|
+
// causes content to wrap 1 word per line:
|
31
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
32
|
+
white-space: nowrap;
|
33
|
+
}
|
34
|
+
|
35
|
+
/// Hide an element visually, but have it available for screen readers whilst
|
36
|
+
/// allowing the element to be focused when navigated to via the keyboard (e.g.
|
37
|
+
/// for the skip link)
|
38
|
+
///
|
39
|
+
/// This is slightly less opinionated about borders and padding to make it
|
40
|
+
/// easier to style the focussed element.
|
41
|
+
///
|
42
|
+
/// @access public
|
43
|
+
|
44
|
+
@mixin govuk-visually-hidden-focusable {
|
45
|
+
position: absolute;
|
46
|
+
|
47
|
+
width: 1px;
|
48
|
+
height: 1px;
|
49
|
+
margin: -1px;
|
50
|
+
|
51
|
+
overflow: hidden;
|
52
|
+
clip: rect(0 0 0 0);
|
53
|
+
-webkit-clip-path: inset(50%);
|
54
|
+
clip-path: inset(50%);
|
55
|
+
|
56
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
57
|
+
// causes content to wrap 1 word per line:
|
58
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
59
|
+
white-space: nowrap;
|
60
|
+
|
61
|
+
&:active,
|
62
|
+
&:focus {
|
63
|
+
position: static;
|
64
|
+
|
65
|
+
width: auto;
|
66
|
+
height: auto;
|
67
|
+
margin: inherit;
|
68
|
+
|
69
|
+
overflow: visible;
|
70
|
+
clip: auto;
|
71
|
+
-webkit-clip-path: none;
|
72
|
+
clip-path: none;
|
73
|
+
|
74
|
+
white-space: inherit;
|
75
|
+
}
|
76
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@include govuk-exports("govuk/objects/form-group") {
|
2
|
+
|
3
|
+
.govuk-form-group {
|
4
|
+
@include govuk-responsive-margin(6, "bottom");
|
5
|
+
|
6
|
+
.govuk-form-group:last-of-type {
|
7
|
+
margin-bottom: 0; // Remove margin from last item in nested groups
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.govuk-form-group--error {
|
12
|
+
padding-left: govuk-spacing(3);
|
13
|
+
border-left: $govuk-border-width-form-group-error solid $govuk-error-colour;
|
14
|
+
|
15
|
+
.govuk-form-group {
|
16
|
+
// Reset error styles in nested form groups that might have error class
|
17
|
+
padding: 0;
|
18
|
+
border: 0;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
@include govuk-exports("govuk/objects/grid") {
|
2
|
+
//most common usage
|
3
|
+
@include govuk-grid-row;
|
4
|
+
@include govuk-grid-column(one-quarter);
|
5
|
+
@include govuk-grid-column(one-third);
|
6
|
+
@include govuk-grid-column(one-half);
|
7
|
+
@include govuk-grid-column(two-thirds);
|
8
|
+
@include govuk-grid-column(three-quarters);
|
9
|
+
@include govuk-grid-column(full);
|
10
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Example usage with Breadcrumbs, phase banners, back links:
|
2
|
+
// <div class="govuk-width-container">
|
3
|
+
// <!-- Breadcrumbs, phase banners, back links are placed in here. -->
|
4
|
+
// <div class="govuk-main-wrapper">
|
5
|
+
// <!-- Wrapper for the main content of your page which applies padding
|
6
|
+
// to the top / bottom -->
|
7
|
+
// </div>
|
8
|
+
// </div>
|
9
|
+
//
|
10
|
+
// Example usage without Breadcrumbs, phase banners, back links:
|
11
|
+
// <div class="govuk-width-container">
|
12
|
+
// <div class="govuk-main-wrapper govuk-main-wrapper--l">
|
13
|
+
// <!-- Wrapper for the main content of your page which applies padding
|
14
|
+
// to the top / bottom -->
|
15
|
+
// </div>
|
16
|
+
// </div>
|
17
|
+
|
18
|
+
|
19
|
+
@mixin govuk-main-wrapper {
|
20
|
+
@include govuk-responsive-padding(6, "top");
|
21
|
+
@include govuk-responsive-padding(6, "bottom");
|
22
|
+
}
|
23
|
+
|
24
|
+
// Use govuk-main-wrapper--l when you page does not have Breadcrumbs, phase banners or back links
|
25
|
+
@mixin govuk-main-wrapper--l {
|
26
|
+
@include govuk-responsive-padding(8, "top");
|
27
|
+
}
|
28
|
+
|
29
|
+
@include govuk-exports("govuk/objects/main-wrapper") {
|
30
|
+
.govuk-main-wrapper {
|
31
|
+
@include govuk-main-wrapper;
|
32
|
+
}
|
33
|
+
|
34
|
+
.govuk-main-wrapper--l {
|
35
|
+
@include govuk-main-wrapper--l;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@mixin govuk-width-container {
|
2
|
+
// Limit the width of the container to the page width
|
3
|
+
max-width: $govuk-page-width;
|
4
|
+
|
5
|
+
@include govuk-if-ie8 {
|
6
|
+
width: $govuk-page-width;
|
7
|
+
}
|
8
|
+
|
9
|
+
// On mobile, add half width gutters
|
10
|
+
margin: 0 $govuk-gutter-half;
|
11
|
+
|
12
|
+
// On tablet, add full width gutters
|
13
|
+
@include govuk-media-query($from: tablet) {
|
14
|
+
margin: 0 $govuk-gutter;
|
15
|
+
}
|
16
|
+
|
17
|
+
// As soon as the viewport is greater than the width of the page plus the
|
18
|
+
// gutters, just centre the content instead of adding gutters.
|
19
|
+
@include govuk-media-query($and: "(min-width: #{($govuk-page-width + $govuk-gutter * 2)})") {
|
20
|
+
margin: 0 auto;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
@include govuk-exports("govuk/objects/width-container") {
|
25
|
+
.govuk-width-container {
|
26
|
+
@include govuk-width-container;
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@include govuk-exports("govuk/overrides/display") {
|
2
|
+
|
3
|
+
.govuk-\!-display-inline {
|
4
|
+
display: inline !important;
|
5
|
+
}
|
6
|
+
|
7
|
+
.govuk-\!-display-inline-block {
|
8
|
+
display: inline-block !important;
|
9
|
+
}
|
10
|
+
|
11
|
+
.govuk-\!-display-block {
|
12
|
+
display: block !important;
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
////
|
2
|
+
/// @group overrides
|
3
|
+
////
|
4
|
+
|
5
|
+
/// Directions for spacing
|
6
|
+
///
|
7
|
+
/// @type Map
|
8
|
+
/// @access private
|
9
|
+
|
10
|
+
$_spacing-directions: (
|
11
|
+
"top",
|
12
|
+
"right",
|
13
|
+
"bottom",
|
14
|
+
"left"
|
15
|
+
) !default;
|
16
|
+
|
17
|
+
/// Spacing override classes
|
18
|
+
///
|
19
|
+
/// Generate spacing override classes for the given property (e.g. margin)
|
20
|
+
/// for each point in the spacing scale.
|
21
|
+
///
|
22
|
+
/// @param {String} $property - Property to add spacing to (e.g. 'margin')
|
23
|
+
///
|
24
|
+
/// @example scss
|
25
|
+
/// .govuk-\!-margin-0 {
|
26
|
+
/// margin: 0;
|
27
|
+
/// }
|
28
|
+
///
|
29
|
+
/// .govuk-\!-margin-top-1 {
|
30
|
+
/// margin-top: [whatever spacing point 1 is...]
|
31
|
+
/// }
|
32
|
+
///
|
33
|
+
/// @access private
|
34
|
+
|
35
|
+
@mixin _govuk-generate-spacing-overrides($property) {
|
36
|
+
// For each point in the spacing scale (defined in settings), create an
|
37
|
+
// override that affects all directions...
|
38
|
+
@each $scale-point, $scale-map in $govuk-spacing-responsive-scale {
|
39
|
+
|
40
|
+
.govuk-\!-#{$property}-#{$scale-point} {
|
41
|
+
|
42
|
+
@include _govuk-responsive-spacing($scale-point, $property, "all", true);
|
43
|
+
}
|
44
|
+
|
45
|
+
// ... and then an override for each individual direction
|
46
|
+
@each $direction in $_spacing-directions {
|
47
|
+
|
48
|
+
.govuk-\!-#{$property}-#{$direction}-#{$scale-point} {
|
49
|
+
@include _govuk-responsive-spacing($scale-point, $property, $direction, true);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
@include govuk-exports("govuk/overrides/spacing") {
|
56
|
+
@include _govuk-generate-spacing-overrides("margin");
|
57
|
+
@include _govuk-generate-spacing-overrides("padding");
|
58
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@include govuk-exports("govuk/overrides/typography") {
|
2
|
+
// Font size and line height
|
3
|
+
|
4
|
+
// Generate typography override classes for each responsive font map in the
|
5
|
+
// typography scale eg .govuk-\!-font-size-80
|
6
|
+
@each $size in map-keys($govuk-typography-scale) {
|
7
|
+
.govuk-\!-font-size-#{$size} {
|
8
|
+
@include govuk-typography-responsive($size, $important: true);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
// Weights
|
13
|
+
|
14
|
+
.govuk-\!-font-weight-regular {
|
15
|
+
@include govuk-typography-weight-regular($important: true);
|
16
|
+
}
|
17
|
+
|
18
|
+
.govuk-\!-font-weight-bold {
|
19
|
+
@include govuk-typography-weight-bold($important: true);
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
@include govuk-exports("govuk/overrides/width") {
|
2
|
+
.govuk-\!-width-three-quarters {
|
3
|
+
width: 100% !important;
|
4
|
+
|
5
|
+
@include govuk-media-query($from: tablet) {
|
6
|
+
width: 75% !important;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
.govuk-\!-width-two-thirds {
|
11
|
+
width: 100% !important;
|
12
|
+
|
13
|
+
@include govuk-media-query($from: tablet) {
|
14
|
+
width: 66.66% !important;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.govuk-\!-width-one-half {
|
19
|
+
width: 100% !important;
|
20
|
+
|
21
|
+
@include govuk-media-query($from: tablet) {
|
22
|
+
width: 50% !important;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.govuk-\!-width-one-third {
|
27
|
+
width: 100% !important;
|
28
|
+
|
29
|
+
@include govuk-media-query($from: tablet) {
|
30
|
+
width: 33.33% !important;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
.govuk-\!-width-one-quarter {
|
35
|
+
width: 100% !important;
|
36
|
+
|
37
|
+
@include govuk-media-query($from: tablet) {
|
38
|
+
width: 25% !important;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|