dxw_govuk_frontend_rails 3.14.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) 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 +4527 -2376
  8. data/vendor/assets/stylesheets/all-ie8.scss +8 -0
  9. data/vendor/assets/stylesheets/components/_all.scss +2 -1
  10. data/vendor/assets/stylesheets/components/accordion/_index.scss +294 -99
  11. data/vendor/assets/stylesheets/components/back-link/_index.scss +20 -20
  12. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +22 -13
  13. data/vendor/assets/stylesheets/components/button/_index.scss +37 -27
  14. data/vendor/assets/stylesheets/components/character-count/_index.scss +9 -0
  15. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +9 -8
  16. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +0 -2
  17. data/vendor/assets/stylesheets/components/error-message/_index.scss +1 -0
  18. data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -1
  19. data/vendor/assets/stylesheets/components/footer/_index.scss +16 -67
  20. data/vendor/assets/stylesheets/components/header/_index.scss +44 -26
  21. data/vendor/assets/stylesheets/components/hint/_index.scss +1 -3
  22. data/vendor/assets/stylesheets/components/input/_index.scss +29 -27
  23. data/vendor/assets/stylesheets/components/pagination/_index.scss +247 -0
  24. data/vendor/assets/stylesheets/components/pagination/_pagination.scss +2 -0
  25. data/vendor/assets/stylesheets/components/panel/_index.scss +1 -1
  26. data/vendor/assets/stylesheets/components/radios/_index.scss +10 -17
  27. data/vendor/assets/stylesheets/components/select/_index.scss +19 -2
  28. data/vendor/assets/stylesheets/components/skip-link/_index.scss +14 -3
  29. data/vendor/assets/stylesheets/components/summary-list/_index.scss +164 -33
  30. data/vendor/assets/stylesheets/components/table/_index.scss +1 -1
  31. data/vendor/assets/stylesheets/components/tabs/_index.scss +2 -2
  32. data/vendor/assets/stylesheets/components/tag/_index.scss +18 -23
  33. data/vendor/assets/stylesheets/components/textarea/_index.scss +9 -2
  34. data/vendor/assets/stylesheets/core/_all.scss +1 -1
  35. data/vendor/assets/stylesheets/core/_global-styles.scss +0 -6
  36. data/vendor/assets/stylesheets/core/_govuk-frontend-version.scss +5 -0
  37. data/vendor/assets/stylesheets/core/_links.scss +0 -6
  38. data/vendor/assets/stylesheets/core/_lists.scss +0 -6
  39. data/vendor/assets/stylesheets/core/_section-break.scss +1 -7
  40. data/vendor/assets/stylesheets/core/_typography.scss +0 -6
  41. data/vendor/assets/stylesheets/helpers/_colour.scss +10 -7
  42. data/vendor/assets/stylesheets/helpers/_focused.scss +6 -1
  43. data/vendor/assets/stylesheets/helpers/_font-faces.scss +1 -1
  44. data/vendor/assets/stylesheets/helpers/_links.scss +13 -11
  45. data/vendor/assets/stylesheets/helpers/_media-queries.scss +2 -2
  46. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
  47. data/vendor/assets/stylesheets/helpers/_spacing.scss +3 -3
  48. data/vendor/assets/stylesheets/helpers/_typography.scss +16 -9
  49. data/vendor/assets/stylesheets/objects/_all.scss +1 -0
  50. data/vendor/assets/stylesheets/objects/_button-group.scss +10 -26
  51. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -30
  52. data/vendor/assets/stylesheets/objects/_template.scss +32 -0
  53. data/vendor/assets/stylesheets/objects/_width-container.scss +1 -5
  54. data/vendor/assets/stylesheets/overrides/_display.scss +0 -6
  55. data/vendor/assets/stylesheets/overrides/_spacing.scss +56 -18
  56. data/vendor/assets/stylesheets/overrides/_text-align.scss +0 -6
  57. data/vendor/assets/stylesheets/overrides/_typography.scss +0 -6
  58. data/vendor/assets/stylesheets/overrides/_width.scss +0 -6
  59. data/vendor/assets/stylesheets/settings/_all.scss +1 -0
  60. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +7 -0
  61. data/vendor/assets/stylesheets/settings/_colours-palette.scss +12 -0
  62. data/vendor/assets/stylesheets/settings/_compatibility.scss +26 -0
  63. data/vendor/assets/stylesheets/settings/_ie8.scss +16 -0
  64. data/vendor/assets/stylesheets/settings/_links.scss +5 -1
  65. data/vendor/assets/stylesheets/settings/_measurements.scss +5 -15
  66. data/vendor/assets/stylesheets/settings/_spacing.scss +4 -8
  67. data/vendor/assets/stylesheets/settings/_typography-font.scss +23 -0
  68. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -0
  69. data/vendor/assets/stylesheets/settings/_warnings.scss +53 -0
  70. data/vendor/assets/stylesheets/tools/_all.scss +0 -1
  71. data/vendor/assets/stylesheets/tools/_compatibility.scss +20 -6
  72. data/vendor/assets/stylesheets/tools/_exports.scss +1 -1
  73. data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
  74. data/vendor/assets/stylesheets/tools/_ie8.scss +38 -2
  75. data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
  76. data/vendor/assets/stylesheets/tools/_px-to-em.scss +2 -2
  77. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
  78. metadata +8 -3
@@ -46,7 +46,7 @@
46
46
 
47
47
  $perpendicular: $base / 2;
48
48
 
49
- @if ($height == null) {
49
+ @if not $height {
50
50
  $height: _govuk-equilateral-height($base);
51
51
  }
52
52
 
@@ -39,7 +39,7 @@
39
39
  }
40
40
 
41
41
  $is-negative: false;
42
- @if ($spacing-point < 0) {
42
+ @if $spacing-point < 0 {
43
43
  $is-negative: true;
44
44
  $spacing-point: abs($spacing-point);
45
45
  }
@@ -94,12 +94,12 @@
94
94
  // Loop through each breakpoint in the map
95
95
  @each $breakpoint, $breakpoint-value in $scale-map {
96
96
 
97
- @if ($adjustment) {
97
+ @if $adjustment {
98
98
  $breakpoint-value: $breakpoint-value + $adjustment;
99
99
  }
100
100
 
101
101
  // The 'null' breakpoint is for mobile.
102
- @if $breakpoint == null {
102
+ @if not $breakpoint {
103
103
 
104
104
  @if $direction == all {
105
105
  #{$property}: $breakpoint-value if($important, !important, null);
@@ -23,7 +23,7 @@
23
23
  // We do not need to include the GDS Transport font-face declarations if
24
24
  // alphagov/govuk_template is being used since nta will already be included by
25
25
  // default.
26
- @if ($govuk-include-default-font-face) {
26
+ @if $govuk-include-default-font-face {
27
27
  @include _govuk-font-face-gds-transport;
28
28
  }
29
29
 
@@ -86,12 +86,13 @@
86
86
 
87
87
  /// Responsive typography helper
88
88
  ///
89
- /// Takes a 'font map' as an argument and uses it to create font-size and
90
- /// line-height declarations for different breakpoints, and for print.
89
+ /// Takes a point from the responsive 'font map' as an argument (the size as it
90
+ /// would appear on tablet and above), and uses it to create font-size and
91
+ /// line-height declarations for different breakpoints, and print.
91
92
  ///
92
93
  /// Example font map:
93
94
  ///
94
- /// $my-font-map: (
95
+ /// 19: (
95
96
  /// null: (
96
97
  /// font-size: 16px,
97
98
  /// line-height: 20px
@@ -106,12 +107,15 @@
106
107
  /// )
107
108
  /// );
108
109
  ///
109
- /// @param {Map} $font-map - Font map
110
+ /// @param {Number} $size - Point from the spacing scale (the size as it would
111
+ /// appear on tablet and above)
110
112
  /// @param {Number} $override-line-height [false] - Non responsive custom line
111
113
  /// height. Omit to use the line height from the font map.
112
114
  /// @param {Boolean} $important [false] - Whether to mark declarations as
113
115
  /// `!important`.
114
116
  ///
117
+ /// @throw if `$size` is not a valid point from the spacing scale
118
+ ///
115
119
  /// @access public
116
120
 
117
121
  @mixin govuk-typography-responsive($size, $override-line-height: false, $important: false) {
@@ -142,7 +146,7 @@
142
146
  $font-size-rem: $font-size-rem if($important, !important, null);
143
147
  $line-height: $line-height if($important, !important, null);
144
148
 
145
- @if $breakpoint == null {
149
+ @if not $breakpoint {
146
150
  font-size: $font-size;
147
151
  @if $govuk-typography-use-rem {
148
152
  font-size: $font-size-rem;
@@ -167,11 +171,14 @@
167
171
 
168
172
  /// Font helper
169
173
  ///
170
- /// @param {Number} $size - Size of the font as it would appear on desktop -
171
- /// uses the responsive font size map
174
+ /// @param {Number | Boolean} $size Point from the spacing scale (the size as it
175
+ /// would appear on tablet and above). Use `false` to avoid setting a size.
172
176
  /// @param {String} $weight [regular] - Weight: `bold` or `regular`
173
177
  /// @param {Boolean} $tabular [false] - Whether to use tabular numbers or not
174
- /// @param {Number} $line-height [false] - Line-height, if overriding the default
178
+ /// @param {Number} $line-height [false] - Line-height, if overriding the
179
+ /// default
180
+ ///
181
+ /// @throw if `$size` is not a valid point from the spacing scale (or false)
175
182
  ///
176
183
  /// @access public
177
184
 
@@ -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";
@@ -29,19 +29,12 @@
29
29
  // margins, but unfortunately the support isn't there (yet) and @supports
30
30
  // doesn't play nicely with it
31
31
  // (https://github.com/w3c/csswg-drafts/issues/3559)
32
- display: -webkit-box;
33
- display: -webkit-flex;
34
32
  display: -ms-flexbox;
35
33
  display: flex;
36
- -webkit-box-orient: vertical;
37
- -webkit-box-direction: normal;
38
- -webkit-flex-direction: column;
39
- -ms-flex-direction: column;
40
- flex-direction: column;
41
- -webkit-box-align: center;
42
- -webkit-align-items: center;
43
- -ms-flex-align: center;
44
- align-items: center;
34
+ -ms-flex-direction: column;
35
+ flex-direction: column;
36
+ -ms-flex-align: center;
37
+ align-items: center;
45
38
 
46
39
  // Give links within the button group the same font-size and line-height
47
40
  // as buttons.
@@ -71,22 +64,13 @@
71
64
  // Cancel out the column gap for the last item in each row
72
65
  margin-right: ($horizontal-gap * -1);
73
66
 
74
- -webkit-box-orient: horizontal;
67
+ -ms-flex-direction: row;
75
68
 
76
- -webkit-box-direction: normal;
77
-
78
- -webkit-flex-direction: row;
79
-
80
- -ms-flex-direction: row;
81
-
82
- flex-direction: row;
83
- -webkit-flex-wrap: wrap;
84
- -ms-flex-wrap: wrap;
85
- flex-wrap: wrap;
86
- -webkit-box-align: baseline;
87
- -webkit-align-items: baseline;
88
- -ms-flex-align: baseline;
89
- align-items: baseline;
69
+ flex-direction: row;
70
+ -ms-flex-wrap: wrap;
71
+ flex-wrap: wrap;
72
+ -ms-flex-align: baseline;
73
+ align-items: baseline;
90
74
 
91
75
  .govuk-button,
92
76
  .govuk-link {
@@ -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
+ -moz-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
+ }
@@ -28,9 +28,7 @@
28
28
 
29
29
  // Respect 'display cutout' safe area (avoids notches and rounded corners)
30
30
  @supports (margin: unquote("max(calc(0px))")) {
31
- $gutter-safe-area-right: -webkit-calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
32
31
  $gutter-safe-area-right: calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
33
- $gutter-safe-area-left: -webkit-calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
34
32
  $gutter-safe-area-left: calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
35
33
 
36
34
  // Use max() to pick largest margin, default or with safe area
@@ -46,9 +44,7 @@
46
44
 
47
45
  // Respect 'display cutout' safe area (avoids notches and rounded corners)
48
46
  @supports (margin: unquote("max(calc(0px))")) {
49
- $gutter-safe-area-right: -webkit-calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
50
47
  $gutter-safe-area-right: calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
51
- $gutter-safe-area-left: -webkit-calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
52
48
  $gutter-safe-area-left: calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
53
49
 
54
50
  // Use max() to pick largest margin, default or with safe area
@@ -72,7 +68,7 @@
72
68
  }
73
69
  }
74
70
 
75
- @include govuk-if-ie8 {
71
+ @include _govuk-if-ie8 {
76
72
  width: $width;
77
73
  // Since media queries are not supported in IE8,
78
74
  // we need to duplicate this margin that centers the page.
@@ -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,13 +1,9 @@
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
  ////
10
4
 
5
+ // stylelint-disable declaration-no-important
6
+
11
7
  /// Directions for spacing
12
8
  ///
13
9
  /// @type Map
@@ -20,25 +16,27 @@ $_spacing-directions: (
20
16
  "left"
21
17
  ) !default;
22
18
 
23
- /// Spacing override classes
19
+ /// Generate responsive spacing override classes
24
20
  ///
25
21
  /// Generate spacing override classes for the given property (e.g. margin)
26
- /// for each point in the spacing scale.
22
+ /// for each point in the responsive spacing scale.
27
23
  ///
28
24
  /// @param {String} $property - Property to add spacing to (e.g. 'margin')
29
25
  ///
30
- /// @example scss
31
- /// .govuk-\!-margin-0 {
32
- /// margin: 0;
33
- /// }
26
+ /// @example css
27
+ /// .govuk-\!-margin-4 {
28
+ /// margin: 15px !important;
29
+ /// }
34
30
  ///
35
- /// .govuk-\!-margin-top-1 {
36
- /// margin-top: [whatever spacing point 1 is...]
37
- /// }
31
+ /// @media (min-width: 40.0625em) {
32
+ /// .govuk-\!-margin-4 {
33
+ /// margin: 20px !important;
34
+ /// }
35
+ /// }
38
36
  ///
39
37
  /// @access private
40
38
 
41
- @mixin _govuk-generate-spacing-overrides($property) {
39
+ @mixin _govuk-generate-responsive-spacing-overrides($property) {
42
40
  // For each point in the spacing scale (defined in settings), create an
43
41
  // override that affects all directions...
44
42
  @each $scale-point, $scale-map in $govuk-spacing-responsive-scale {
@@ -58,7 +56,47 @@ $_spacing-directions: (
58
56
  }
59
57
  }
60
58
 
59
+ /// Generate static spacing override classes
60
+ ///
61
+ /// Generate spacing override classes for the given property (e.g. margin)
62
+ /// for each point in the non-responsive spacing scale.
63
+ ///
64
+ /// The classes in the format govuk-#{$property}-static-#{$spacing-point}
65
+ /// and govuk-\!-#{$property}-#{$direction}-static-#{$spacing-point} are deprecated.
66
+ /// For example: govuk-!-margin-static-2 or govuk-!-margin-top-static-2
67
+ ///
68
+ /// Use classes in the format .govuk-\!-static-#{$property}-#{$spacing-point}
69
+ /// and .govuk-\!-static-#{$property}-#{$direction}-#{$spacing-point} instead.
70
+ /// For example: govuk-!-static-margin-2 or govuk-!-static-margin-top-2
71
+ ///
72
+ /// @param {String} $property - Property to add spacing to (e.g. 'margin')
73
+ ///
74
+ /// @example css
75
+ /// .govuk-\!-static-margin-4 {
76
+ /// margin: 20px !important;
77
+ /// }
78
+ ///
79
+ /// @access private
80
+ @mixin _govuk-generate-static-spacing-overrides($property) {
81
+ @each $spacing-point in map-keys($govuk-spacing-points) {
82
+ .govuk-\!-#{$property}-static-#{$spacing-point},
83
+ .govuk-\!-static-#{$property}-#{$spacing-point} {
84
+ #{$property}: govuk-spacing($spacing-point) !important;
85
+ }
86
+
87
+ @each $direction in $_spacing-directions {
88
+ .govuk-\!-#{$property}-#{$direction}-static-#{$spacing-point},
89
+ .govuk-\!-static-#{$property}-#{$direction}-#{$spacing-point} {
90
+ #{$property}-#{$direction}: govuk-spacing($spacing-point) !important;
91
+ }
92
+ }
93
+ }
94
+ }
95
+
61
96
  @include govuk-exports("govuk/overrides/spacing") {
62
- @include _govuk-generate-spacing-overrides("margin");
63
- @include _govuk-generate-spacing-overrides("padding");
97
+ @include _govuk-generate-responsive-spacing-overrides("margin");
98
+ @include _govuk-generate-responsive-spacing-overrides("padding");
99
+
100
+ @include _govuk-generate-static-spacing-overrides("margin");
101
+ @include _govuk-generate-static-spacing-overrides("padding");
64
102
  }
@@ -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/text-align") {
9
3
  .govuk-\!-text-align-left {
@@ -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 {
@@ -3,6 +3,7 @@
3
3
 
4
4
  @import "assets";
5
5
 
6
+ @import "warnings";
6
7
  @import "compatibility";
7
8
  @import "global-styles";
8
9
  @import "ie8";
@@ -54,6 +54,13 @@ $govuk-colours-organisations: (
54
54
  colour: #cf102d,
55
55
  colour-websafe: #005ea5
56
56
  ),
57
+ "department-for-business-and-trade": (
58
+ colour: #cf102d,
59
+ colour-websafe: #005ea5
60
+ ),
61
+ "department-for-levelling-up-housing-and-communities": (
62
+ colour: #012169,
63
+ ),
57
64
  "department-for-transport": (
58
65
  colour: #006c56,
59
66
  colour-websafe: #398373
@@ -15,6 +15,8 @@
15
15
  ///
16
16
  /// @type Boolean
17
17
  /// @access public
18
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
19
+ /// suite of tools and settings
18
20
 
19
21
  $govuk-use-legacy-palette: if(
20
22
  (
@@ -26,6 +28,16 @@ $govuk-use-legacy-palette: if(
26
28
  false
27
29
  ) !default;
28
30
 
31
+ // Only show the deprecation warning if user is setting $govuk-use-legacy-palette
32
+ // manually instead of automatically via compatibility variables
33
+ @if $govuk-use-legacy-palette == true and
34
+ $govuk-compatibility-govukfrontendtoolkit == false and
35
+ $govuk-compatibility-govuktemplate == false and
36
+ $govuk-compatibility-govukelements == false {
37
+ @include _warning(legacy-palette, "$govuk-use-legacy-palette is deprecated. " +
38
+ "Only the modern colour palette will be supported from v5.0.");
39
+ }
40
+
29
41
  /// Modern colour palette
30
42
  ///
31
43
  /// This exists only because you cannot easily set a !default variable
@@ -23,9 +23,17 @@
23
23
  ///
24
24
  /// @type Boolean
25
25
  /// @access public
26
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
27
+ /// suite of tools and settings
26
28
 
27
29
  $govuk-compatibility-govukfrontendtoolkit: false !default;
28
30
 
31
+ @if $govuk-compatibility-govukfrontendtoolkit == true {
32
+ @include _warning("compatibility-mode", "$govuk-compatibility-govukfrontendtoolkit " +
33
+ "is deprecated. From version 5.0, GOV.UK Frontend will remove compatibility " +
34
+ "with the legacy library govuk_frontend_toolkit.");
35
+ }
36
+
29
37
  /// Compatibility Mode: alphagov/govuk_template
30
38
  ///
31
39
  /// Enabling this will:
@@ -41,9 +49,17 @@ $govuk-compatibility-govukfrontendtoolkit: false !default;
41
49
  ///
42
50
  /// @type Boolean
43
51
  /// @access public
52
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
53
+ /// suite of tools and settings
44
54
 
45
55
  $govuk-compatibility-govuktemplate: false !default;
46
56
 
57
+ @if $govuk-compatibility-govuktemplate == true {
58
+ @include _warning("compatibility-mode", "$govuk-compatibility-govuktemplate " +
59
+ "is deprecated. From version 5.0, GOV.UK Frontend will remove " +
60
+ "compatibility with the legacy library govuk_template.");
61
+ }
62
+
47
63
  /// Compatibility Mode: alphagov/govuk_elements
48
64
  ///
49
65
  /// Enabling this will:
@@ -56,9 +72,17 @@ $govuk-compatibility-govuktemplate: false !default;
56
72
  ///
57
73
  /// @type Boolean
58
74
  /// @access public
75
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
76
+ /// suite of tools and settings
59
77
 
60
78
  $govuk-compatibility-govukelements: false !default;
61
79
 
80
+ @if $govuk-compatibility-govukelements == true {
81
+ @include _warning("compatibility-mode", "$govuk-compatibility-govukelements " +
82
+ "is deprecated. From version 5.0, GOV.UK Frontend will remove compatibility " +
83
+ "with the legacy library govuk_elements.");
84
+ }
85
+
62
86
  /// Compatibility Product Map
63
87
  ///
64
88
  /// Maps product names to their settings that we can use to lookup states from
@@ -66,6 +90,8 @@ $govuk-compatibility-govukelements: false !default;
66
90
  ///
67
91
  /// @type Map
68
92
  /// @access private
93
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
94
+ /// suite of tools and settings
69
95
 
70
96
  $_govuk-compatibility: (
71
97
  govuk_frontend_toolkit: $govuk-compatibility-govukfrontendtoolkit,
@@ -6,13 +6,29 @@
6
6
  ///
7
7
  /// @type Boolean
8
8
  /// @access public
9
+ /// @deprecated Will be removed in v5.0
9
10
 
10
11
  $govuk-is-ie8: false !default;
11
12
 
13
+ @if $govuk-is-ie8 == true {
14
+ @include _warning(
15
+ ie8,
16
+ "The $govuk-is-ie8 setting is deprecated and will be removed in v5.0."
17
+ );
18
+ }
19
+
12
20
  /// The name of the breakpoint to use as the target when rasterizing media
13
21
  /// queries
14
22
  ///
15
23
  /// @type String
16
24
  /// @access public
25
+ /// @deprecated Will be removed in v5.0
17
26
 
18
27
  $govuk-ie8-breakpoint: desktop !default;
28
+
29
+ @if not $govuk-ie8-breakpoint == desktop {
30
+ @include _warning(
31
+ ie8,
32
+ "The $govuk-ie8-breakpoint setting is deprecated and will be removed in v5.0."
33
+ );
34
+ }
@@ -38,12 +38,16 @@ $govuk-link-underline-thickness: unquote("max(1px, .0625rem)") !default;
38
38
 
39
39
  /// Offset of link underlines from text baseline
40
40
  ///
41
+ /// The default is 3px expressed as ems, as calculated against the default body
42
+ /// font size (on desktop) of 19px.
43
+ /// 3 ÷ 19 = 0.1578
44
+ ///
41
45
  /// Set this variable to `false` to avoid setting an offset.
42
46
  ///
43
47
  /// @type Number
44
48
  /// @access public
45
49
 
46
- $govuk-link-underline-offset: .1em !default;
50
+ $govuk-link-underline-offset: .1578em !default;
47
51
 
48
52
  /// Thickness of link underlines in hover state
49
53
  ///
@@ -19,11 +19,11 @@ $govuk-page-width: 960px !default;
19
19
  /// @access public
20
20
 
21
21
  $govuk-grid-widths: (
22
- one-quarter: 25%,
23
- one-third: 33.3333%,
24
- one-half: 50%,
25
- two-thirds: 66.6666%,
26
- three-quarters: 75%,
22
+ one-quarter: (100% / 4),
23
+ one-third: (100% / 3),
24
+ one-half: (100% / 2),
25
+ two-thirds: (200% / 3),
26
+ three-quarters: (300% / 4),
27
27
  full: 100%
28
28
  ) !default;
29
29
 
@@ -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
@@ -38,20 +38,16 @@ $govuk-spacing-points: (
38
38
 
39
39
  $govuk-spacing-responsive-scale: (
40
40
  0: (
41
- null: 0,
42
- tablet: 0
41
+ null: 0
43
42
  ),
44
43
  1: (
45
- null: 5px,
46
- tablet: 5px
44
+ null: 5px
47
45
  ),
48
46
  2: (
49
- null: 10px,
50
- tablet: 10px
47
+ null: 10px
51
48
  ),
52
49
  3: (
53
- null: 15px,
54
- tablet: 15px
50
+ null: 15px
55
51
  ),
56
52
  4: (
57
53
  null: 15px,