dxw_govuk_frontend_rails 3.3.0 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gempush.yml +2 -2
  3. data/.github/workflows/test.yml +19 -0
  4. data/Gemfile.lock +3 -3
  5. data/dxw_govuk_frontend_rails.gemspec +1 -1
  6. data/lib/dxw_govuk_frontend_rails.rb +12 -1
  7. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  8. data/package-lock.json +3 -3
  9. data/package.json +1 -1
  10. data/vendor/assets/javascripts/govuk_frontend_rails.js +41 -68
  11. data/vendor/assets/stylesheets/_base.scss +3 -0
  12. data/vendor/assets/stylesheets/all.scss +1 -3
  13. data/vendor/assets/stylesheets/components/_all.scss +31 -29
  14. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -208
  15. data/vendor/assets/stylesheets/components/accordion/_index.scss +207 -0
  16. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -62
  17. data/vendor/assets/stylesheets/components/back-link/_index.scss +112 -0
  18. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -118
  19. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +138 -0
  20. data/vendor/assets/stylesheets/components/button/_button.scss +2 -290
  21. data/vendor/assets/stylesheets/components/button/_index.scss +280 -0
  22. data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -31
  23. data/vendor/assets/stylesheets/components/character-count/_index.scss +28 -0
  24. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -308
  25. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +304 -0
  26. data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -30
  27. data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
  28. data/vendor/assets/stylesheets/components/details/_details.scss +2 -88
  29. data/vendor/assets/stylesheets/components/details/_index.scss +84 -0
  30. data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -15
  31. data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
  32. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -59
  33. data/vendor/assets/stylesheets/components/error-summary/_index.scss +55 -0
  34. data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -68
  35. data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
  36. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -81
  37. data/vendor/assets/stylesheets/components/file-upload/_index.scss +77 -0
  38. data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -269
  39. data/vendor/assets/stylesheets/components/footer/_index.scss +238 -0
  40. data/vendor/assets/stylesheets/components/header/_header.scss +2 -318
  41. data/vendor/assets/stylesheets/components/header/_index.scss +312 -0
  42. data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -50
  43. data/vendor/assets/stylesheets/components/hint/_index.scss +46 -0
  44. data/vendor/assets/stylesheets/components/input/_index.scss +99 -0
  45. data/vendor/assets/stylesheets/components/input/_input.scss +2 -103
  46. data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
  47. data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -28
  48. data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
  49. data/vendor/assets/stylesheets/components/label/_label.scss +2 -45
  50. data/vendor/assets/stylesheets/components/panel/_index.scss +40 -0
  51. data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -44
  52. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
  53. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -31
  54. data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
  55. data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -346
  56. data/vendor/assets/stylesheets/components/select/_index.scss +53 -0
  57. data/vendor/assets/stylesheets/components/select/_select.scss +2 -57
  58. data/vendor/assets/stylesheets/components/skip-link/_index.scss +33 -0
  59. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -31
  60. data/vendor/assets/stylesheets/components/summary-list/_index.scss +153 -0
  61. data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -157
  62. data/vendor/assets/stylesheets/components/table/_index.scss +50 -0
  63. data/vendor/assets/stylesheets/components/table/_table.scss +2 -54
  64. data/vendor/assets/stylesheets/components/tabs/_index.scss +138 -0
  65. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -142
  66. data/vendor/assets/stylesheets/components/tag/_index.scss +87 -0
  67. data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -44
  68. data/vendor/assets/stylesheets/components/textarea/_index.scss +51 -0
  69. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -55
  70. data/vendor/assets/stylesheets/components/warning-text/_index.scss +56 -0
  71. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -60
  72. data/vendor/assets/stylesheets/core/_global-styles.scss +5 -3
  73. data/vendor/assets/stylesheets/core/_links.scss +5 -3
  74. data/vendor/assets/stylesheets/core/_lists.scss +17 -3
  75. data/vendor/assets/stylesheets/core/_section-break.scss +5 -3
  76. data/vendor/assets/stylesheets/core/_template.scss +5 -3
  77. data/vendor/assets/stylesheets/core/_typography.scss +5 -3
  78. data/vendor/assets/stylesheets/helpers/_clearfix.scss +1 -1
  79. data/vendor/assets/stylesheets/helpers/_focused.scss +1 -1
  80. data/vendor/assets/stylesheets/helpers/_grid.scss +2 -1
  81. data/vendor/assets/stylesheets/helpers/_links.scss +1 -1
  82. data/vendor/assets/stylesheets/helpers/_media-queries.scss +1 -1
  83. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  84. data/vendor/assets/stylesheets/helpers/_spacing.scss +5 -5
  85. data/vendor/assets/stylesheets/helpers/_typography.scss +6 -6
  86. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +30 -30
  87. data/vendor/assets/stylesheets/objects/_form-group.scss +1 -3
  88. data/vendor/assets/stylesheets/objects/_grid.scss +1 -3
  89. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +5 -3
  90. data/vendor/assets/stylesheets/objects/_width-container.scss +34 -13
  91. data/vendor/assets/stylesheets/overrides/_display.scss +11 -3
  92. data/vendor/assets/stylesheets/overrides/_spacing.scss +5 -3
  93. data/vendor/assets/stylesheets/overrides/_typography.scss +5 -3
  94. data/vendor/assets/stylesheets/overrides/_width.scss +5 -3
  95. data/vendor/assets/stylesheets/settings/_colours-palette.scss +1 -1
  96. data/vendor/assets/stylesheets/settings/_ie8.scss +1 -1
  97. data/vendor/assets/stylesheets/tools/_compatibility.scss +1 -1
  98. data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
  99. data/vendor/assets/stylesheets/tools/_ie8.scss +1 -1
  100. data/vendor/assets/stylesheets/tools/_iff.scss +3 -1
  101. data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
  102. data/vendor/assets/stylesheets/tools/_px-to-em.scss +1 -1
  103. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
  104. metadata +36 -5
@@ -0,0 +1,207 @@
1
+ @include govuk-exports("govuk/component/accordion") {
2
+
3
+ $govuk-accordion-link-colour: $govuk-link-colour;
4
+ $govuk-accordion-link-hover-colour: govuk-colour("light-blue");
5
+ $govuk-accordion-border-width: 3px;
6
+
7
+ .govuk-accordion {
8
+ @include govuk-responsive-margin(6, "bottom");
9
+ }
10
+
11
+ // Borders between accordion sections
12
+ .govuk-accordion__section {
13
+ padding-top: govuk-spacing(3);
14
+ }
15
+
16
+ .govuk-accordion__section-header {
17
+ padding-top: govuk-spacing(3);
18
+ padding-bottom: govuk-spacing(3);
19
+ }
20
+
21
+ .govuk-accordion__section-heading {
22
+ // Override browser defaults to ensure consistent element height
23
+ // Font size is set in .govuk-accordion__section-button
24
+ @include govuk-font(24);
25
+
26
+ margin-top: 0; // Override browser default
27
+ margin-bottom: 0; // Override browser default
28
+ }
29
+
30
+ // Buttons within the sections don’t need default styling
31
+ .govuk-accordion__section-button {
32
+ @include govuk-font($size: 24, $weight: bold);
33
+ display: inline-block;
34
+ margin-bottom: 0;
35
+ padding-top: govuk-spacing(3);
36
+ }
37
+
38
+ .govuk-accordion__section-summary {
39
+ margin-top: govuk-spacing(2);
40
+ margin-bottom: 0;
41
+ }
42
+
43
+ // Remove the bottom margin from the last item inside the content
44
+ .govuk-accordion__section-content > :last-child {
45
+ margin-bottom: 0;
46
+ }
47
+
48
+ // JavaScript enabled
49
+ .js-enabled {
50
+
51
+ .govuk-accordion {
52
+ // Border at the bottom of the whole accordion
53
+ border-bottom: 1px solid $govuk-border-colour;
54
+ }
55
+
56
+ // Borders between accordion sections
57
+ .govuk-accordion__section {
58
+ padding-top: 0;
59
+ }
60
+
61
+ // Hide the body of collapsed sections
62
+ .govuk-accordion__section-content {
63
+ display: none;
64
+ @include govuk-responsive-padding(3, "top");
65
+ @include govuk-responsive-padding(3, "bottom");
66
+ }
67
+
68
+ // Show the body of expanded sections
69
+ .govuk-accordion__section--expanded .govuk-accordion__section-content {
70
+ display: block;
71
+ }
72
+
73
+ // This is styled to look like a link not a button
74
+ .govuk-accordion__open-all {
75
+ @include govuk-font($size: 16);
76
+ position: relative;
77
+ z-index: 1;
78
+ margin: 0;
79
+ padding: 0;
80
+ border-width: 0;
81
+ color: $govuk-link-colour;
82
+ background: none;
83
+ cursor: pointer;
84
+ -webkit-appearance: none;
85
+
86
+ @include govuk-link-common;
87
+ @include govuk-link-style-default;
88
+
89
+ // Remove default button focus outline in Firefox
90
+ &::-moz-focus-inner {
91
+ padding: 0;
92
+ border: 0;
93
+ }
94
+ }
95
+
96
+ // Section headers have a pointer cursor as an additional affordance
97
+ .govuk-accordion__section-header {
98
+ position: relative;
99
+ // Safe area on the right to avoid clashing with icon
100
+ padding-right: 40px;
101
+ border-top: 1px solid $govuk-border-colour;
102
+ color: $govuk-accordion-link-colour;
103
+ cursor: pointer;
104
+ }
105
+
106
+ // For devices that can't hover such as touch devices,
107
+ // remove hover state as it can be stuck in that state (iOS).
108
+ @media (hover: none) {
109
+ .govuk-accordion__section-header:hover {
110
+ border-top-color: $govuk-accordion-link-colour;
111
+ box-shadow: inset 0 $govuk-accordion-border-width 0 0 $govuk-accordion-link-colour;
112
+ }
113
+ }
114
+
115
+ // Buttons within the headers don’t need default styling
116
+ .govuk-accordion__section-button {
117
+ @include govuk-typography-common;
118
+ margin-top: 0;
119
+ margin-bottom: 0;
120
+ margin-left: 0;
121
+ padding: 0;
122
+ border-width: 0;
123
+ color: inherit;
124
+ background: none;
125
+ text-align: left;
126
+ cursor: pointer;
127
+ -webkit-appearance: none;
128
+
129
+ &:focus {
130
+ @include govuk-focused-text;
131
+ }
132
+
133
+ // Remove default button focus outline in Firefox
134
+ &::-moz-focus-inner {
135
+ padding: 0;
136
+ border: 0;
137
+ }
138
+ }
139
+
140
+ // Extend the touch area of the button to span the section header
141
+ .govuk-accordion__section-button:after {
142
+ content: "";
143
+ position: absolute;
144
+ top: 0;
145
+ right: 0;
146
+ bottom: 0;
147
+ left: 0;
148
+ }
149
+
150
+ .govuk-accordion__section-button:hover:not(:focus) {
151
+ text-decoration: underline;
152
+ }
153
+
154
+ // For devices that can't hover such as touch devices,
155
+ // remove hover state as it can be stuck in that state (iOS).
156
+ @media (hover: none) {
157
+ .govuk-accordion__section-button:hover {
158
+ text-decoration: none;
159
+ }
160
+ }
161
+
162
+ .govuk-accordion__controls {
163
+ text-align: right;
164
+ }
165
+
166
+ // Display an icon to the right of each header to indicate open/closed status,
167
+ // and as an additional affordance.
168
+ .govuk-accordion__icon {
169
+ position: absolute;
170
+ top: 50%;
171
+ right: 15px;
172
+ width: 16px;
173
+ height: 16px;
174
+ margin-top: -8px;
175
+ }
176
+
177
+ .govuk-accordion__icon:after,
178
+ .govuk-accordion__icon:before {
179
+ content: "";
180
+ box-sizing: border-box;
181
+ position: absolute;
182
+ top: 0;
183
+ right: 0;
184
+ bottom: 0;
185
+ left: 0;
186
+ width: 25%;
187
+ height: 25%;
188
+ margin: auto;
189
+ border: 2px solid transparent;
190
+ background-color: govuk-colour("black");
191
+ }
192
+
193
+ .govuk-accordion__icon:before {
194
+ width: 100%;
195
+ }
196
+
197
+ .govuk-accordion__icon:after {
198
+ height: 100%;
199
+ }
200
+
201
+ // Vertical bar should be hidden when section is open, to display a '-' icon
202
+ .govuk-accordion__section--expanded .govuk-accordion__icon:after {
203
+ content: " ";
204
+ display: none;
205
+ }
206
+ }
207
+ }
@@ -1,62 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/back-link") {
6
-
7
- .govuk-back-link {
8
- @include govuk-typography-responsive($size: 16);
9
- @include govuk-link-common;
10
- @include govuk-link-style-text;
11
-
12
- display: inline-block;
13
- position: relative;
14
-
15
- margin-top: govuk-spacing(3);
16
- margin-bottom: govuk-spacing(3);
17
-
18
- // Allow space for the arrow
19
- padding-left: 14px;
20
-
21
- // Use border-bottom rather than text-decoration so that the arrow is
22
- // underlined as well.
23
- border-bottom: 1px solid govuk-colour("black");
24
-
25
- // Underline is provided by a bottom border
26
- text-decoration: none;
27
-
28
- // When the back link is focused, hide the bottom link border as the
29
- // focus styles has a bottom border.
30
- &:focus {
31
- border-bottom-color: transparent;
32
- }
33
-
34
- // Prepend left pointing arrow
35
- &:before {
36
- @include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
37
-
38
- content: "";
39
-
40
- // Vertically align with the parent element
41
- position: absolute;
42
-
43
- top: 0;
44
- bottom: 0;
45
- left: 0;
46
-
47
- margin: auto;
48
- }
49
- }
50
-
51
- @if $govuk-use-legacy-font {
52
- // Begin adjustments for font baseline offset
53
- // These should be removed when legacy font support is dropped
54
- .govuk-back-link:before {
55
- $offset: 1px;
56
-
57
- top: $offset * -1;
58
- bottom: $offset;
59
- }
60
- }
61
-
62
- }
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,112 @@
1
+ @include govuk-exports("govuk/component/back-link") {
2
+
3
+ // Size of chevron (excluding border)
4
+ $chevron-size: 7px;
5
+
6
+ // Size of chevron border
7
+ $chevron-border-width: 1px;
8
+
9
+ // Colour of chevron
10
+ $chevron-border-colour: $govuk-secondary-text-colour;
11
+
12
+ .govuk-back-link {
13
+ @include govuk-typography-responsive($size: 16);
14
+ @include govuk-link-common;
15
+ @include govuk-link-style-text;
16
+
17
+ display: inline-block;
18
+ position: relative;
19
+
20
+ margin-top: govuk-spacing(3);
21
+ margin-bottom: govuk-spacing(3);
22
+
23
+ // Allow space for the arrow
24
+ padding-left: 14px;
25
+ }
26
+
27
+ // Only underline if the component is linkable
28
+ .govuk-back-link[href] {
29
+ text-decoration: underline;
30
+
31
+ // When the back link is focused, hide the bottom link border as the
32
+ // focus styles has a bottom border.
33
+ &:focus {
34
+ text-decoration: none;
35
+
36
+ &:before {
37
+ border-color: $govuk-text-colour;
38
+ }
39
+ }
40
+ }
41
+
42
+ // Prepend left pointing chevron
43
+ .govuk-back-link:before {
44
+ content: "";
45
+ display: block;
46
+
47
+ // Vertically align with the parent element
48
+ position: absolute;
49
+
50
+ @if $govuk-use-legacy-font {
51
+ // Begin adjustments for font baseline offset
52
+ // These should be removed when legacy font support is dropped
53
+ top: -1px;
54
+ bottom: 1px;
55
+
56
+ } @else {
57
+ top: 0;
58
+ bottom: 0;
59
+ }
60
+
61
+ left: 3px;
62
+
63
+ width: $chevron-size;
64
+ height: $chevron-size;
65
+
66
+ margin: auto 0;
67
+
68
+ -webkit-transform: rotate(225deg);
69
+
70
+ -ms-transform: rotate(225deg);
71
+
72
+ transform: rotate(225deg);
73
+
74
+ border: solid;
75
+ border-width: $chevron-border-width $chevron-border-width 0 0;
76
+ border-color: $chevron-border-colour;
77
+
78
+ // Fall back to a less than sign for IE8
79
+ @include govuk-if-ie8 {
80
+ content: "\003c"; // Less than sign (<)
81
+ width: auto;
82
+ height: auto;
83
+ border: 0;
84
+ color: $chevron-border-colour;
85
+
86
+ // IE8 doesn't seem to like rendering pseudo-elements using @font-faces,
87
+ // so fall back to using another sans-serif font to render the chevron.
88
+ font-family: Arial, sans-serif;
89
+ }
90
+ }
91
+
92
+ .govuk-back-link:after {
93
+ content: "";
94
+ position: absolute;
95
+ top: -14px;
96
+ right: 0;
97
+ bottom: -14px;
98
+ left: 0;
99
+ }
100
+
101
+ @if $govuk-use-legacy-font {
102
+ // Begin adjustments for font baseline offset
103
+ // These should be removed when legacy font support is dropped
104
+ .govuk-back-link:before {
105
+ $offset: 1px;
106
+
107
+ top: $offset * -1;
108
+ bottom: $offset;
109
+ }
110
+ }
111
+
112
+ }
@@ -1,118 +1,2 @@
1
- @import "../../settings/all";
2
- @import "../../tools/all";
3
- @import "../../helpers/all";
4
-
5
- @include govuk-exports("govuk/component/breadcrumbs") {
6
-
7
- // Size of chevron (excluding border)
8
- $chevron-size: 7px;
9
-
10
- // Size of chevron border
11
- $chevron-border-width: 1px;
12
-
13
- // Colour of chevron
14
- $chevron-border-colour: $govuk-secondary-text-colour;
15
-
16
- // Calculated altitude (△↕) of the right-angled isosceles chevron with sides
17
- // of length 8 (7px + 1px border):
18
- //
19
- // √(8² + 8²) * 0.5 ≅ 5.655
20
- $chevron-altitude-calculated: 5.655px;
21
-
22
- .govuk-breadcrumbs {
23
- @include govuk-font($size: 16);
24
- @include govuk-text-colour;
25
-
26
- margin-top: govuk-spacing(3);
27
- margin-bottom: govuk-spacing(2);
28
- }
29
-
30
- .govuk-breadcrumbs__list {
31
- @include govuk-clearfix;
32
-
33
- margin: 0;
34
- padding: 0;
35
- list-style-type: none;
36
- }
37
-
38
- .govuk-breadcrumbs__list-item {
39
-
40
- display: inline-block;
41
- position: relative;
42
-
43
- margin-bottom: govuk-spacing(1);
44
-
45
- // Add both margin and padding such that the chevron appears centrally
46
- // between each breadcrumb item
47
- margin-left: govuk-spacing(2);
48
- padding-left: govuk-spacing(2) + $chevron-altitude-calculated;
49
-
50
- float: left;
51
-
52
- // Create a chevron using a box with borders on two sides, rotated 45deg.
53
- &:before {
54
- content: "";
55
- display: block;
56
-
57
- position: absolute;
58
-
59
- @if $govuk-use-legacy-font {
60
- // Begin adjustments for font baseline offset
61
- // These should be removed when legacy font support is dropped
62
- top: -1px;
63
- bottom: 1px;
64
-
65
- } @else {
66
- top: 0;
67
- bottom: 0;
68
- }
69
-
70
- // Offset by the difference between the width of the non-rotated square
71
- // and its width when rotated
72
- left: (($chevron-altitude-calculated * -2) + $chevron-size + $chevron-border-width);
73
-
74
- width: $chevron-size;
75
- height: $chevron-size;
76
-
77
- margin: auto 0;
78
-
79
- -webkit-transform: rotate(45deg);
80
-
81
- -ms-transform: rotate(45deg);
82
-
83
- transform: rotate(45deg);
84
-
85
- border: solid;
86
- border-width: $chevron-border-width $chevron-border-width 0 0;
87
- border-color: $chevron-border-colour;
88
-
89
- // Fall back to a greater than sign for IE8
90
- @include govuk-if-ie8 {
91
- content: "\003e"; // Greater than sign (>)
92
- width: auto;
93
- height: auto;
94
- border: 0;
95
- color: $chevron-border-colour;
96
-
97
- // IE8 doesn't seem to like rendering pseudo-elements using @font-faces,
98
- // so fall back to using another sans-serif font to render the chevron.
99
- font-family: Arial, sans-serif;
100
- }
101
- }
102
-
103
- &:first-child {
104
- margin-left: 0;
105
- padding-left: 0;
106
-
107
- &:before {
108
- content: none;
109
- display: none;
110
- }
111
- }
112
- }
113
-
114
- .govuk-breadcrumbs__link {
115
- @include govuk-link-common;
116
- @include govuk-link-style-text;
117
- }
118
- }
1
+ @import "../../base";
2
+ @import "./index";