govuk_fe_assets 0.1.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/govuk_fe_assets.gemspec +26 -0
- data/lib/govuk_fe_assets.rb +5 -0
- data/lib/govuk_fe_assets/version.rb +3 -0
- 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 +50 -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
- data/package-lock.json +10 -0
- data/package.json +5 -0
- metadata +334 -0
@@ -0,0 +1,62 @@
|
|
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/input") {
|
10
|
+
.govuk-input {
|
11
|
+
@include govuk-font($size: 19);
|
12
|
+
@include govuk-focusable;
|
13
|
+
|
14
|
+
-webkit-box-sizing: border-box;
|
15
|
+
|
16
|
+
box-sizing: border-box;
|
17
|
+
width: 100%;
|
18
|
+
height: 40px;
|
19
|
+
margin-top: 0;
|
20
|
+
|
21
|
+
padding: govuk-spacing(1);
|
22
|
+
// setting any background-color makes text invisible when changing colours to dark backgrounds in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1335476)
|
23
|
+
// as background-color and color need to always be set together, color should not be set either
|
24
|
+
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
25
|
+
border-radius: 0;
|
26
|
+
|
27
|
+
// Disable inner shadow and remove rounded corners
|
28
|
+
-webkit-appearance: none;
|
29
|
+
-moz-appearance: none;
|
30
|
+
appearance: none;
|
31
|
+
}
|
32
|
+
|
33
|
+
.govuk-input::-webkit-outer-spin-button,
|
34
|
+
.govuk-input::-webkit-inner-spin-button {
|
35
|
+
margin: 0;
|
36
|
+
-webkit-appearance: none;
|
37
|
+
}
|
38
|
+
|
39
|
+
.govuk-input[type="number"] {
|
40
|
+
-moz-appearance: textfield;
|
41
|
+
}
|
42
|
+
|
43
|
+
.govuk-input--error {
|
44
|
+
border: $govuk-border-width-form-element-error solid $govuk-error-colour;
|
45
|
+
}
|
46
|
+
|
47
|
+
// The ex measurements are based on the number of W's that can fit inside the input
|
48
|
+
// Extra space is left on the right hand side to allow for the Safari prefill icon
|
49
|
+
|
50
|
+
.govuk-input--width-30 {
|
51
|
+
max-width: 60ex;
|
52
|
+
}
|
53
|
+
|
54
|
+
.govuk-input--width-20 {
|
55
|
+
max-width: 41ex;
|
56
|
+
}
|
57
|
+
|
58
|
+
.govuk-input--width-10 {
|
59
|
+
max-width: 23ex;
|
60
|
+
}
|
61
|
+
|
62
|
+
}
|
@@ -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-input {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} govuk-input--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="{{ params.type | default('text') }}"
|
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,157 @@
|
|
1
|
+
# Inset text
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Use bordered inset text to draw attention to important content on the page.
|
6
|
+
|
7
|
+
## Quick start examples
|
8
|
+
|
9
|
+
### Component default
|
10
|
+
|
11
|
+
[Preview the inset-text component](http://govuk-frontend-review.herokuapp.com/components/inset-text/preview)
|
12
|
+
|
13
|
+
#### Markup
|
14
|
+
|
15
|
+
<div class="govuk-inset-text">
|
16
|
+
It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.
|
17
|
+
</div>
|
18
|
+
|
19
|
+
#### Macro
|
20
|
+
|
21
|
+
{% from 'inset-text/macro.njk' import govukInsetText %}
|
22
|
+
|
23
|
+
{{ govukInsetText({
|
24
|
+
"text": "It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application."
|
25
|
+
}) }}
|
26
|
+
|
27
|
+
### Inset-text--with html
|
28
|
+
|
29
|
+
[Preview the inset-text--with html example](http://govuk-frontend-review.herokuapp.com/components/inset-text/with html/preview)
|
30
|
+
|
31
|
+
#### Markup
|
32
|
+
|
33
|
+
<div class="govuk-inset-text">
|
34
|
+
It can take up to 8 weeks to register a <a class="govuk-link" href="#">lasting power of attorney</a> if there are no mistakes in the application.
|
35
|
+
</div>
|
36
|
+
|
37
|
+
#### Macro
|
38
|
+
|
39
|
+
{% from 'inset-text/macro.njk' import govukInsetText %}
|
40
|
+
|
41
|
+
{{ govukInsetText({
|
42
|
+
"html": "It can take up to 8 weeks to register a <a class=\"govuk-link\" href=\"#\">lasting power of attorney</a> if there are no mistakes in the application."
|
43
|
+
}) }}
|
44
|
+
|
45
|
+
## Requirements
|
46
|
+
|
47
|
+
### Build tool configuration
|
48
|
+
|
49
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
50
|
+
|
51
|
+
.pipe(sass({
|
52
|
+
includePaths: 'node_modules/'
|
53
|
+
}))
|
54
|
+
|
55
|
+
### Static asset path configuration
|
56
|
+
|
57
|
+
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:
|
58
|
+
|
59
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
60
|
+
|
61
|
+
## Component arguments
|
62
|
+
|
63
|
+
If you are using Nunjucks,then macros take the following arguments
|
64
|
+
|
65
|
+
**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).**
|
66
|
+
|
67
|
+
<table class="govuk-table">
|
68
|
+
|
69
|
+
<thead class="govuk-table__head">
|
70
|
+
|
71
|
+
<tr class="govuk-table__row">
|
72
|
+
|
73
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
74
|
+
|
75
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
76
|
+
|
77
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
78
|
+
|
79
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
80
|
+
|
81
|
+
</tr>
|
82
|
+
|
83
|
+
</thead>
|
84
|
+
|
85
|
+
<tbody class="govuk-table__body">
|
86
|
+
|
87
|
+
<tr class="govuk-table__row">
|
88
|
+
|
89
|
+
<th class="govuk-table__header" scope="row">text (or) html</th>
|
90
|
+
|
91
|
+
<td class="govuk-table__cell ">string</td>
|
92
|
+
|
93
|
+
<td class="govuk-table__cell ">Yes</td>
|
94
|
+
|
95
|
+
<td class="govuk-table__cell ">Text or HTML to use within the inset text. If `html` is provided, the `text` argument will be ignored.</td>
|
96
|
+
|
97
|
+
</tr>
|
98
|
+
|
99
|
+
<tr class="govuk-table__row">
|
100
|
+
|
101
|
+
<th class="govuk-table__header" scope="row">id</th>
|
102
|
+
|
103
|
+
<td class="govuk-table__cell ">string</td>
|
104
|
+
|
105
|
+
<td class="govuk-table__cell ">No</td>
|
106
|
+
|
107
|
+
<td class="govuk-table__cell ">Optional id attribute to add to the inset text container.</td>
|
108
|
+
|
109
|
+
</tr>
|
110
|
+
|
111
|
+
<tr class="govuk-table__row">
|
112
|
+
|
113
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
114
|
+
|
115
|
+
<td class="govuk-table__cell ">string</td>
|
116
|
+
|
117
|
+
<td class="govuk-table__cell ">No</td>
|
118
|
+
|
119
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the inset text container.</td>
|
120
|
+
|
121
|
+
</tr>
|
122
|
+
|
123
|
+
<tr class="govuk-table__row">
|
124
|
+
|
125
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
126
|
+
|
127
|
+
<td class="govuk-table__cell ">object</td>
|
128
|
+
|
129
|
+
<td class="govuk-table__cell ">No</td>
|
130
|
+
|
131
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the inset text container.</td>
|
132
|
+
|
133
|
+
</tr>
|
134
|
+
|
135
|
+
</tbody>
|
136
|
+
|
137
|
+
</table>
|
138
|
+
|
139
|
+
**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).**
|
140
|
+
|
141
|
+
### Setting up Nunjucks views and paths
|
142
|
+
|
143
|
+
Below is an example setup using express configure views:
|
144
|
+
|
145
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
146
|
+
autoescape: true,
|
147
|
+
cache: false,
|
148
|
+
express: app
|
149
|
+
})
|
150
|
+
|
151
|
+
## Contribution
|
152
|
+
|
153
|
+
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")
|
154
|
+
|
155
|
+
## License
|
156
|
+
|
157
|
+
MIT
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@import "../../settings/all";
|
2
|
+
@import "../../tools/all";
|
3
|
+
@import "../../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/component/inset-text") {
|
6
|
+
.govuk-inset-text {
|
7
|
+
@include govuk-font($size: 19);
|
8
|
+
@include govuk-text-colour;
|
9
|
+
padding: govuk-spacing(3);
|
10
|
+
// Margin top intended to collapse
|
11
|
+
// This adds an additional 10px to the paragraph above
|
12
|
+
@include govuk-responsive-margin(6, "top");
|
13
|
+
@include govuk-responsive-margin(6, "bottom");
|
14
|
+
|
15
|
+
clear: both;
|
16
|
+
|
17
|
+
border-left: $govuk-border-width-wide solid $govuk-border-colour;
|
18
|
+
|
19
|
+
:first-child {
|
20
|
+
margin-top: 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
:only-child,
|
24
|
+
:last-child {
|
25
|
+
margin-bottom: 0;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<div {%- if params.id %} id="{{ params.id }}"{% endif %} class="govuk-inset-text {%- if params.classes %} {{ params.classes }}{% endif %}"
|
2
|
+
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
3
|
+
{{ params.html | safe if params.html else params.text }}
|
4
|
+
</div>
|
@@ -0,0 +1,193 @@
|
|
1
|
+
# Label
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Use labels for all form fields.
|
6
|
+
|
7
|
+
## Quick start examples
|
8
|
+
|
9
|
+
### Component default
|
10
|
+
|
11
|
+
[Preview the label component](http://govuk-frontend-review.herokuapp.com/components/label/preview)
|
12
|
+
|
13
|
+
#### Markup
|
14
|
+
|
15
|
+
<label class="govuk-label">
|
16
|
+
National Insurance number
|
17
|
+
</label>
|
18
|
+
|
19
|
+
#### Macro
|
20
|
+
|
21
|
+
{% from 'label/macro.njk' import govukLabel %}
|
22
|
+
|
23
|
+
{{ govukLabel({
|
24
|
+
"text": "National Insurance number"
|
25
|
+
}) }}
|
26
|
+
|
27
|
+
### Label--with bold text
|
28
|
+
|
29
|
+
[Preview the label--with bold text example](http://govuk-frontend-review.herokuapp.com/components/label/with bold text/preview)
|
30
|
+
|
31
|
+
#### Markup
|
32
|
+
|
33
|
+
<label class="govuk-label govuk-label--s">
|
34
|
+
National Insurance number
|
35
|
+
</label>
|
36
|
+
|
37
|
+
#### Macro
|
38
|
+
|
39
|
+
{% from 'label/macro.njk' import govukLabel %}
|
40
|
+
|
41
|
+
{{ govukLabel({
|
42
|
+
"classes": "govuk-label--s",
|
43
|
+
"text": "National Insurance number"
|
44
|
+
}) }}
|
45
|
+
|
46
|
+
### Label--as page heading
|
47
|
+
|
48
|
+
[Preview the label--as page heading example](http://govuk-frontend-review.herokuapp.com/components/label/as page heading/preview)
|
49
|
+
|
50
|
+
#### Markup
|
51
|
+
|
52
|
+
<h1 class="govuk-label-wrapper">
|
53
|
+
<label class="govuk-label govuk-label--xl">
|
54
|
+
National Insurance number
|
55
|
+
</label>
|
56
|
+
|
57
|
+
</h1>
|
58
|
+
|
59
|
+
#### Macro
|
60
|
+
|
61
|
+
{% from 'label/macro.njk' import govukLabel %}
|
62
|
+
|
63
|
+
{{ govukLabel({
|
64
|
+
"text": "National Insurance number",
|
65
|
+
"classes": "govuk-label--xl",
|
66
|
+
"isPageHeading": true
|
67
|
+
}) }}
|
68
|
+
|
69
|
+
## Requirements
|
70
|
+
|
71
|
+
### Build tool configuration
|
72
|
+
|
73
|
+
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
74
|
+
|
75
|
+
.pipe(sass({
|
76
|
+
includePaths: 'node_modules/'
|
77
|
+
}))
|
78
|
+
|
79
|
+
### Static asset path configuration
|
80
|
+
|
81
|
+
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:
|
82
|
+
|
83
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
84
|
+
|
85
|
+
## Component arguments
|
86
|
+
|
87
|
+
If you are using Nunjucks,then macros take the following arguments
|
88
|
+
|
89
|
+
**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).**
|
90
|
+
|
91
|
+
<table class="govuk-table">
|
92
|
+
|
93
|
+
<thead class="govuk-table__head">
|
94
|
+
|
95
|
+
<tr class="govuk-table__row">
|
96
|
+
|
97
|
+
<th class="govuk-table__header" scope="col">Name</th>
|
98
|
+
|
99
|
+
<th class="govuk-table__header" scope="col">Type</th>
|
100
|
+
|
101
|
+
<th class="govuk-table__header" scope="col">Required</th>
|
102
|
+
|
103
|
+
<th class="govuk-table__header" scope="col">Description</th>
|
104
|
+
|
105
|
+
</tr>
|
106
|
+
|
107
|
+
</thead>
|
108
|
+
|
109
|
+
<tbody class="govuk-table__body">
|
110
|
+
|
111
|
+
<tr class="govuk-table__row">
|
112
|
+
|
113
|
+
<th class="govuk-table__header" scope="row">text (or) html</th>
|
114
|
+
|
115
|
+
<td class="govuk-table__cell ">string</td>
|
116
|
+
|
117
|
+
<td class="govuk-table__cell ">Yes</td>
|
118
|
+
|
119
|
+
<td class="govuk-table__cell ">Text or HTML to use within the label. If `html` is provided, the `text` argument will be ignored.</td>
|
120
|
+
|
121
|
+
</tr>
|
122
|
+
|
123
|
+
<tr class="govuk-table__row">
|
124
|
+
|
125
|
+
<th class="govuk-table__header" scope="row">for</th>
|
126
|
+
|
127
|
+
<td class="govuk-table__cell ">string</td>
|
128
|
+
|
129
|
+
<td class="govuk-table__cell ">Yes</td>
|
130
|
+
|
131
|
+
<td class="govuk-table__cell ">The value of the for attribute, the id of the input the label is associated with.</td>
|
132
|
+
|
133
|
+
</tr>
|
134
|
+
|
135
|
+
<tr class="govuk-table__row">
|
136
|
+
|
137
|
+
<th class="govuk-table__header" scope="row">isPageHeading</th>
|
138
|
+
|
139
|
+
<td class="govuk-table__cell ">boolean</td>
|
140
|
+
|
141
|
+
<td class="govuk-table__cell ">No</td>
|
142
|
+
|
143
|
+
<td class="govuk-table__cell ">Whether the label also acts as the heading for the page.</td>
|
144
|
+
|
145
|
+
</tr>
|
146
|
+
|
147
|
+
<tr class="govuk-table__row">
|
148
|
+
|
149
|
+
<th class="govuk-table__header" scope="row">classes</th>
|
150
|
+
|
151
|
+
<td class="govuk-table__cell ">string</td>
|
152
|
+
|
153
|
+
<td class="govuk-table__cell ">No</td>
|
154
|
+
|
155
|
+
<td class="govuk-table__cell ">Optional additional classes to add to the label tag.</td>
|
156
|
+
|
157
|
+
</tr>
|
158
|
+
|
159
|
+
<tr class="govuk-table__row">
|
160
|
+
|
161
|
+
<th class="govuk-table__header" scope="row">attributes</th>
|
162
|
+
|
163
|
+
<td class="govuk-table__cell ">object</td>
|
164
|
+
|
165
|
+
<td class="govuk-table__cell ">No</td>
|
166
|
+
|
167
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the label tag.</td>
|
168
|
+
|
169
|
+
</tr>
|
170
|
+
|
171
|
+
</tbody>
|
172
|
+
|
173
|
+
</table>
|
174
|
+
|
175
|
+
**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).**
|
176
|
+
|
177
|
+
### Setting up Nunjucks views and paths
|
178
|
+
|
179
|
+
Below is an example setup using express configure views:
|
180
|
+
|
181
|
+
nunjucks.configure('node_modules/govuk-frontend/components', {
|
182
|
+
autoescape: true,
|
183
|
+
cache: false,
|
184
|
+
express: app
|
185
|
+
})
|
186
|
+
|
187
|
+
## Contribution
|
188
|
+
|
189
|
+
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")
|
190
|
+
|
191
|
+
## License
|
192
|
+
|
193
|
+
MIT
|