dxw_govuk_frontend_rails 3.13.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +0 -4
  3. data/Gemfile.lock +1 -1
  4. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  5. data/package-lock.json +5 -12
  6. data/package.json +1 -1
  7. data/vendor/assets/javascripts/govuk_frontend_rails.js +272 -75
  8. data/vendor/assets/stylesheets/components/accordion/_index.scss +275 -98
  9. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +0 -2
  10. data/vendor/assets/stylesheets/components/error-message/_index.scss +1 -0
  11. data/vendor/assets/stylesheets/components/footer/_index.scss +3 -37
  12. data/vendor/assets/stylesheets/components/header/_index.scss +10 -4
  13. data/vendor/assets/stylesheets/components/hint/_index.scss +1 -3
  14. data/vendor/assets/stylesheets/components/input/_index.scss +1 -1
  15. data/vendor/assets/stylesheets/components/panel/_index.scss +13 -1
  16. data/vendor/assets/stylesheets/components/select/_index.scss +1 -1
  17. data/vendor/assets/stylesheets/components/skip-link/_index.scss +13 -0
  18. data/vendor/assets/stylesheets/components/summary-list/_index.scss +15 -23
  19. data/vendor/assets/stylesheets/components/tabs/_index.scss +2 -2
  20. data/vendor/assets/stylesheets/components/tag/_index.scss +0 -5
  21. data/vendor/assets/stylesheets/components/textarea/_index.scss +1 -1
  22. data/vendor/assets/stylesheets/core/_all.scss +0 -1
  23. data/vendor/assets/stylesheets/core/_global-styles.scss +0 -6
  24. data/vendor/assets/stylesheets/core/_links.scss +0 -6
  25. data/vendor/assets/stylesheets/core/_lists.scss +0 -6
  26. data/vendor/assets/stylesheets/core/_section-break.scss +0 -6
  27. data/vendor/assets/stylesheets/core/_typography.scss +0 -6
  28. data/vendor/assets/stylesheets/helpers/_spacing.scss +22 -4
  29. data/vendor/assets/stylesheets/objects/_all.scss +1 -0
  30. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -30
  31. data/vendor/assets/stylesheets/objects/_template.scss +32 -0
  32. data/vendor/assets/stylesheets/overrides/_all.scss +1 -0
  33. data/vendor/assets/stylesheets/overrides/_display.scss +0 -6
  34. data/vendor/assets/stylesheets/overrides/_spacing.scss +0 -6
  35. data/vendor/assets/stylesheets/overrides/_text-align.scss +14 -0
  36. data/vendor/assets/stylesheets/overrides/_typography.scss +0 -6
  37. data/vendor/assets/stylesheets/overrides/_width.scss +0 -6
  38. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +3 -0
  39. data/vendor/assets/stylesheets/settings/_measurements.scss +0 -10
  40. data/vendor/assets/stylesheets/tools/_all.scss +0 -1
  41. metadata +5 -3
@@ -6,21 +6,30 @@
6
6
  display: table;
7
7
  width: 100%;
8
8
  table-layout: fixed; // Required to allow us to wrap words that overflow.
9
+ border-collapse: collapse;
9
10
  }
10
11
  margin: 0; // Reset default user agent styles
11
12
  @include govuk-responsive-margin(6, "bottom");
12
13
  }
13
14
 
14
15
  .govuk-summary-list__row {
16
+ border-bottom: 1px solid $govuk-border-colour;
17
+
15
18
  @include govuk-media-query($until: tablet) {
16
19
  margin-bottom: govuk-spacing(3);
17
- border-bottom: 1px solid $govuk-border-colour;
18
20
  }
19
21
  @include govuk-media-query($from: tablet) {
20
22
  display: table-row;
21
23
  }
22
24
  }
23
25
 
26
+ // Provide an empty 'cell' for rows that don't have actions – otherwise the
27
+ // bottom border is not drawn for that part of the row in some browsers.
28
+ .govuk-summary-list__row--no-actions:after {
29
+ content: "";
30
+ display: table-cell;
31
+ }
32
+
24
33
  .govuk-summary-list__key,
25
34
  .govuk-summary-list__value,
26
35
  .govuk-summary-list__actions {
@@ -31,7 +40,6 @@
31
40
  padding-top: govuk-spacing(2);
32
41
  padding-right: govuk-spacing(4);
33
42
  padding-bottom: govuk-spacing(2);
34
- border-bottom: 1px solid $govuk-border-colour;
35
43
  }
36
44
  }
37
45
 
@@ -63,16 +71,6 @@
63
71
  @include govuk-media-query($until: tablet) {
64
72
  margin-bottom: govuk-spacing(3);
65
73
  }
66
- @include govuk-media-query($from: tablet) {
67
- width: 50%;
68
- }
69
- }
70
-
71
- // Expand width when value is last column (no action)
72
- .govuk-summary-list__value:last-child {
73
- @include govuk-media-query($from: tablet) {
74
- width: 70%;
75
- }
76
74
  }
77
75
 
78
76
  .govuk-summary-list__value > p {
@@ -109,36 +107,30 @@
109
107
 
110
108
  // No border on entire summary list
111
109
  .govuk-summary-list--no-border {
112
- @include govuk-media-query($until: tablet) {
113
- .govuk-summary-list__row {
114
- border: 0;
115
- }
110
+ .govuk-summary-list__row {
111
+ border: 0;
116
112
  }
117
113
 
114
+ // Increase padding by 1px to compensate for 'missing' border
118
115
  @include govuk-media-query($from: tablet) {
119
116
  .govuk-summary-list__key,
120
117
  .govuk-summary-list__value,
121
118
  .govuk-summary-list__actions {
122
- // Remove 1px border, add 1px height back on
123
119
  padding-bottom: govuk-spacing(2) + 1px;
124
- border: 0;
125
120
  }
126
121
  }
127
122
  }
128
123
 
129
124
  // No border on specific rows
130
125
  .govuk-summary-list__row--no-border {
131
- @include govuk-media-query($until: tablet) {
132
- border: 0;
133
- }
126
+ border: 0;
134
127
 
128
+ // Increase padding by 1px to compensate for 'missing' border
135
129
  @include govuk-media-query($from: tablet) {
136
130
  .govuk-summary-list__key,
137
131
  .govuk-summary-list__value,
138
132
  .govuk-summary-list__actions {
139
- // Remove 1px border, add 1px height back on
140
133
  padding-bottom: govuk-spacing(2) + 1px;
141
- border: 0;
142
134
  }
143
135
  }
144
136
  }
@@ -24,7 +24,7 @@
24
24
  &:before {
25
25
  @include govuk-text-colour;
26
26
  content: "\2014 "; // "— "
27
- margin-left: - govuk-spacing(5);
27
+ margin-left: govuk-spacing(-5);
28
28
  padding-right: govuk-spacing(1);
29
29
  }
30
30
  }
@@ -77,7 +77,7 @@
77
77
 
78
78
  position: relative;
79
79
 
80
- margin-top: - govuk-spacing(1);
80
+ margin-top: govuk-spacing(-1);
81
81
 
82
82
  // Compensation for border (otherwise we get a shift)
83
83
  margin-bottom: -$border-width;
@@ -34,11 +34,6 @@
34
34
  }
35
35
  }
36
36
 
37
- // Deprecated. We'll remove this class in a future release. Use `.govuk-tag--grey` instead.
38
- .govuk-tag--inactive {
39
- background-color: govuk-colour("dark-grey", $legacy: "grey-1");
40
- }
41
-
42
37
  .govuk-tag--grey {
43
38
  color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30);
44
39
  background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90);
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  .govuk-textarea--error {
41
- border: $govuk-border-width-form-element-error solid $govuk-error-colour;
41
+ border-color: $govuk-error-colour;
42
42
 
43
43
  &:focus {
44
44
  border-color: $govuk-input-border-colour;
@@ -1,6 +1,5 @@
1
1
  @import "links";
2
2
  @import "lists";
3
- @import "template";
4
3
  @import "typography";
5
4
  @import "section-break";
6
5
  @import "global-styles";
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @import "links";
8
2
  @import "typography";
9
3
 
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/links") {
8
2
 
9
3
  %govuk-link {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/lists") {
8
2
 
9
3
  %govuk-list {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/section-break") {
8
2
 
9
3
  %govuk-section-break {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/core/typography") {
8
2
 
9
3
  // Headings
@@ -8,15 +8,26 @@
8
8
  ///
9
9
  /// Returns measurement corresponding to the spacing point requested.
10
10
  ///
11
- /// @param {Number} $spacing-point - Point on the spacing scale (set in `settings/_spacing.sccs`)
11
+ /// @param {Number} $spacing-point - Point on the spacing scale
12
+ /// (set in `settings/_spacing.scss`)
12
13
  ///
13
- /// @returns {String} Spacing Measurement eg. 10px
14
+ /// @returns {String} Spacing measurement eg. 10px
14
15
  ///
15
16
  /// @example scss
16
17
  /// .element {
17
18
  /// padding: govuk-spacing(5);
18
- /// top: govuk-spacing(2) !important; // if `!important` is required
19
19
  /// }
20
+ ///
21
+ /// @example scss Using negative spacing
22
+ /// .element {
23
+ /// margin-top: govuk-spacing(-1);
24
+ /// }
25
+ ///
26
+ /// @example scss Marking spacing declarations as important
27
+ /// .element {
28
+ /// margin-top: govuk-spacing(1) !important;
29
+ /// }
30
+ ///
20
31
  /// @access public
21
32
 
22
33
  @function govuk-spacing($spacing-point) {
@@ -27,11 +38,18 @@
27
38
  + "#{$actual-input-type}.";
28
39
  }
29
40
 
41
+ $is-negative: false;
42
+ @if ($spacing-point < 0) {
43
+ $is-negative: true;
44
+ $spacing-point: abs($spacing-point);
45
+ }
46
+
30
47
  @if not map-has-key($govuk-spacing-points, $spacing-point) {
31
48
  @error "Unknown spacing variable `#{$spacing-point}`. Make sure you are using a point from the spacing scale in `_settings/spacing.scss`.";
32
49
  }
33
50
 
34
- @return map-get($govuk-spacing-points, $spacing-point);
51
+ $value: map-get($govuk-spacing-points, $spacing-point);
52
+ @return if($is-negative, $value * -1, $value);
35
53
  }
36
54
 
37
55
  /// Responsive spacing
@@ -2,4 +2,5 @@
2
2
  @import "form-group";
3
3
  @import "grid";
4
4
  @import "main-wrapper";
5
+ @import "template";
5
6
  @import "width-container";
@@ -21,37 +21,22 @@
21
21
  // </div>
22
22
  // </div>
23
23
 
24
- /// @deprecated Replace this mixin with more direct references to the [spacing
25
- /// mixins](https://design-system.service.gov.uk/styles/spacing/#spacing-on-custom-components).
26
- @mixin govuk-main-wrapper {
27
- // In IE11 the `main` element can be used, but is not recognized –
28
- // meaning it's not defined in IE's default style sheet,
29
- // so it uses CSS initial value, which is inline.
30
- display: block;
31
- padding-top: govuk-spacing(4);
32
- padding-bottom: govuk-spacing(4);
33
-
34
- @include govuk-media-query($from: tablet) {
35
- // This spacing is manually adjusted to replicate the margin of
36
- // govuk-heading-xl (50px) minus the spacing of back link and
37
- // breadcrumbs (10px)
38
- padding-top: govuk-spacing(7);
39
- padding-bottom: govuk-spacing(7);
40
- }
41
- }
42
-
43
- /// Use govuk-main-wrapper--l when you page does not have Breadcrumbs, phase
44
- /// banners or back links.
45
- ///
46
- /// @deprecated Replace this mixin with more direct references to the [spacing
47
- /// mixins](https://design-system.service.gov.uk/styles/spacing/#spacing-on-custom-components).
48
- @mixin govuk-main-wrapper--l {
49
- @include govuk-responsive-padding(8, "top");
50
- }
51
-
52
24
  @include govuk-exports("govuk/objects/main-wrapper") {
53
25
  .govuk-main-wrapper {
54
- @include govuk-main-wrapper;
26
+ // In IE11 the `main` element can be used, but is not recognized –
27
+ // meaning it's not defined in IE's default style sheet,
28
+ // so it uses CSS initial value, which is inline.
29
+ display: block;
30
+ padding-top: govuk-spacing(4);
31
+ padding-bottom: govuk-spacing(4);
32
+
33
+ @include govuk-media-query($from: tablet) {
34
+ // This spacing is manually adjusted to replicate the margin of
35
+ // govuk-heading-xl (50px) minus the spacing of back link and
36
+ // breadcrumbs (10px)
37
+ padding-top: govuk-spacing(7);
38
+ padding-bottom: govuk-spacing(7);
39
+ }
55
40
  }
56
41
 
57
42
  // Using the `.govuk-main-wrapper--auto-spacing` modifier should apply the
@@ -63,6 +48,6 @@
63
48
  // `govuk-main-wrapper--l` modifier instead.
64
49
  .govuk-main-wrapper--auto-spacing:first-child,
65
50
  .govuk-main-wrapper--l {
66
- @include govuk-main-wrapper--l;
51
+ @include govuk-responsive-padding(8, "top");
67
52
  }
68
53
  }
@@ -0,0 +1,32 @@
1
+ @import "../base";
2
+
3
+ @include govuk-exports("govuk/objects/template") {
4
+
5
+ // Applied to the <html> element
6
+ .govuk-template {
7
+ // Set the overall page background colour to the same colour as used by the
8
+ // footer to give the illusion of a long footer.
9
+ background-color: $govuk-canvas-background-colour;
10
+
11
+ // Prevent automatic text sizing, as we already cater for small devices and
12
+ // would like the browser to stay on 100% text zoom by default.
13
+ -webkit-text-size-adjust: 100%;
14
+ -ms-text-size-adjust: 100%;
15
+ text-size-adjust: 100%;
16
+
17
+ // Force the scrollbar to always display in IE, to prevent horizontal page
18
+ // jumps as content height changes (e.g. autocomplete results open).
19
+ @include govuk-media-query($media-type: screen) {
20
+ overflow-y: scroll;
21
+ }
22
+ }
23
+
24
+ // Applied to the <body> element
25
+ .govuk-template__body {
26
+ // The default margins set by user-agents are not required since we have our
27
+ // own containers.
28
+ margin: 0;
29
+ // Set the overall body of the page back to the typical background colour.
30
+ background-color: $govuk-body-background-colour;
31
+ }
32
+ }
@@ -1,4 +1,5 @@
1
1
  @import "display";
2
2
  @import "spacing";
3
+ @import "text-align";
3
4
  @import "typography";
4
5
  @import "width";
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  // stylelint-disable declaration-no-important
8
2
  @include govuk-exports("govuk/overrides/display") {
9
3
  .govuk-\!-display-inline {
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  ////
8
2
  /// @group overrides
9
3
  ////
@@ -0,0 +1,14 @@
1
+ // stylelint-disable declaration-no-important
2
+ @include govuk-exports("govuk/overrides/text-align") {
3
+ .govuk-\!-text-align-left {
4
+ text-align: left !important;
5
+ }
6
+
7
+ .govuk-\!-text-align-centre {
8
+ text-align: center !important;
9
+ }
10
+
11
+ .govuk-\!-text-align-right {
12
+ text-align: right !important;
13
+ }
14
+ }
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  @include govuk-exports("govuk/overrides/typography") {
8
2
  // Font size and line height
9
3
 
@@ -1,9 +1,3 @@
1
- @if not mixin-exists("govuk-exports") {
2
- @warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
3
- }
4
-
5
- @import "../base";
6
-
7
1
  // stylelint-disable declaration-no-important
8
2
  @include govuk-exports("govuk/overrides/width") {
9
3
  .govuk-\!-width-full {
@@ -54,6 +54,9 @@ $govuk-colours-organisations: (
54
54
  colour: #cf102d,
55
55
  colour-websafe: #005ea5
56
56
  ),
57
+ "department-for-levelling-up-housing-and-communities": (
58
+ colour: #012169,
59
+ ),
57
60
  "department-for-transport": (
58
61
  colour: #006c56,
59
62
  colour-websafe: #398373
@@ -73,16 +73,6 @@ $govuk-border-width-narrow: 4px !default;
73
73
 
74
74
  $govuk-border-width-form-element: 2px !default;
75
75
 
76
- /// Form control border width when in error state
77
- ///
78
- /// @type Number
79
- /// @access public
80
- /// @deprecated Use $govuk-border-width-form-element instead. There should be no
81
- /// difference in thickness for inputs in the error state, in order to
82
- /// maintain a distinct focus state.
83
-
84
- $govuk-border-width-form-element-error: 2px !default;
85
-
86
76
  /// Form group border width when in error state
87
77
  ///
88
78
  /// @type Number
@@ -2,7 +2,6 @@
2
2
  @import "exports";
3
3
  @import "font-url";
4
4
  @import "ie8";
5
- @import "iff";
6
5
  @import "image-url";
7
6
  @import "px-to-em";
8
7
  @import "px-to-rem";
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxw_govuk_frontend_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mec
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-11-12 00:00:00.000000000 Z
12
+ date: 2023-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -169,10 +169,12 @@ files:
169
169
  - vendor/assets/stylesheets/objects/_form-group.scss
170
170
  - vendor/assets/stylesheets/objects/_grid.scss
171
171
  - vendor/assets/stylesheets/objects/_main-wrapper.scss
172
+ - vendor/assets/stylesheets/objects/_template.scss
172
173
  - vendor/assets/stylesheets/objects/_width-container.scss
173
174
  - vendor/assets/stylesheets/overrides/_all.scss
174
175
  - vendor/assets/stylesheets/overrides/_display.scss
175
176
  - vendor/assets/stylesheets/overrides/_spacing.scss
177
+ - vendor/assets/stylesheets/overrides/_text-align.scss
176
178
  - vendor/assets/stylesheets/overrides/_typography.scss
177
179
  - vendor/assets/stylesheets/overrides/_width.scss
178
180
  - vendor/assets/stylesheets/settings/_all.scss
@@ -222,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
224
  - !ruby/object:Gem::Version
223
225
  version: '0'
224
226
  requirements: []
225
- rubygems_version: 3.2.22
227
+ rubygems_version: 3.3.26
226
228
  signing_key:
227
229
  specification_version: 4
228
230
  summary: Adds the GOVUK frontend to a Rails application that uses the Asset Pipeline.