dxw_govuk_frontend_rails 2.13.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -9
  3. data/Rakefile +8 -8
  4. data/dxw_govuk_frontend_rails.gemspec +3 -3
  5. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  6. data/package-lock.json +3 -3
  7. data/package.json +1 -1
  8. data/vendor/assets/fonts/bold-affa96571d-v2.woff +0 -0
  9. data/vendor/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  10. data/vendor/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  11. data/vendor/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  12. data/vendor/assets/javascripts/govuk_frontend_rails.js +116 -63
  13. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +48 -28
  14. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +17 -9
  15. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +10 -11
  16. data/vendor/assets/stylesheets/components/button/_button.scss +70 -47
  17. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +4 -6
  18. data/vendor/assets/stylesheets/components/details/_details.scss +12 -13
  19. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +4 -17
  20. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +63 -1
  21. data/vendor/assets/stylesheets/components/footer/_footer.scss +47 -16
  22. data/vendor/assets/stylesheets/components/header/_header.scss +34 -20
  23. data/vendor/assets/stylesheets/components/input/_input.scss +24 -1
  24. data/vendor/assets/stylesheets/components/panel/_panel.scss +1 -1
  25. data/vendor/assets/stylesheets/components/radios/_radios.scss +7 -9
  26. data/vendor/assets/stylesheets/components/select/_select.scss +23 -1
  27. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +6 -1
  28. data/vendor/assets/stylesheets/components/table/_table.scss +1 -0
  29. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +63 -51
  30. data/vendor/assets/stylesheets/components/tag/_tag.scss +18 -7
  31. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +24 -1
  32. data/vendor/assets/stylesheets/helpers/_all.scss +1 -1
  33. data/vendor/assets/stylesheets/helpers/_colour.scss +23 -1
  34. data/vendor/assets/stylesheets/helpers/_focused.scss +28 -0
  35. data/vendor/assets/stylesheets/helpers/_font-faces.scss +10 -36
  36. data/vendor/assets/stylesheets/helpers/_grid.scss +11 -58
  37. data/vendor/assets/stylesheets/helpers/_links.scss +15 -1
  38. data/vendor/assets/stylesheets/helpers/_typography.scss +22 -4
  39. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +4 -2
  40. data/vendor/assets/stylesheets/objects/_grid.scss +2 -2
  41. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +15 -1
  42. data/vendor/assets/stylesheets/settings/_colours-applied.scss +9 -8
  43. data/vendor/assets/stylesheets/settings/_colours-palette.scss +70 -6
  44. data/vendor/assets/stylesheets/settings/_compatibility.scss +31 -7
  45. data/vendor/assets/stylesheets/settings/_measurements.scss +2 -2
  46. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +11 -1
  47. data/vendor/assets/stylesheets/settings/_typography-font.scss +27 -7
  48. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +9 -10
  49. metadata +10 -22
  50. data/vendor/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
  51. data/vendor/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
  52. data/vendor/assets/fonts/bold-fb2676462a-v1.eot +0 -0
  53. data/vendor/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
  54. data/vendor/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
  55. data/vendor/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
  56. data/vendor/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
  57. data/vendor/assets/fonts/light-458f8ea81c-v1.woff +0 -0
  58. data/vendor/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
  59. data/vendor/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
  60. data/vendor/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
  61. data/vendor/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
  62. data/vendor/assets/images/icon-arrow-left.png +0 -0
  63. data/vendor/assets/images/icon-important.png +0 -0
  64. data/vendor/assets/images/icon-pointer-2x.png +0 -0
  65. data/vendor/assets/images/icon-pointer.png +0 -0
  66. data/vendor/assets/stylesheets/helpers/_focusable.scss +0 -34
@@ -17,46 +17,10 @@
17
17
  @error "Unknown grid width `#{$key}`";
18
18
  }
19
19
 
20
- /// Grid width percentage (alias)
21
- ///
22
- /// @alias govuk-grid-width
23
- /// @deprecated To be removed in v3.0, replaced by govuk-grid-width
24
- @function grid-width($key) {
25
- @return govuk-grid-width($key);
26
- }
27
-
28
- /// Generate grid row styles
29
- ///
30
- /// Creates a grid row class with a standardised margin.
31
- ///
32
- /// @param {String} $class [govuk-grid-row] CSS class name
33
- ///
34
- /// @example scss - Default
35
- /// @include govuk-grid-row;
36
- ///
37
- /// @example scss - Customising the class name
38
- /// @include govuk-grid-row("app-grid");
39
- ///
40
- /// @access public
41
- /// @deprecated To be removed in v3.0, replaced by the govuk-grid-row class
42
-
43
- @mixin govuk-grid-row($class: "govuk-grid-row") {
44
- .#{$class} {
45
- @include govuk-clearfix;
46
- margin-right: - ($govuk-gutter-half);
47
- margin-left: - ($govuk-gutter-half);
48
- }
49
- }
50
-
51
20
  /// Generate grid column styles
52
21
  ///
53
22
  /// Creates a grid column with standard gutter between the columns.
54
23
  ///
55
- /// If a `$class` is provided (which is the default, but deprecated behaviour),
56
- /// the generated rules will be wrapped in a predefined selector in the format
57
- /// `$class-$width` (e.g. `govuk-grid-column-full`). This behaviour is
58
- /// deprecated and will be removed in v3.0
59
- ///
60
24
  /// Grid widths are defined in the `$govuk-grid-widths` map.
61
25
  ///
62
26
  /// By default the column width changes from 100% to specified width at the
@@ -66,11 +30,10 @@
66
30
  /// @param {String} $width [full] name of a grid width from $govuk-grid-widths
67
31
  /// @param {String} $float [left] left | right
68
32
  /// @param {String} $at [tablet] - mobile | tablet | desktop | any custom breakpoint
69
- /// @param {String} $class [govuk-grid-column] CSS class name (deprecated)
70
33
  ///
71
34
  /// @example scss - Default
72
35
  /// .govuk-grid-column-two-thirds {
73
- /// @include govuk-grid-column(two-thirds, $class: false)
36
+ /// @include govuk-grid-column(two-thirds)
74
37
  /// }
75
38
  ///
76
39
  /// @example scss - Customising the breakpoint where width percentage is applied
@@ -80,28 +43,18 @@
80
43
  ///
81
44
  /// @example scss - Customising the float direction
82
45
  /// .govuk-grid-column-one-half-right {
83
- /// @include govuk-grid-column(two-thirds, $float: right, $class: false);
84
- /// }
85
- ///
86
- /// @example scss - Customising the class name (deprecated)
87
- /// @include govuk-grid-column(one-half, $class: "test-column");
46
+ /// @include govuk-grid-column(two-thirds, $float: right);
88
47
  ///
89
48
  /// @access public
90
49
 
91
- @mixin govuk-grid-column($width: full, $float: left, $at: tablet, $class: "govuk-grid-column") {
92
- @if ($class) {
93
- .#{$class}-#{$width} {
94
- @include govuk-grid-column($width, $float, $at, $class: false);
95
- }
96
- } @else {
97
- box-sizing: border-box;
98
- @if $at != desktop {
99
- width: 100%;
100
- }
101
- padding: 0 $govuk-gutter-half;
102
- @include govuk-media-query($from: $at) {
103
- width: govuk-grid-width($width);
104
- float: $float;
105
- }
50
+ @mixin govuk-grid-column($width: full, $float: left, $at: tablet) {
51
+ box-sizing: border-box;
52
+ @if $at != desktop {
53
+ width: 100%;
54
+ }
55
+ padding: 0 $govuk-gutter-half;
56
+ @include govuk-media-query($from: $at) {
57
+ width: govuk-grid-width($width);
58
+ float: $float;
106
59
  }
107
60
  }
@@ -10,7 +10,10 @@
10
10
 
11
11
  @mixin govuk-link-common {
12
12
  @include govuk-typography-common;
13
- @include govuk-focusable-fill;
13
+
14
+ &:focus {
15
+ @include govuk-focused-text;
16
+ }
14
17
  }
15
18
 
16
19
  /// Default link style mixin
@@ -50,6 +53,17 @@
50
53
  &:focus {
51
54
  color: $govuk-focus-text-colour;
52
55
  }
56
+
57
+ // alphagov/govuk_template includes a specific a:link:focus selector
58
+ // designed to make unvisited link s a slightly darker blue when focussed, so
59
+ // we need to override the text colour for that combination of selectors so
60
+ // so that unvisited links styled as buttons do not end up with dark blue
61
+ // text when focussed.
62
+ @include govuk-compatibility(govuk_template) {
63
+ &:link:focus {
64
+ color: $govuk-focus-text-colour;
65
+ }
66
+ }
53
67
  }
54
68
 
55
69
  /// Muted style link mixin
@@ -17,10 +17,14 @@
17
17
  -webkit-font-smoothing: antialiased;
18
18
  -moz-osx-font-smoothing: grayscale;
19
19
 
20
- // If the user is using the default NTA font we need to include the font-face declarations.
21
- // We do not need to include the NTA font-face declarations if alphagov/govuk_template is being used since they will already be included.
20
+ // If the user is using the default GDS Transport font we need to include
21
+ // the font-face declarations.
22
+ //
23
+ // We do not need to include the GDS Transport font-face declarations if
24
+ // alphagov/govuk_template is being used since nta will already be included by
25
+ // default.
22
26
  @if ($govuk-include-default-font-face) {
23
- @include _govuk-font-face-nta;
27
+ @include _govuk-font-face-gds-transport;
24
28
  }
25
29
 
26
30
  @include govuk-media-query($media-type: print) {
@@ -71,6 +75,7 @@
71
75
  /// @return {Number} The line height as either a relative value or unmodified
72
76
  ///
73
77
  /// @access private
78
+
74
79
  @function _govuk-line-height($line-height, $font-size) {
75
80
  @if not unitless($line-height) and unit($line-height) == unit($font-size) {
76
81
  $line-height: $line-height / $font-size;
@@ -171,7 +176,20 @@
171
176
 
172
177
  @mixin govuk-font($size, $weight: regular, $tabular: false, $line-height: false) {
173
178
  @if $tabular {
174
- @include govuk-typography-common($font-family: $govuk-font-family-tabular);
179
+ // if govuk-font-family-tabular is set use $govuk-font-family-tabular
180
+ @if $govuk-font-family-tabular {
181
+ @include govuk-typography-common($font-family: $govuk-font-family-tabular);
182
+ } @else {
183
+ @include govuk-typography-common;
184
+ -webkit-font-feature-settings: "tnum" 1;
185
+ font-feature-settings: "tnum" 1;
186
+
187
+ @supports(font-variant-numeric: tabular-nums) {
188
+ -webkit-font-feature-settings: normal;
189
+ font-feature-settings: normal;
190
+ font-variant-numeric: tabular-nums;
191
+ }
192
+ }
175
193
  } @else {
176
194
  @include govuk-typography-common;
177
195
  }
@@ -18,7 +18,8 @@
18
18
 
19
19
  width: 1px iff($important, !important);
20
20
  height: 1px iff($important, !important);
21
- // If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX
21
+ // If margin is set to a negative value it can cause text to be announced in
22
+ // the wrong order in VoiceOver for OSX
22
23
  margin: 0 iff($important, !important);
23
24
  padding: 0 iff($important, !important);
24
25
 
@@ -51,7 +52,8 @@
51
52
 
52
53
  width: 1px iff($important, !important);
53
54
  height: 1px iff($important, !important);
54
- // If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX
55
+ // If margin is set to a negative value it can cause text to be announced in
56
+ // the wrong order in VoiceOver for OSX
55
57
  margin: 0 iff($important, !important);
56
58
 
57
59
  overflow: hidden iff($important, !important);
@@ -12,7 +12,7 @@
12
12
 
13
13
  @each $width in map-keys($govuk-grid-widths) {
14
14
  .govuk-grid-column-#{$width} {
15
- @include govuk-grid-column($width, $class: false)
15
+ @include govuk-grid-column($width)
16
16
  }
17
17
  }
18
18
 
@@ -21,7 +21,7 @@
21
21
  // them in the outputted CSS
22
22
  @each $width in map-keys($govuk-grid-widths) {
23
23
  .govuk-grid-column-#{$width}-from-desktop {
24
- @include govuk-grid-column($width, $at: desktop, $class: false)
24
+ @include govuk-grid-column($width, $at: desktop)
25
25
  }
26
26
  }
27
27
  }
@@ -20,6 +20,8 @@
20
20
  // </div>
21
21
 
22
22
 
23
+ /// @deprecated Replace this mixin with more direct references to the [spacing
24
+ /// mixins](https://design-system.service.gov.uk/styles/spacing/#spacing-on-custom-components).
23
25
  @mixin govuk-main-wrapper {
24
26
  // In IE11 the `main` element can be used, but is not recognized –
25
27
  // meaning it's not defined in IE's default style sheet,
@@ -37,7 +39,11 @@
37
39
  }
38
40
  }
39
41
 
40
- // Use govuk-main-wrapper--l when you page does not have Breadcrumbs, phase banners or back links
42
+ /// Use govuk-main-wrapper--l when you page does not have Breadcrumbs, phase
43
+ /// banners or back links.
44
+ ///
45
+ /// @deprecated Replace this mixin with more direct references to the [spacing
46
+ /// mixins](https://design-system.service.gov.uk/styles/spacing/#spacing-on-custom-components).
41
47
  @mixin govuk-main-wrapper--l {
42
48
  @include govuk-responsive-padding(8, "top");
43
49
  }
@@ -47,6 +53,14 @@
47
53
  @include govuk-main-wrapper;
48
54
  }
49
55
 
56
+ // Using the `.govuk-main-wrapper--auto-spacing` modifier should apply the
57
+ // correct spacing depending on whether there are any elements
58
+ // (such the back link, breadcrumbs or phase banner components) before the
59
+ // `.govuk-main-wrapper` in the `govuk-width-container`.
60
+ //
61
+ // If you need to control the spacing manually, use the
62
+ // `govuk-main-wrapper--l` modifier instead.
63
+ .govuk-main-wrapper--auto-spacing:first-child,
50
64
  .govuk-main-wrapper--l {
51
65
  @include govuk-main-wrapper--l;
52
66
  }
@@ -26,12 +26,13 @@ $govuk-text-colour: govuk-colour("black") !default;
26
26
 
27
27
  /// Canvas background colour
28
28
  ///
29
- /// Used by the footer component and template to give the illusion of a long footer.
29
+ /// Used by the footer component and template to give the illusion of a long
30
+ /// footer.
30
31
  ///
31
32
  /// @type Colour
32
33
  /// @access public
33
34
 
34
- $govuk-canvas-background-colour: govuk-colour("grey-3") !default;
35
+ $govuk-canvas-background-colour: govuk-colour("light-grey", $legacy: "grey-3") !default;
35
36
 
36
37
  /// Body background colour
37
38
  ///
@@ -56,7 +57,7 @@ $govuk-print-text-colour: #000000 !default;
56
57
  /// @type Colour
57
58
  /// @access public
58
59
 
59
- $govuk-secondary-text-colour: govuk-colour("grey-1") !default;
60
+ $govuk-secondary-text-colour: govuk-colour("dark-grey", $legacy: "grey-1") !default;
60
61
 
61
62
  /// Focus colour
62
63
  ///
@@ -94,7 +95,7 @@ $govuk-error-colour: govuk-colour("red") !default;
94
95
  /// @type Colour
95
96
  /// @access public
96
97
 
97
- $govuk-border-colour: govuk-colour("grey-2") !default;
98
+ $govuk-border-colour: govuk-colour("mid-grey", $legacy: "grey-2");
98
99
 
99
100
  /// Input border colour
100
101
  ///
@@ -112,7 +113,7 @@ $govuk-input-border-colour: govuk-colour("black") !default;
112
113
  /// @type Colour
113
114
  /// @access public
114
115
 
115
- $govuk-hover-colour: govuk-colour("grey-3") !default;
116
+ $govuk-hover-colour: govuk-colour("mid-grey", $legacy: "grey-3");
116
117
 
117
118
 
118
119
  // =============================================================================
@@ -131,18 +132,18 @@ $govuk-link-colour: govuk-colour("blue") !default;
131
132
  /// @type Colour
132
133
  /// @access public
133
134
 
134
- $govuk-link-visited-colour: #4c2c92 !default;
135
+ $govuk-link-visited-colour: govuk-colour("purple", $legacy: #4c2c92) !default;
135
136
 
136
137
  /// Link hover colour
137
138
  ///
138
139
  /// @type Colour
139
140
  /// @access public
140
141
 
141
- $govuk-link-hover-colour: govuk-colour("light-blue") !default;
142
+ $govuk-link-hover-colour: govuk-colour("dark-blue", $legacy: "light-blue") !default;
142
143
 
143
144
  /// Active link colour
144
145
  ///
145
146
  /// @type Colour
146
147
  /// @access public
147
148
 
148
- $govuk-link-active-colour: govuk-colour("light-blue") !default;
149
+ $govuk-link-active-colour: govuk-colour("black", $legacy: "light-blue") !default;
@@ -1,17 +1,33 @@
1
+ @import "compatibility";
2
+
1
3
  ////
2
4
  /// @group settings/colours
3
5
  ////
4
6
 
5
- /// Colour palette
7
+ /// Use 'legacy' colour palette
6
8
  ///
7
- /// @type Map
8
- ///
9
- /// @prop $colour - Representation for the given $colour, where $colour is the
10
- /// friendly name for the colour (e.g. "red": #ff0000);
9
+ /// Whether or not to use the colour palette from GOV.UK Elements / Frontend
10
+ /// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
11
+ /// components from both places in a single application.
11
12
  ///
13
+ /// @type Boolean
12
14
  /// @access public
13
15
 
14
- $govuk-colours: (
16
+ $govuk-use-legacy-palette: if((
17
+ $govuk-compatibility-govukfrontendtoolkit or
18
+ $govuk-compatibility-govuktemplate or
19
+ $govuk-compatibility-govukelements
20
+ ), true, false) !default;
21
+
22
+ /// Legacy colour palette
23
+ ///
24
+ /// This exists only because you cannot easily set a !default variable
25
+ /// conditionally (thanks to the way scope works in Sass) so we set
26
+ /// `$govuk-colour-palette` using the `if` function.
27
+ ///
28
+ /// @access private
29
+
30
+ $_govuk-colour-palette-legacy: (
15
31
  "purple": #2e358b,
16
32
  "light-purple": #6f72af,
17
33
  "bright-purple": #912b88,
@@ -34,4 +50,52 @@ $govuk-colours: (
34
50
  "grey-3": #dee0e2,
35
51
  "grey-4": #f8f8f8,
36
52
  "white": #ffffff
53
+ );
54
+
55
+ /// Modern colour palette
56
+ ///
57
+ /// This exists only because you cannot easily set a !default variable
58
+ /// conditionally (thanks to the way scope works in Sass) so we set
59
+ /// `$govuk-colour-palette` using the `if` function.
60
+ ///
61
+ /// @access private
62
+
63
+ $_govuk-colour-palette-modern: (
64
+ "red": #d4351c,
65
+ "yellow": #ffdd00,
66
+ "green": #00703c,
67
+ "blue": #1d70b8,
68
+ "dark-blue": #003078,
69
+ "light-blue": #5694ca,
70
+ "purple": #4c2c92,
71
+
72
+ "black": #0b0c0c,
73
+ "dark-grey": #6f777b,
74
+ "mid-grey": #b1b4b6,
75
+ "light-grey": #f3f2f1,
76
+ "white": #ffffff,
77
+
78
+ "light-purple": #6f72af,
79
+ "bright-purple": #912b88,
80
+ "pink": #d53880,
81
+ "light-pink": #f499be,
82
+ "orange": #f47738,
83
+ "brown": #b58840,
84
+ "light-green": #85994b,
85
+ "turquoise": #28a197
86
+ );
87
+
88
+ /// Colour palette
89
+ ///
90
+ /// @type Map
91
+ ///
92
+ /// @prop $colour - Representation for the given $colour, where $colour is the
93
+ /// friendly name for the colour (e.g. "red": #ff0000);
94
+ ///
95
+ /// @access public
96
+
97
+ $govuk-colours: if(
98
+ $govuk-use-legacy-palette,
99
+ $_govuk-colour-palette-legacy,
100
+ $_govuk-colour-palette-modern
37
101
  ) !default;
@@ -1,9 +1,17 @@
1
1
  ////
2
- /// Compatibility with legacy repos (govuk_elements, govuk_frontend_tookkit and
3
- /// govuk_template) settings
2
+ /// 'Compatibility Mode'
4
3
  ///
5
- /// We default these settings to `true` so that if they are missed we opt for a
6
- /// mild performance hit over a potential broken experience for the end-user.
4
+ /// Enabling these flags improves compatibility if you are using GOV.UK Frontend
5
+ /// in an application that also uses govuk_elements, govuk_frontend_toolkit or
6
+ /// govuk_template (the 'legacy repos').
7
+ ///
8
+ /// Enabling any of these settings will, by default:
9
+ ///
10
+ /// - switch GOV.UK Frontend to using the same colour palette as the legacy
11
+ /// repos, by setting `$govuk-use-legacy-palette` to true.
12
+ ///
13
+ /// - prevent GOV.UK Frontend from using rem for font sizing, by setting
14
+ /// `$govuk-typography-use-rem` to false.
7
15
  ///
8
16
  /// @group settings/compatibility
9
17
  ////
@@ -11,7 +19,8 @@
11
19
 
12
20
  /// Compatibility Mode: alphagov/govuk_frontend_toolkit
13
21
  ///
14
- /// True if used in a project that also includes alphagov/govuk_frontend_toolkit.
22
+ /// Set this to true if you are also including alphagov/govuk_frontend_toolkit
23
+ /// in your application.
15
24
  ///
16
25
  /// @type Boolean
17
26
  /// @access public
@@ -20,7 +29,16 @@ $govuk-compatibility-govukfrontendtoolkit: false !default;
20
29
 
21
30
  /// Compatibility Mode: alphagov/govuk_template
22
31
  ///
23
- /// True if used in a project that also includes alphagov/govuk_template.
32
+ /// Enabling this will:
33
+ ///
34
+ /// - prevent GOV.UK Frontend from including the New Transport typeface, as
35
+ /// it'll use the version of New Transport included with GOV.UK Template.
36
+ ///
37
+ /// - alter some of the CSS outputted by GOV.UK Frontend to 'counter'
38
+ /// specific CSS rules in GOV.UK Template.
39
+ ///
40
+ /// Set this to true if you are also including alphagov/govuk_template in your
41
+ /// application.
24
42
  ///
25
43
  /// @type Boolean
26
44
  /// @access public
@@ -29,7 +47,13 @@ $govuk-compatibility-govuktemplate: false !default;
29
47
 
30
48
  /// Compatibility Mode: alphagov/govuk_elements
31
49
  ///
32
- /// True if used in a project that also includes alphagov/govuk_elements.
50
+ /// Enabling this will:
51
+ ///
52
+ /// - alter some of the CSS outputted by GOV.UK Frontend to 'counter'
53
+ /// specific CSS rules in GOV.UK Elements.
54
+ ///
55
+ /// Set this to true if you are also including alphagov/govuk_elements in your
56
+ /// application.
33
57
  ///
34
58
  /// @type Boolean
35
59
  /// @access public
@@ -63,12 +63,12 @@ $govuk-border-width: 5px !default;
63
63
 
64
64
  $govuk-border-width-wide: 10px !default;
65
65
 
66
- /// Border width on mobile
66
+ /// Narrow border width
67
67
  ///
68
68
  /// @type Number
69
69
  /// @access public
70
70
 
71
- $govuk-border-width-mobile: 4px !default;
71
+ $govuk-border-width-narrow: 4px !default;
72
72
 
73
73
  /// Form control border width
74
74
  ///
@@ -2,11 +2,20 @@
2
2
  /// @group settings/typography
3
3
  ////
4
4
 
5
- /// List of font families to use if using NTA (the default font 'stack' for
5
+ /// List of font families to use if using GDS Transport (the default font
6
+ /// 'stack' for GOV.UK)
7
+ ///
8
+ /// @type List
9
+ /// @access public
10
+
11
+ $govuk-font-family-gds-transport: "GDS Transport", Arial, sans-serif;
12
+
13
+ /// List of font families to use if using NTA (old font 'stack' for
6
14
  /// GOV.UK)
7
15
  ///
8
16
  /// @type List
9
17
  /// @access public
18
+ /// @deprecated To be removed once support for compatibility mode is dropped
10
19
 
11
20
  $govuk-font-family-nta: "nta", Arial, sans-serif;
12
21
 
@@ -18,5 +27,6 @@ $govuk-font-family-nta: "nta", Arial, sans-serif;
18
27
  ///
19
28
  /// @type List
20
29
  /// @access public
30
+ /// @deprecated To be removed once support for compatibility mode is dropped
21
31
 
22
32
  $govuk-font-family-nta-tabular: "ntatabularnumbers", $govuk-font-family-nta;
@@ -1,8 +1,24 @@
1
+ @import "compatibility";
2
+ @import "typography-font-families";
3
+
1
4
  ////
2
5
  /// @group settings/typography
3
6
  ////
4
7
 
8
+ /// Use 'legacy' fonts
9
+ ///
10
+ /// Whether or not to use v1 nta font from GOV.UK Elements / Frontend
11
+ /// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
12
+ /// components from both places in a single application.
13
+ ///
14
+ /// @type Boolean
15
+ /// @access public
5
16
 
17
+ $govuk-use-legacy-font: if((
18
+ $govuk-compatibility-govukfrontendtoolkit or
19
+ $govuk-compatibility-govuktemplate or
20
+ $govuk-compatibility-govukelements
21
+ ), true, false) !default;
6
22
 
7
23
  // =========================================================
8
24
  // Font families
@@ -13,14 +29,20 @@
13
29
  /// @type List
14
30
  /// @access public
15
31
 
16
- $govuk-font-family: $govuk-font-family-nta !default;
32
+ $govuk-font-family: if($govuk-use-legacy-font,
33
+ $govuk-font-family-nta,
34
+ $govuk-font-family-gds-transport
35
+ ) !default;
17
36
 
18
37
  /// Font families to use when displaying tabular numbers
19
38
  ///
20
39
  /// @type List
21
40
  /// @access public
22
41
 
23
- $govuk-font-family-tabular: $govuk-font-family-nta-tabular !default;
42
+ $govuk-font-family-tabular: if($govuk-use-legacy-font,
43
+ $govuk-font-family-nta-tabular,
44
+ false
45
+ ) !default;
24
46
 
25
47
  /// Font families to use for print media
26
48
  ///
@@ -31,16 +53,14 @@ $govuk-font-family-print: sans-serif !default;
31
53
 
32
54
  /// Include the default @font-face declarations
33
55
  ///
34
- /// If you have set $govuk-font-family to something other than $govuk-font-family-nta this option is disabled by default.
35
- ///
36
- /// If you are using $govuk-compatibility-govuktemplate this option is disabled by default.
56
+ /// If you have set $govuk-font-family to something other than
57
+ /// `$govuk-font-family-gds-transport` this option is disabled by default.
37
58
  ///
38
59
  /// @type Boolean
39
60
  /// @access public
40
61
 
41
62
  $govuk-include-default-font-face: (
42
- $govuk-font-family == $govuk-font-family-nta and
43
- not($govuk-compatibility-govuktemplate)
63
+ $govuk-font-family == $govuk-font-family-gds-transport
44
64
  ) !default;
45
65
 
46
66
  // =========================================================
@@ -1,17 +1,15 @@
1
+ @import "compatibility";
2
+
1
3
  ////
2
4
  /// @group settings/typography
3
5
  ////
4
6
 
5
7
  /// Whether or not to define font sizes in rem, improving accessibility by
6
- /// allowing users to adjust the base font-size. This is currently off by
7
- /// default, but will be enabled by default for projects that do not use
8
- /// alphagov/govuk_template in the next major release.
9
- ///
10
- /// If this is enabled, you should make sure that $govuk-root-font-size is set
11
- /// correctly for your project
8
+ /// allowing users to adjust the base font-size. This is enabled by default,
9
+ /// unless any of the compatibility mode settings are enabled.
12
10
  ///
13
- /// If any of the compatibility variables are set, then default
14
- /// responsive typography to off.
11
+ /// You should make sure that $govuk-root-font-size is set correctly for your
12
+ /// project.
15
13
  ///
16
14
  /// @type Boolean
17
15
  /// @access public
@@ -32,8 +30,9 @@ $govuk-typography-use-rem: if((
32
30
  /// should be set to 16px.
33
31
  ///
34
32
  /// If you are integrating Frontend into an existing project that also uses
35
- /// alphagov/govuk_template then you should set this to 10px to match the 62.5%
36
- /// (10px) base font size that govuk_template sets on the <html> element.
33
+ /// alphagov/govuk_template and you wish to enable `$govuk-typography-use-rem`
34
+ /// then you should set this to 10px to match the 62.5% (10px) base font size
35
+ /// that govuk_template sets on the <html> element.
37
36
  ///
38
37
  /// @type Number
39
38
  /// @access public