dxw_govuk_frontend_rails 3.4.0 → 3.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -0
  3. data/Gemfile.lock +5 -4
  4. data/README.md +45 -42
  5. data/dxw_govuk_frontend_rails.gemspec +1 -1
  6. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  7. data/package-lock.json +3 -3
  8. data/package.json +1 -1
  9. data/vendor/assets/javascripts/govuk_frontend_rails.js +213 -124
  10. data/vendor/assets/stylesheets/_base.scss +3 -0
  11. data/vendor/assets/stylesheets/all.scss +1 -3
  12. data/vendor/assets/stylesheets/components/_all.scss +31 -29
  13. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -208
  14. data/vendor/assets/stylesheets/components/accordion/_index.scss +206 -0
  15. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -65
  16. data/vendor/assets/stylesheets/components/back-link/_index.scss +110 -0
  17. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -118
  18. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +137 -0
  19. data/vendor/assets/stylesheets/components/button/_button.scss +2 -290
  20. data/vendor/assets/stylesheets/components/button/_index.scss +280 -0
  21. data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -31
  22. data/vendor/assets/stylesheets/components/character-count/_index.scss +24 -0
  23. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -308
  24. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +305 -0
  25. data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -30
  26. data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
  27. data/vendor/assets/stylesheets/components/details/_details.scss +2 -88
  28. data/vendor/assets/stylesheets/components/details/_index.scss +83 -0
  29. data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -15
  30. data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
  31. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -59
  32. data/vendor/assets/stylesheets/components/error-summary/_index.scss +53 -0
  33. data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -68
  34. data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
  35. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -81
  36. data/vendor/assets/stylesheets/components/file-upload/_index.scss +50 -0
  37. data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -269
  38. data/vendor/assets/stylesheets/components/footer/_index.scss +234 -0
  39. data/vendor/assets/stylesheets/components/header/_header.scss +2 -318
  40. data/vendor/assets/stylesheets/components/header/_index.scss +309 -0
  41. data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -50
  42. data/vendor/assets/stylesheets/components/hint/_index.scss +44 -0
  43. data/vendor/assets/stylesheets/components/input/_index.scss +187 -0
  44. data/vendor/assets/stylesheets/components/input/_input.scss +2 -103
  45. data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
  46. data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -28
  47. data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
  48. data/vendor/assets/stylesheets/components/label/_label.scss +2 -45
  49. data/vendor/assets/stylesheets/components/panel/_index.scss +44 -0
  50. data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -44
  51. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
  52. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -31
  53. data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
  54. data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -346
  55. data/vendor/assets/stylesheets/components/select/_index.scss +49 -0
  56. data/vendor/assets/stylesheets/components/select/_select.scss +2 -57
  57. data/vendor/assets/stylesheets/components/skip-link/_index.scss +34 -0
  58. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -31
  59. data/vendor/assets/stylesheets/components/summary-list/_index.scss +145 -0
  60. data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -157
  61. data/vendor/assets/stylesheets/components/table/_index.scss +50 -0
  62. data/vendor/assets/stylesheets/components/table/_table.scss +2 -54
  63. data/vendor/assets/stylesheets/components/tabs/_index.scss +135 -0
  64. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -142
  65. data/vendor/assets/stylesheets/components/tag/_index.scss +86 -0
  66. data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -44
  67. data/vendor/assets/stylesheets/components/textarea/_index.scss +47 -0
  68. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -55
  69. data/vendor/assets/stylesheets/components/warning-text/_index.scss +57 -0
  70. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -60
  71. data/vendor/assets/stylesheets/core/_global-styles.scss +5 -3
  72. data/vendor/assets/stylesheets/core/_links.scss +5 -3
  73. data/vendor/assets/stylesheets/core/_lists.scss +17 -3
  74. data/vendor/assets/stylesheets/core/_section-break.scss +5 -3
  75. data/vendor/assets/stylesheets/core/_template.scss +5 -3
  76. data/vendor/assets/stylesheets/core/_typography.scss +5 -3
  77. data/vendor/assets/stylesheets/helpers/_clearfix.scss +1 -1
  78. data/vendor/assets/stylesheets/helpers/_colour.scss +1 -1
  79. data/vendor/assets/stylesheets/helpers/_device-pixels.scss +3 -3
  80. data/vendor/assets/stylesheets/helpers/_focused.scss +1 -1
  81. data/vendor/assets/stylesheets/helpers/_font-faces.scss +9 -11
  82. data/vendor/assets/stylesheets/helpers/_grid.scss +2 -1
  83. data/vendor/assets/stylesheets/helpers/_links.scss +2 -4
  84. data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -6
  85. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  86. data/vendor/assets/stylesheets/helpers/_spacing.scss +7 -6
  87. data/vendor/assets/stylesheets/helpers/_typography.scss +13 -12
  88. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +30 -30
  89. data/vendor/assets/stylesheets/objects/_form-group.scss +1 -4
  90. data/vendor/assets/stylesheets/objects/_grid.scss +3 -6
  91. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +5 -4
  92. data/vendor/assets/stylesheets/objects/_width-container.scss +12 -9
  93. data/vendor/assets/stylesheets/overrides/_display.scss +12 -4
  94. data/vendor/assets/stylesheets/overrides/_spacing.scss +5 -3
  95. data/vendor/assets/stylesheets/overrides/_typography.scss +5 -3
  96. data/vendor/assets/stylesheets/overrides/_width.scss +6 -3
  97. data/vendor/assets/stylesheets/settings/_colours-applied.scss +2 -5
  98. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +3 -0
  99. data/vendor/assets/stylesheets/settings/_colours-palette.scss +42 -35
  100. data/vendor/assets/stylesheets/settings/_compatibility.scss +0 -1
  101. data/vendor/assets/stylesheets/settings/_ie8.scss +1 -1
  102. data/vendor/assets/stylesheets/settings/_measurements.scss +4 -5
  103. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +2 -2
  104. data/vendor/assets/stylesheets/settings/_typography-font.scss +11 -5
  105. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +6 -2
  106. data/vendor/assets/stylesheets/tools/_compatibility.scss +1 -1
  107. data/vendor/assets/stylesheets/tools/_font-url.scss +1 -4
  108. data/vendor/assets/stylesheets/tools/_ie8.scss +1 -1
  109. data/vendor/assets/stylesheets/tools/_iff.scss +3 -1
  110. data/vendor/assets/stylesheets/tools/_image-url.scss +1 -4
  111. data/vendor/assets/stylesheets/tools/_px-to-em.scss +1 -1
  112. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
  113. data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +0 -1
  114. data/vendor/assets/stylesheets/vendor/_sass-mq.scss +0 -4
  115. metadata +36 -5
@@ -0,0 +1,83 @@
1
+ @include govuk-exports("govuk/component/details") {
2
+ .govuk-details {
3
+ @include govuk-font($size: 19);
4
+ @include govuk-text-colour;
5
+ @include govuk-responsive-margin(6, "bottom");
6
+
7
+ display: block;
8
+ }
9
+
10
+ .govuk-details__summary {
11
+ // Make the focus outline shrink-wrap the text content of the summary
12
+ display: inline-block;
13
+
14
+ // Absolutely position the marker against this element
15
+ position: relative;
16
+
17
+ margin-bottom: govuk-spacing(1);
18
+
19
+ // Allow for absolutely positioned marker and align with disclosed text
20
+ padding-left: govuk-spacing(4) + $govuk-border-width;
21
+
22
+ // Style the summary to look like a link...
23
+ color: $govuk-link-colour;
24
+ cursor: pointer;
25
+
26
+ &:hover {
27
+ color: $govuk-link-hover-colour;
28
+ }
29
+
30
+ &:focus {
31
+ @include govuk-focused-text;
32
+ }
33
+ }
34
+
35
+ // ...but only underline the text, not the arrow
36
+ .govuk-details__summary-text {
37
+ text-decoration: underline;
38
+ }
39
+
40
+ // Remove the underline when focussed to avoid duplicate borders
41
+ .govuk-details__summary:focus .govuk-details__summary-text {
42
+ text-decoration: none;
43
+ }
44
+
45
+ // Remove the default details marker so we can style our own consistently and
46
+ // ensure it displays in Firefox (see implementation.md for details)
47
+ .govuk-details__summary::-webkit-details-marker {
48
+ display: none;
49
+ }
50
+
51
+ // Append our own open / closed marker using a pseudo-element
52
+ .govuk-details__summary:before {
53
+ content: "";
54
+ position: absolute;
55
+
56
+ top: -1px;
57
+ bottom: 0;
58
+ left: 0;
59
+
60
+ margin: auto;
61
+
62
+ @include govuk-shape-arrow($direction: right, $base: 14px);
63
+
64
+ .govuk-details[open] > & {
65
+ @include govuk-shape-arrow($direction: down, $base: 14px);
66
+ }
67
+ }
68
+
69
+ .govuk-details__text {
70
+ padding: govuk-spacing(3);
71
+ padding-left: govuk-spacing(4);
72
+ border-left: $govuk-border-width solid $govuk-border-colour;
73
+ }
74
+
75
+ .govuk-details__text p {
76
+ margin-top: 0;
77
+ margin-bottom: govuk-spacing(4);
78
+ }
79
+
80
+ .govuk-details__text > :last-child {
81
+ margin-bottom: 0;
82
+ }
83
+ }
@@ -1,15 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/error-message") {
6
- .govuk-error-message {
7
- @include govuk-font($size: 19, $weight: bold);
8
-
9
- display: block;
10
- margin-bottom: govuk-spacing(3);
11
- clear: both;
12
-
13
- color: $govuk-error-colour;
14
- }
15
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,11 @@
1
+ @include govuk-exports("govuk/component/error-message") {
2
+ .govuk-error-message {
3
+ @include govuk-font($size: 19, $weight: bold);
4
+
5
+ display: block;
6
+ margin-bottom: govuk-spacing(3);
7
+ clear: both;
8
+
9
+ color: $govuk-error-colour;
10
+ }
11
+ }
@@ -1,59 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @import "../../core/lists";
6
-
7
- @include govuk-exports("govuk/component/error-summary") {
8
-
9
- .govuk-error-summary {
10
- @include govuk-text-colour;
11
- @include govuk-responsive-padding(4);
12
- @include govuk-responsive-margin(8, "bottom");
13
-
14
- border: $govuk-border-width solid $govuk-error-colour;
15
-
16
- &:focus {
17
- outline: $govuk-focus-width solid $govuk-focus-colour;
18
- }
19
- }
20
-
21
- .govuk-error-summary__title {
22
- @include govuk-font($size: 24, $weight: bold);
23
-
24
- margin-top: 0;
25
- @include govuk-responsive-margin(4, "bottom");
26
- }
27
-
28
- .govuk-error-summary__body {
29
- @include govuk-font($size: 19);
30
-
31
- p {
32
- margin-top: 0;
33
- @include govuk-responsive-margin(4, "bottom");
34
- }
35
- }
36
-
37
- // Cross-component class - adjusts styling of list component
38
- .govuk-error-summary__list {
39
- margin-top: 0;
40
- margin-bottom: 0;
41
- }
42
-
43
- .govuk-error-summary__list a {
44
- @include govuk-typography-weight-bold;
45
-
46
- // Override default link styling to use error colour
47
- &:link,
48
- &:visited,
49
- &:hover,
50
- &:active {
51
- color: $govuk-error-colour;
52
- }
53
-
54
- &:focus {
55
- @include govuk-focused-text;
56
- }
57
- }
58
-
59
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,53 @@
1
+ @import "../../core/lists";
2
+
3
+ @include govuk-exports("govuk/component/error-summary") {
4
+ .govuk-error-summary {
5
+ @include govuk-text-colour;
6
+ @include govuk-responsive-padding(4);
7
+ @include govuk-responsive-margin(8, "bottom");
8
+
9
+ border: $govuk-border-width solid $govuk-error-colour;
10
+
11
+ &:focus {
12
+ outline: $govuk-focus-width solid $govuk-focus-colour;
13
+ }
14
+ }
15
+
16
+ .govuk-error-summary__title {
17
+ @include govuk-font($size: 24, $weight: bold);
18
+
19
+ margin-top: 0;
20
+ @include govuk-responsive-margin(4, "bottom");
21
+ }
22
+
23
+ .govuk-error-summary__body {
24
+ @include govuk-font($size: 19);
25
+
26
+ p {
27
+ margin-top: 0;
28
+ @include govuk-responsive-margin(4, "bottom");
29
+ }
30
+ }
31
+
32
+ // Cross-component class - adjusts styling of list component
33
+ .govuk-error-summary__list {
34
+ margin-top: 0;
35
+ margin-bottom: 0;
36
+ }
37
+
38
+ .govuk-error-summary__list a {
39
+ @include govuk-typography-weight-bold;
40
+
41
+ // Override default link styling to use error colour
42
+ &:link,
43
+ &:visited,
44
+ &:hover,
45
+ &:active {
46
+ color: $govuk-error-colour;
47
+ }
48
+
49
+ &:focus {
50
+ @include govuk-focused-text;
51
+ }
52
+ }
53
+ }
@@ -1,68 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/fieldset") {
6
- .govuk-fieldset {
7
- min-width: 0;
8
- margin: 0;
9
- padding: 0;
10
- border: 0;
11
- @include govuk-clearfix;
12
- }
13
-
14
- // Fix for Firefox < 53
15
- // https://bugzilla.mozilla.org/show_bug.cgi?id=504622
16
- @supports not (caret-color: auto) {
17
- .govuk-fieldset,
18
- x:-moz-any-link {
19
- display: table-cell;
20
- }
21
- }
22
-
23
- .govuk-fieldset__legend {
24
- @include govuk-font($size: 19);
25
- @include govuk-text-colour;
26
-
27
- // Fix legend text wrapping in Edge and IE
28
- // 1. IE9-11 & Edge 12-13
29
- // 2. IE8-11
30
- box-sizing: border-box; // 1
31
- display: table; // 2
32
- max-width: 100%; // 1
33
- margin-bottom: govuk-spacing(2);
34
- padding: 0;
35
-
36
- white-space: normal; // 1
37
- }
38
-
39
- // Modifiers that make legends look more like their equivalent headings
40
-
41
- .govuk-fieldset__legend--xl {
42
- @include govuk-font($size: 48, $weight: bold);
43
- margin-bottom: govuk-spacing(3);
44
- }
45
-
46
- .govuk-fieldset__legend--l {
47
- @include govuk-font($size: 36, $weight: bold);
48
- margin-bottom: govuk-spacing(3);
49
- }
50
-
51
- .govuk-fieldset__legend--m {
52
- @include govuk-font($size: 24, $weight: bold);
53
- margin-bottom: govuk-spacing(3);
54
- }
55
-
56
- .govuk-fieldset__legend--s {
57
- @include govuk-font($size: 19, $weight: bold);
58
- }
59
-
60
- // When the legend contains an H1, we want the H1 to inherit all styles from
61
- // the legend. Effectively we want to be able to treat the heading as if it is
62
- // not there.
63
- .govuk-fieldset__heading {
64
- margin: 0;
65
- font-size: inherit;
66
- font-weight: inherit;
67
- }
68
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,64 @@
1
+ @include govuk-exports("govuk/component/fieldset") {
2
+ .govuk-fieldset {
3
+ min-width: 0;
4
+ margin: 0;
5
+ padding: 0;
6
+ border: 0;
7
+ @include govuk-clearfix;
8
+ }
9
+
10
+ // Fix for Firefox < 53
11
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=504622
12
+ @supports not (caret-color: auto) {
13
+ .govuk-fieldset,
14
+ x:-moz-any-link { // stylelint-disable-line selector-type-no-unknown
15
+ display: table-cell;
16
+ }
17
+ }
18
+
19
+ .govuk-fieldset__legend {
20
+ @include govuk-font($size: 19);
21
+ @include govuk-text-colour;
22
+
23
+ // Fix legend text wrapping in Edge and IE
24
+ // 1. IE9-11 & Edge 12-13
25
+ // 2. IE8-11
26
+ box-sizing: border-box; // 1
27
+ display: table; // 2
28
+ max-width: 100%; // 1
29
+ margin-bottom: govuk-spacing(2);
30
+ padding: 0;
31
+
32
+ white-space: normal; // 1
33
+ }
34
+
35
+ // Modifiers that make legends look more like their equivalent headings
36
+
37
+ .govuk-fieldset__legend--xl {
38
+ @include govuk-font($size: 48, $weight: bold);
39
+ margin-bottom: govuk-spacing(3);
40
+ }
41
+
42
+ .govuk-fieldset__legend--l {
43
+ @include govuk-font($size: 36, $weight: bold);
44
+ margin-bottom: govuk-spacing(3);
45
+ }
46
+
47
+ .govuk-fieldset__legend--m {
48
+ @include govuk-font($size: 24, $weight: bold);
49
+ margin-bottom: govuk-spacing(3);
50
+ }
51
+
52
+ .govuk-fieldset__legend--s {
53
+ @include govuk-font($size: 19, $weight: bold);
54
+ }
55
+
56
+ // When the legend contains an H1, we want the H1 to inherit all styles from
57
+ // the legend. Effectively we want to be able to treat the heading as if it is
58
+ // not there.
59
+ .govuk-fieldset__heading {
60
+ margin: 0;
61
+ font-size: inherit;
62
+ font-weight: inherit;
63
+ }
64
+ }
@@ -1,81 +1,2 @@
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
- $component-padding: govuk-spacing(1);
11
-
12
- .govuk-file-upload {
13
- @include govuk-font($size: 19);
14
- @include govuk-text-colour;
15
- padding-top: $component-padding;
16
- padding-bottom: $component-padding;
17
-
18
- &:focus {
19
- // "Yank" the padding with negative margin to avoid a jump
20
- // when element is focused
21
- margin-right: -$component-padding;
22
- margin-left: -$component-padding;
23
- padding-right: $component-padding;
24
- padding-left: $component-padding;
25
-
26
- outline: $govuk-focus-width solid $govuk-focus-colour;
27
- // Use `box-shadow` to add border instead of changing `border-width`
28
- // (which changes element size) and since `outline` is already used for the
29
- // yellow focus state.
30
- box-shadow: inset 0 0 0 4px $govuk-input-border-colour;
31
-
32
- @include govuk-if-ie8 {
33
- // IE8 doesn't support `box-shadow` so add an actual border
34
- border: 4px solid $govuk-input-border-colour;
35
- }
36
- }
37
-
38
- // Set "focus-within" to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1430196
39
- // so that component receives focus in Firefox.
40
- // This can't be set together with `:focus` as all versions of IE fail
41
- // to recognise `focus-within` and don't set any styles from the block
42
- // when it's a selector.
43
- &:focus-within {
44
- margin-right: -$component-padding;
45
- margin-left: -$component-padding;
46
- padding-right: $component-padding;
47
- padding-left: $component-padding;
48
-
49
- outline: $govuk-focus-width solid $govuk-focus-colour;
50
-
51
- box-shadow: inset 0 0 0 4px $govuk-input-border-colour;
52
- }
53
- }
54
-
55
- .govuk-file-upload--error {
56
- // As `upload--error` has border, it needs to have the same padding as
57
- // the standard focused element.
58
- margin-right: -$component-padding;
59
- margin-left: -$component-padding;
60
- padding-right: $component-padding;
61
- padding-left: $component-padding;
62
- border: $govuk-border-width-form-element-error solid $govuk-error-colour;
63
-
64
- &:focus {
65
- border-color: $govuk-input-border-colour;
66
- // Remove `box-shadow` inherited from `:focus` as `file-upload--error`
67
- // already has the thicker border.
68
- box-shadow: none;
69
- }
70
-
71
- // Repeat `:focus` styles to prevent error styles from being applied when
72
- // input button is pressed as this moves the focus to "within".
73
- // This can't be set together with `:focus` as all versions of IE fail
74
- // to recognise `focus-within` and don't set any styles from the block
75
- // when it's a selector.
76
- &:focus-within {
77
- border-color: $govuk-input-border-colour;
78
- box-shadow: none;
79
- }
80
- }
81
- }
1
+ @import "../../base";
2
+ @import "./index";