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,19 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@import "../error-message/error-message";
|
6
|
+
@import "../hint/hint";
|
7
|
+
@import "../label/label";
|
8
|
+
|
9
|
+
@include govuk-exports("govuk/component/file-upload") {
|
10
|
+
.govuk-file-upload {
|
11
|
+
@include govuk-font($size: 19);
|
12
|
+
@include govuk-text-colour;
|
13
|
+
@include govuk-focusable;
|
14
|
+
}
|
15
|
+
|
16
|
+
.govuk-file-upload--error {
|
17
|
+
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{% from "../error-message/macro.njk" import govukErrorMessage -%}
|
2
|
+
{% from "../hint/macro.njk" import govukHint %}
|
3
|
+
{% from "../label/macro.njk" import govukLabel %}
|
4
|
+
|
5
|
+
{#- a record of other elements that we need to associate with the input using
|
6
|
+
aria-describedby – for example hints or error messages -#}
|
7
|
+
{% set describedBy = "" %}
|
8
|
+
<div class="govuk-form-group {%- if params.errorMessage %} govuk-form-group--error{% endif %}">
|
9
|
+
{{ govukLabel({
|
10
|
+
html: params.label.html,
|
11
|
+
text: params.label.text,
|
12
|
+
classes: params.label.classes,
|
13
|
+
isPageHeading: params.label.isPageHeading,
|
14
|
+
attributes: params.label.attributes,
|
15
|
+
for: params.id
|
16
|
+
}) | indent(2) | trim }}
|
17
|
+
{% if params.hint %}
|
18
|
+
{% set hintId = params.id + '-hint' %}
|
19
|
+
{% set describedBy = describedBy + ' ' + hintId if describedBy else hintId %}
|
20
|
+
{{ govukHint({
|
21
|
+
id: hintId,
|
22
|
+
classes: params.hint.classes,
|
23
|
+
attributes: params.hint.attributes,
|
24
|
+
html: params.hint.html,
|
25
|
+
text: params.hint.text
|
26
|
+
}) | indent(2) | trim }}
|
27
|
+
{% endif %}
|
28
|
+
{% if params.errorMessage %}
|
29
|
+
{% set errorId = params.id + '-error' %}
|
30
|
+
{% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %}
|
31
|
+
{{ govukErrorMessage({
|
32
|
+
id: errorId,
|
33
|
+
classes: params.errorMessage.classes,
|
34
|
+
html: params.errorMessage.html,
|
35
|
+
text: params.errorMessage.text
|
36
|
+
}) | indent(2) | trim }}
|
37
|
+
{% endif %}
|
38
|
+
<input class="govuk-file-upload {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} govuk-file-upload--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="file"
|
39
|
+
{%- if params.value %} value="{{ params.value }}"{% endif %}
|
40
|
+
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
41
|
+
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
42
|
+
</div>
|
@@ -0,0 +1,284 @@
|
|
1
|
+
# Footer
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
The footer component is used at the bottom of every GOV.UK page, to help users navigate.
|
6
|
+
|
7
|
+
## Guidance
|
8
|
+
|
9
|
+
Find out when to use the Footer component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/footer).
|
10
|
+
|
11
|
+
## Quick start examples
|
12
|
+
|
13
|
+
### Component default
|
14
|
+
|
15
|
+
[Preview the footer component](http://govuk-frontend-review.herokuapp.com/components/footer/preview)
|
16
|
+
|
17
|
+
#### Markup
|
18
|
+
|
19
|
+
<footer class="govuk-footer " role="contentinfo">
|
20
|
+
<div class="govuk-width-container ">
|
21
|
+
|
22
|
+
<div class="govuk-footer__meta">
|
23
|
+
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
24
|
+
|
25
|
+
<svg
|
26
|
+
role="presentation"
|
27
|
+
focusable="false"
|
28
|
+
class="govuk-footer__licence-logo"
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
30
|
+
viewbox="0 0 483.2 195.7"
|
31
|
+
height="17"
|
32
|
+
width="41"
|
33
|
+
>
|
34
|
+
<path
|
35
|
+
fill="currentColor"
|
36
|
+
d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
|
37
|
+
/>
|
38
|
+
</svg>
|
39
|
+
<span class="govuk-footer__licence-description">
|
40
|
+
All content is available under the
|
41
|
+
<a
|
42
|
+
class="govuk-footer__link"
|
43
|
+
href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
|
44
|
+
rel="license"
|
45
|
+
>Open Government Licence v3.0</a>, except where otherwise stated
|
46
|
+
</span>
|
47
|
+
</div>
|
48
|
+
<div class="govuk-footer__meta-item">
|
49
|
+
<a
|
50
|
+
class="govuk-footer__link govuk-footer__copyright-logo"
|
51
|
+
href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/"
|
52
|
+
>© Crown copyright</a>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
</footer>
|
57
|
+
|
58
|
+
#### Macro
|
59
|
+
|
60
|
+
{% from 'footer/macro.njk' import govukFooter %}
|
61
|
+
|
62
|
+
{{ govukFooter({}) }}
|
63
|
+
|
64
|
+
## Requirements
|
65
|
+
|
66
|
+
### Build tool configuration
|
67
|
+
|
68
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
69
|
+
|
70
|
+
.pipe(sass({
|
71
|
+
includePaths: 'node_modules/'
|
72
|
+
}))
|
73
|
+
|
74
|
+
### Static asset path configuration
|
75
|
+
|
76
|
+
In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
|
77
|
+
|
78
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
79
|
+
|
80
|
+
## Component arguments
|
81
|
+
|
82
|
+
If you are using Nunjucks,then macros take the following arguments
|
83
|
+
|
84
|
+
**If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
|
85
|
+
|
86
|
+
<table class="govuk-table">
|
87
|
+
|
88
|
+
<thead class="govuk-table__head">
|
89
|
+
|
90
|
+
<tr class="govuk-table__row">
|
91
|
+
|
92
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
93
|
+
|
94
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
95
|
+
|
96
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
97
|
+
|
98
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
99
|
+
|
100
|
+
</tr>
|
101
|
+
|
102
|
+
</thead>
|
103
|
+
|
104
|
+
<tbody class="govuk-table__body">
|
105
|
+
|
106
|
+
<tr class="govuk-table__row">
|
107
|
+
|
108
|
+
<th class="govuk-table__header" scope="row">meta</th>
|
109
|
+
|
110
|
+
<td class="govuk-table__cell ">object</td>
|
111
|
+
|
112
|
+
<td class="govuk-table__cell ">No</td>
|
113
|
+
|
114
|
+
<td class="govuk-table__cell ">Object containing parameters for the meta navigation.</td>
|
115
|
+
|
116
|
+
</tr>
|
117
|
+
|
118
|
+
<tr class="govuk-table__row">
|
119
|
+
|
120
|
+
<th class="govuk-table__header" scope="row">meta.items</th>
|
121
|
+
|
122
|
+
<td class="govuk-table__cell ">array</td>
|
123
|
+
|
124
|
+
<td class="govuk-table__cell ">No</td>
|
125
|
+
|
126
|
+
<td class="govuk-table__cell ">Array of items for use in the meta section of the footer.</td>
|
127
|
+
|
128
|
+
</tr>
|
129
|
+
|
130
|
+
<tr class="govuk-table__row">
|
131
|
+
|
132
|
+
<th class="govuk-table__header" scope="row">meta.items.{}.text</th>
|
133
|
+
|
134
|
+
<td class="govuk-table__cell ">string</td>
|
135
|
+
|
136
|
+
<td class="govuk-table__cell ">No</td>
|
137
|
+
|
138
|
+
<td class="govuk-table__cell ">List item text in the meta section of the footer.</td>
|
139
|
+
|
140
|
+
</tr>
|
141
|
+
|
142
|
+
<tr class="govuk-table__row">
|
143
|
+
|
144
|
+
<th class="govuk-table__header" scope="row">meta.items.{}.href</th>
|
145
|
+
|
146
|
+
<td class="govuk-table__cell ">string</td>
|
147
|
+
|
148
|
+
<td class="govuk-table__cell ">No</td>
|
149
|
+
|
150
|
+
<td class="govuk-table__cell ">List item href attribute in the meta section of the footer.</td>
|
151
|
+
|
152
|
+
</tr>
|
153
|
+
|
154
|
+
<tr class="govuk-table__row">
|
155
|
+
|
156
|
+
<th class="govuk-table__header" scope="row">navigation</th>
|
157
|
+
|
158
|
+
<td class="govuk-table__cell ">array</td>
|
159
|
+
|
160
|
+
<td class="govuk-table__cell ">No</td>
|
161
|
+
|
162
|
+
<td class="govuk-table__cell ">Array of items for use in the navigation section of the footer.</td>
|
163
|
+
|
164
|
+
</tr>
|
165
|
+
|
166
|
+
<tr class="govuk-table__row">
|
167
|
+
|
168
|
+
<th class="govuk-table__header" scope="row">navigation.{}.title</th>
|
169
|
+
|
170
|
+
<td class="govuk-table__cell ">string</td>
|
171
|
+
|
172
|
+
<td class="govuk-table__cell ">No</td>
|
173
|
+
|
174
|
+
<td class="govuk-table__cell ">Title for a section</td>
|
175
|
+
|
176
|
+
</tr>
|
177
|
+
|
178
|
+
<tr class="govuk-table__row">
|
179
|
+
|
180
|
+
<th class="govuk-table__header" scope="row">navigation.{}.columns</th>
|
181
|
+
|
182
|
+
<td class="govuk-table__cell ">integer</td>
|
183
|
+
|
184
|
+
<td class="govuk-table__cell ">No</td>
|
185
|
+
|
186
|
+
<td class="govuk-table__cell ">Amount of columns to display items in navigation section of the footer.</td>
|
187
|
+
|
188
|
+
</tr>
|
189
|
+
|
190
|
+
<tr class="govuk-table__row">
|
191
|
+
|
192
|
+
<th class="govuk-table__header" scope="row">navigation.items</th>
|
193
|
+
|
194
|
+
<td class="govuk-table__cell ">array</td>
|
195
|
+
|
196
|
+
<td class="govuk-table__cell ">No</td>
|
197
|
+
|
198
|
+
<td class="govuk-table__cell ">Array of items to display in the list in navigation section of the footer.</td>
|
199
|
+
|
200
|
+
</tr>
|
201
|
+
|
202
|
+
<tr class="govuk-table__row">
|
203
|
+
|
204
|
+
<th class="govuk-table__header" scope="row">navigation.items.{}.text</th>
|
205
|
+
|
206
|
+
<td class="govuk-table__cell ">string</td>
|
207
|
+
|
208
|
+
<td class="govuk-table__cell ">No</td>
|
209
|
+
|
210
|
+
<td class="govuk-table__cell ">List item text in the navigation section of the footer.</td>
|
211
|
+
|
212
|
+
</tr>
|
213
|
+
|
214
|
+
<tr class="govuk-table__row">
|
215
|
+
|
216
|
+
<th class="govuk-table__header" scope="row">navigation.items.{}.href</th>
|
217
|
+
|
218
|
+
<td class="govuk-table__cell ">string</td>
|
219
|
+
|
220
|
+
<td class="govuk-table__cell ">No</td>
|
221
|
+
|
222
|
+
<td class="govuk-table__cell ">List item href attribute in the navigation section of the footer. Both `text` and `href` attributes need to be present to create a link.</td>
|
223
|
+
|
224
|
+
</tr>
|
225
|
+
|
226
|
+
<tr class="govuk-table__row">
|
227
|
+
|
228
|
+
<th class="govuk-table__header" scope="row">containerClasses</th>
|
229
|
+
|
230
|
+
<td class="govuk-table__cell ">string</td>
|
231
|
+
|
232
|
+
<td class="govuk-table__cell ">No</td>
|
233
|
+
|
234
|
+
<td class="govuk-table__cell ">Classes that can be added to the inner container, useful if you want to make the footer full width.</td>
|
235
|
+
|
236
|
+
</tr>
|
237
|
+
|
238
|
+
<tr class="govuk-table__row">
|
239
|
+
|
240
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
241
|
+
|
242
|
+
<td class="govuk-table__cell ">string</td>
|
243
|
+
|
244
|
+
<td class="govuk-table__cell ">No</td>
|
245
|
+
|
246
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the footer component container.</td>
|
247
|
+
|
248
|
+
</tr>
|
249
|
+
|
250
|
+
<tr class="govuk-table__row">
|
251
|
+
|
252
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
253
|
+
|
254
|
+
<td class="govuk-table__cell ">object</td>
|
255
|
+
|
256
|
+
<td class="govuk-table__cell ">No</td>
|
257
|
+
|
258
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the footer component container.</td>
|
259
|
+
|
260
|
+
</tr>
|
261
|
+
|
262
|
+
</tbody>
|
263
|
+
|
264
|
+
</table>
|
265
|
+
|
266
|
+
**If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
|
267
|
+
|
268
|
+
### Setting up Nunjucks views and paths
|
269
|
+
|
270
|
+
Below is an example setup using express configure views:
|
271
|
+
|
272
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
273
|
+
autoescape: true,
|
274
|
+
cache: false,
|
275
|
+
express: app
|
276
|
+
})
|
277
|
+
|
278
|
+
## Contribution
|
279
|
+
|
280
|
+
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
|
281
|
+
|
282
|
+
## License
|
283
|
+
|
284
|
+
MIT
|
@@ -0,0 +1,216 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@import "../../helpers/typography";
|
6
|
+
|
7
|
+
@include govuk-exports("govuk/component/footer") {
|
8
|
+
|
9
|
+
$govuk-footer-background: $govuk-canvas-background-colour;
|
10
|
+
$govuk-footer-border-top: #a1acb2;
|
11
|
+
$govuk-footer-border: govuk-colour("grey-2");
|
12
|
+
$govuk-footer-text: #454a4c;
|
13
|
+
$govuk-footer-link: $govuk-footer-text;
|
14
|
+
$govuk-footer-link-hover: #171819;
|
15
|
+
|
16
|
+
// Based on the govuk-crest-2x.png image dimensions.
|
17
|
+
$govuk-footer-crest-image-width-2x: 250px;
|
18
|
+
$govuk-footer-crest-image-height-2x: 204px;
|
19
|
+
// Half the 2x image so that it fits the regular 1x size.
|
20
|
+
$govuk-footer-crest-image-width: ($govuk-footer-crest-image-width-2x / 2);
|
21
|
+
$govuk-footer-crest-image-height: ($govuk-footer-crest-image-height-2x / 2);
|
22
|
+
|
23
|
+
.govuk-footer {
|
24
|
+
@include govuk-font($size: 16);
|
25
|
+
@include govuk-responsive-padding(7, "top");
|
26
|
+
@include govuk-responsive-padding(5, "bottom");
|
27
|
+
|
28
|
+
border-top: 1px solid $govuk-footer-border-top;
|
29
|
+
color: $govuk-footer-text;
|
30
|
+
background: $govuk-footer-background;
|
31
|
+
}
|
32
|
+
|
33
|
+
.govuk-footer__link {
|
34
|
+
@include govuk-focusable-fill;
|
35
|
+
|
36
|
+
&:link,
|
37
|
+
&:visited {
|
38
|
+
color: $govuk-footer-link;
|
39
|
+
}
|
40
|
+
|
41
|
+
&:hover,
|
42
|
+
&:active {
|
43
|
+
color: $govuk-footer-link-hover;
|
44
|
+
}
|
45
|
+
|
46
|
+
// Use text colour when focussed
|
47
|
+
&:focus {
|
48
|
+
color: $govuk-text-colour;
|
49
|
+
}
|
50
|
+
|
51
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
52
|
+
// designed to make unvisited links a slightly darker blue when focussed, so
|
53
|
+
// we need to override the text colour for that combination of selectors.
|
54
|
+
@include govuk-compatibility(govuk_template) {
|
55
|
+
&:link:focus {
|
56
|
+
@include govuk-text-colour;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
.govuk-footer__section-break {
|
62
|
+
margin: 0; // Reset `<hr>` default margins
|
63
|
+
@include govuk-responsive-margin(8, "bottom");
|
64
|
+
border: 0; // Reset `<hr>` default borders
|
65
|
+
border-bottom: 1px solid $govuk-footer-border;
|
66
|
+
}
|
67
|
+
|
68
|
+
.govuk-footer__meta {
|
69
|
+
display: -webkit-box;
|
70
|
+
display: -ms-flexbox;
|
71
|
+
display: flex; // Support: Flexbox
|
72
|
+
margin-right: -$govuk-gutter-half;
|
73
|
+
margin-left: -$govuk-gutter-half;
|
74
|
+
-ms-flex-wrap: wrap;
|
75
|
+
flex-wrap: wrap; // Support: Flexbox
|
76
|
+
-webkit-box-align: end;
|
77
|
+
-ms-flex-align: end;
|
78
|
+
align-items: flex-end; // Support: Flexbox
|
79
|
+
-webkit-box-pack: center;
|
80
|
+
-ms-flex-pack: center;
|
81
|
+
justify-content: center; // Support: Flexbox
|
82
|
+
}
|
83
|
+
|
84
|
+
.govuk-footer__meta-item {
|
85
|
+
margin-right: $govuk-gutter-half;
|
86
|
+
margin-bottom: govuk-spacing(5);
|
87
|
+
margin-left: $govuk-gutter-half;
|
88
|
+
}
|
89
|
+
|
90
|
+
.govuk-footer__meta-item--grow {
|
91
|
+
-webkit-box-flex: 1;
|
92
|
+
-ms-flex: 1;
|
93
|
+
flex: 1; // Support: Flexbox
|
94
|
+
@include mq ($until: tablet) {
|
95
|
+
-ms-flex-preferred-size: 320px;
|
96
|
+
flex-basis: 320px; // Support: Flexbox
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
.govuk-footer__licence-logo {
|
101
|
+
display: inline-block;
|
102
|
+
margin-right: govuk-spacing(2);
|
103
|
+
@include mq ($until: desktop) {
|
104
|
+
margin-bottom: govuk-spacing(3);
|
105
|
+
}
|
106
|
+
vertical-align: top;
|
107
|
+
}
|
108
|
+
|
109
|
+
.govuk-footer__licence-description {
|
110
|
+
display: inline-block;
|
111
|
+
}
|
112
|
+
|
113
|
+
.govuk-footer__copyright-logo {
|
114
|
+
display: inline-block;
|
115
|
+
min-width: $govuk-footer-crest-image-width;
|
116
|
+
padding-top: ($govuk-footer-crest-image-height + govuk-spacing(2));
|
117
|
+
background-image: govuk-image-url("govuk-crest.png");
|
118
|
+
@include govuk-device-pixel-ratio {
|
119
|
+
background-image: govuk-image-url("govuk-crest-2x.png");
|
120
|
+
}
|
121
|
+
background-repeat: no-repeat;
|
122
|
+
background-position: 50% 0%;
|
123
|
+
background-size: $govuk-footer-crest-image-width $govuk-footer-crest-image-height;
|
124
|
+
text-align: center;
|
125
|
+
text-decoration: none;
|
126
|
+
white-space: nowrap;
|
127
|
+
}
|
128
|
+
|
129
|
+
.govuk-footer__inline-list {
|
130
|
+
margin-top: 0;
|
131
|
+
margin-bottom: govuk-spacing(3);
|
132
|
+
padding: 0;
|
133
|
+
}
|
134
|
+
|
135
|
+
.govuk-footer__inline-list-item {
|
136
|
+
display: inline-block;
|
137
|
+
margin-right: govuk-spacing(3);
|
138
|
+
margin-bottom: govuk-spacing(1);
|
139
|
+
}
|
140
|
+
|
141
|
+
.govuk-footer__heading {
|
142
|
+
@include govuk-responsive-margin(7, "bottom");
|
143
|
+
padding-bottom: govuk-spacing(4);
|
144
|
+
@include mq ($until: tablet) {
|
145
|
+
padding-bottom: govuk-spacing(2);
|
146
|
+
}
|
147
|
+
border-bottom: 1px solid $govuk-footer-border;
|
148
|
+
}
|
149
|
+
|
150
|
+
.govuk-footer__navigation {
|
151
|
+
display: -webkit-box;
|
152
|
+
display: -ms-flexbox;
|
153
|
+
display: flex; // Support: Flexbox
|
154
|
+
margin-right: -$govuk-gutter-half;
|
155
|
+
margin-left: -$govuk-gutter-half;
|
156
|
+
-ms-flex-wrap: wrap;
|
157
|
+
flex-wrap: wrap; // Support: Flexbox
|
158
|
+
}
|
159
|
+
|
160
|
+
.govuk-footer__section {
|
161
|
+
display: inline-block;
|
162
|
+
margin-right: $govuk-gutter-half;
|
163
|
+
margin-bottom: $govuk-gutter;
|
164
|
+
margin-left: $govuk-gutter-half;
|
165
|
+
vertical-align: top;
|
166
|
+
// Ensure columns take up equal width (typically one-half:one-half)
|
167
|
+
-webkit-box-flex: 1;
|
168
|
+
-ms-flex-positive: 1;
|
169
|
+
flex-grow: 1; // Support: Flexbox
|
170
|
+
-ms-flex-negative: 1;
|
171
|
+
flex-shrink: 1; // Support: Flexbox
|
172
|
+
@include mq ($until: desktop) {
|
173
|
+
// Make sure columns do not drop below 200px in width
|
174
|
+
// Will typically result in wrapping, and end up in a single column on smaller screens.
|
175
|
+
-ms-flex-preferred-size: 200px;
|
176
|
+
flex-basis: 200px; // Support: Flexbox
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
// Sections two-third:one-third on desktop
|
181
|
+
@include mq ($from: desktop) {
|
182
|
+
.govuk-footer__section:first-child {
|
183
|
+
-webkit-box-flex: 2;
|
184
|
+
-ms-flex-positive: 2;
|
185
|
+
flex-grow: 2; // Support: Flexbox
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
.govuk-footer__list {
|
190
|
+
margin: 0;
|
191
|
+
padding: 0;
|
192
|
+
list-style: none;
|
193
|
+
-webkit-column-gap: $govuk-gutter;
|
194
|
+
column-gap: $govuk-gutter; // Support: Columns
|
195
|
+
}
|
196
|
+
|
197
|
+
@include mq ($from: desktop) {
|
198
|
+
.govuk-footer__list--columns-2 {
|
199
|
+
-webkit-column-count: 2;
|
200
|
+
column-count: 2; // Support: Columns
|
201
|
+
}
|
202
|
+
|
203
|
+
.govuk-footer__list--columns-3 {
|
204
|
+
-webkit-column-count: 3;
|
205
|
+
column-count: 3; // Support: Columns
|
206
|
+
}
|
207
|
+
}
|
208
|
+
|
209
|
+
.govuk-footer__list-item {
|
210
|
+
@include govuk-responsive-margin(4, "bottom");
|
211
|
+
}
|
212
|
+
|
213
|
+
.govuk-footer__list-item:last-child {
|
214
|
+
margin-bottom: 0;
|
215
|
+
}
|
216
|
+
}
|