govuk_tech_docs 3.2.1 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/publish.yaml +1 -1
  3. data/CHANGELOG.md +26 -7
  4. data/README.md +2 -2
  5. data/lib/assets/javascripts/_modules/search.js +2 -2
  6. data/lib/govuk_tech_docs/contribution_banner.rb +1 -1
  7. data/lib/govuk_tech_docs/version.rb +1 -1
  8. data/lib/source/layouts/core.erb +1 -1
  9. data/node_modules/govuk-frontend/govuk/all.js +1548 -311
  10. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +70 -0
  11. data/node_modules/govuk-frontend/govuk/common/index.js +172 -0
  12. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +373 -0
  13. data/node_modules/govuk-frontend/govuk/common.js +138 -3
  14. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  15. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +5 -6
  16. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +754 -36
  17. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -2
  18. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +29 -21
  19. data/node_modules/govuk-frontend/govuk/components/button/button.js +365 -107
  20. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +9 -0
  21. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1092 -109
  22. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +3 -2
  23. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +30 -2
  24. data/node_modules/govuk-frontend/govuk/components/details/details.js +51 -33
  25. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +289 -6
  26. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +13 -23
  27. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +30 -24
  28. data/node_modules/govuk-frontend/govuk/components/header/header.js +59 -11
  29. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +13 -23
  30. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +252 -2
  31. data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +247 -0
  32. data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
  33. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +1 -1
  34. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +5 -12
  35. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +30 -2
  36. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +11 -0
  37. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +1 -3
  38. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +10 -4
  39. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +45 -13
  40. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +1 -1
  41. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +28 -0
  42. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +1 -1
  43. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +5 -5
  44. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +5 -0
  45. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +13 -11
  46. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +2 -2
  47. data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
  48. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +3 -3
  49. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +16 -9
  50. data/node_modules/govuk-frontend/govuk/i18n.js +390 -0
  51. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +10 -26
  52. data/node_modules/govuk-frontend/govuk/objects/_template.scss +1 -1
  53. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +0 -4
  54. data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +56 -12
  55. data/node_modules/govuk-frontend/govuk/settings/_all.scss +1 -0
  56. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +12 -0
  57. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +26 -0
  58. data/node_modules/govuk-frontend/govuk/settings/_spacing.scss +4 -8
  59. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +23 -0
  60. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +12 -0
  61. data/node_modules/govuk-frontend/govuk/settings/_warnings.scss +53 -0
  62. data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +20 -6
  63. data/node_modules/govuk-frontend/govuk/tools/_exports.scss +1 -1
  64. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
  65. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
  66. data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +2 -2
  67. data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
  68. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +21 -0
  69. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +300 -0
  70. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +21 -0
  71. data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +7 -0
  72. data/node_modules/govuk-frontend/govuk-prototype-kit/init.scss +12 -0
  73. data/package-lock.json +12 -12
  74. data/package.json +1 -1
  75. metadata +14 -2
@@ -2,6 +2,8 @@
2
2
  /// @group overrides
3
3
  ////
4
4
 
5
+ // stylelint-disable declaration-no-important
6
+
5
7
  /// Directions for spacing
6
8
  ///
7
9
  /// @type Map
@@ -14,25 +16,27 @@ $_spacing-directions: (
14
16
  "left"
15
17
  ) !default;
16
18
 
17
- /// Spacing override classes
19
+ /// Generate responsive spacing override classes
18
20
  ///
19
21
  /// Generate spacing override classes for the given property (e.g. margin)
20
- /// for each point in the spacing scale.
22
+ /// for each point in the responsive spacing scale.
21
23
  ///
22
24
  /// @param {String} $property - Property to add spacing to (e.g. 'margin')
23
25
  ///
24
- /// @example scss
25
- /// .govuk-\!-margin-0 {
26
- /// margin: 0;
27
- /// }
26
+ /// @example css
27
+ /// .govuk-\!-margin-4 {
28
+ /// margin: 15px !important;
29
+ /// }
28
30
  ///
29
- /// .govuk-\!-margin-top-1 {
30
- /// margin-top: [whatever spacing point 1 is...]
31
- /// }
31
+ /// @media (min-width: 40.0625em) {
32
+ /// .govuk-\!-margin-4 {
33
+ /// margin: 20px !important;
34
+ /// }
35
+ /// }
32
36
  ///
33
37
  /// @access private
34
38
 
35
- @mixin _govuk-generate-spacing-overrides($property) {
39
+ @mixin _govuk-generate-responsive-spacing-overrides($property) {
36
40
  // For each point in the spacing scale (defined in settings), create an
37
41
  // override that affects all directions...
38
42
  @each $scale-point, $scale-map in $govuk-spacing-responsive-scale {
@@ -52,7 +56,47 @@ $_spacing-directions: (
52
56
  }
53
57
  }
54
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
+
55
96
  @include govuk-exports("govuk/overrides/spacing") {
56
- @include _govuk-generate-spacing-overrides("margin");
57
- @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");
58
102
  }
@@ -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";
@@ -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,
@@ -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,
@@ -13,6 +13,8 @@
13
13
  ///
14
14
  /// @type Boolean
15
15
  /// @access public
16
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
17
+ /// suite of tools and settings
16
18
 
17
19
  $govuk-use-legacy-font: if(
18
20
  (
@@ -24,6 +26,17 @@ $govuk-use-legacy-font: if(
24
26
  false
25
27
  ) !default;
26
28
 
29
+ // Only show the deprecation warning if user is setting $govuk-use-legacy-font
30
+ // manually instead of automatically via compatibility variables
31
+ @if $govuk-use-legacy-font == true and
32
+ $govuk-compatibility-govukfrontendtoolkit == false and
33
+ $govuk-compatibility-govuktemplate == false and
34
+ $govuk-compatibility-govukelements == false {
35
+ @include _warning(legacy-font, "$govuk-use-legacy-font is deprecated. " +
36
+ "From version 5.0, GOV.UK Frontend will only support the included version " +
37
+ "of GDS Transport.");
38
+ }
39
+
27
40
  // =========================================================
28
41
  // Font families
29
42
  // =========================================================
@@ -43,6 +56,8 @@ $govuk-font-family: if(
43
56
  ///
44
57
  /// @type List
45
58
  /// @access public
59
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
60
+ /// suite of tools and settings
46
61
 
47
62
  $govuk-font-family-tabular: if(
48
63
  $govuk-use-legacy-font,
@@ -50,6 +65,14 @@ $govuk-font-family-tabular: if(
50
65
  false
51
66
  ) !default;
52
67
 
68
+ // Only show the deprecation warning if user is setting $govuk-font-family-tabular
69
+ // manually instead of automatically via $govuk-use-legacy-font
70
+ @if $govuk-font-family-tabular != false and $govuk-use-legacy-font == false {
71
+ @include _warning(tabular-font-face, "$govuk-font-family-tabular is deprecated. " +
72
+ "From version 5.0, GOV.UK Frontend will not support using a separate " +
73
+ "font-face for tabular numbers.");
74
+ }
75
+
53
76
  /// Font families to use for print media
54
77
  ///
55
78
  /// We recommend that you use system fonts when printing. This will avoid issues
@@ -13,6 +13,8 @@
13
13
  ///
14
14
  /// @type Boolean
15
15
  /// @access public
16
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
17
+ /// suite of tools and settings
16
18
 
17
19
  $govuk-typography-use-rem: if(
18
20
  (
@@ -24,6 +26,16 @@ $govuk-typography-use-rem: if(
24
26
  true
25
27
  ) !default;
26
28
 
29
+ // Only show the deprecation warning if user is setting $govuk-typography-use-rem
30
+ // manually instead of automatically via compatibility variables
31
+ @if $govuk-typography-use-rem == false and
32
+ $govuk-compatibility-govukfrontendtoolkit == false and
33
+ $govuk-compatibility-govuktemplate == false and
34
+ $govuk-compatibility-govukelements == false {
35
+ @include _warning(allow-not-using-rem, "$govuk-typography-use-rem is deprecated. " +
36
+ "From version 5.0, GOV.UK Frontend will not support disabling rem font sizes.");
37
+ }
38
+
27
39
  /// Root font size
28
40
  ///
29
41
  /// This is used to calculate rem sizes for the typography, and should match the
@@ -0,0 +1,53 @@
1
+ ////
2
+ /// @group settings/warnings
3
+ ////
4
+
5
+ /// Suppressed warnings map
6
+ ///
7
+ /// This map is used to determine which deprecation warnings to **not** show
8
+ /// to users when compiling sass. This is in place for codebases that do not
9
+ /// have the necessary capacity to upgrade and remove the deprecation,
10
+ /// particularly if the deprecation is significant. For example, removal of
11
+ /// compatibility with legacy libraries such as govuk_elements.
12
+ ///
13
+ /// You can add to this map and define which warnings to suppress by appending to
14
+ /// it using the warning key, found in the warning message. For example:
15
+ ///
16
+ /// @example scss:
17
+ /// // warning message:
18
+ /// // $foobar is no longer supported. To silence this warning, update
19
+ /// // $govuk-suppressed-warnings with key: "foobar"
20
+ /// $govuk-suppressed-warnings: (
21
+ /// foobar
22
+ /// );
23
+ ///
24
+ /// @type List
25
+ /// @access public
26
+
27
+ $govuk-suppressed-warnings: () !default;
28
+
29
+ /// Warnings
30
+ ///
31
+ /// Acts as a wrapper for the built in `@warn` sass function
32
+ ///
33
+ /// We use this instead of using `@warn` for 3 reasons:
34
+ ///
35
+ /// - To check if a warning is being suppressed through `$govuk-suppressed-warnings`,
36
+ /// in which case we don't call `@warn` and printing the warning to the user
37
+ /// - To format the passed warning `$message` with the warning key at the end
38
+ /// - To prevent duplicate warnings by adding the passed `$key` to
39
+ /// `$govuk-suppressed-warnings` after `@warn` is called to ensure it only runs
40
+ /// once per sass compilation
41
+ ///
42
+ /// @param {String} $key - The key to be checked against `$govuk-suppressed-warnings`
43
+ /// and then passed to it to prevent multiple of the same warning.
44
+ /// @param {String} $message - The message to use when calling `@warn`
45
+ /// @access private
46
+
47
+ @mixin _warning($key, $message) {
48
+ @if not index($govuk-suppressed-warnings, $key) {
49
+ @warn $message + " To silence this warning, update $govuk-suppressed-warnings " +
50
+ "with key: \"#{$key}\"";
51
+ $govuk-suppressed-warnings: append($govuk-suppressed-warnings, $key) !global;
52
+ }
53
+ }
@@ -2,6 +2,20 @@
2
2
  /// @group tools/compatibility-mode
3
3
  ////
4
4
 
5
+ /// Temporary private version of govuk-compatibility to avoid deprecation warnings
6
+ ///
7
+ /// @access private
8
+
9
+ @mixin _govuk-compatibility($product) {
10
+ @if map-has-key($_govuk-compatibility, $product) {
11
+ @if map-get($_govuk-compatibility, $product) == true {
12
+ @content;
13
+ }
14
+ } @else {
15
+ @error "Non existent product '#{$product}'";
16
+ }
17
+ }
18
+
5
19
  /// Conditional Compatibility Mixin
6
20
  ///
7
21
  /// Selectively output a block (available to the mixin as @content) if a given
@@ -24,13 +38,13 @@
24
38
  /// this product
25
39
  /// @throw Errors if product name is not recognised
26
40
  /// @access public
41
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
42
+ /// suite of tools and settings
27
43
 
28
44
  @mixin govuk-compatibility($product) {
29
- @if map-has-key($_govuk-compatibility, $product) {
30
- @if map-get($_govuk-compatibility, $product) == true {
31
- @content;
32
- }
33
- } @else {
34
- @error "Non existent product '#{$product}'";
45
+ @include _warning(compatibility-helper, "govuk-compatibility is deprecated. " +
46
+ "From version 5.0, GOV.UK Frontend will not support compatibility mode.");
47
+ @include _govuk-compatibility($product) {
48
+ @content;
35
49
  }
36
50
  }
@@ -22,7 +22,7 @@ $_govuk-imported-modules: () !default;
22
22
 
23
23
  @mixin govuk-exports($name) {
24
24
  // If the mixin is not in the list of modules already exported...
25
- @if (index($_govuk-imported-modules, $name) == null) {
25
+ @if not index($_govuk-imported-modules, $name) {
26
26
  // ... then add it to the list
27
27
  $_govuk-imported-modules: append($_govuk-imported-modules, $name) !global;
28
28
  // ... and output the CSS for that module
@@ -17,7 +17,7 @@
17
17
  and $govuk-font-url-function
18
18
  and function-exists($govuk-font-url-function);
19
19
 
20
- @if ($use-custom-function) {
20
+ @if $use-custom-function {
21
21
  @return call(get-function($govuk-font-url-function), $filename);
22
22
  } @else {
23
23
  @return url($govuk-fonts-path + $filename);
@@ -17,7 +17,7 @@
17
17
  and $govuk-image-url-function
18
18
  and function-exists($govuk-image-url-function);
19
19
 
20
- @if ($use-custom-function) {
20
+ @if $use-custom-function {
21
21
  @return call(get-function($govuk-image-url-function), $filename);
22
22
  } @else {
23
23
  @return url($govuk-images-path + $filename);
@@ -10,10 +10,10 @@
10
10
  /// @access public
11
11
 
12
12
  @function govuk-em($value, $context-font-size) {
13
- @if (unitless($value)) {
13
+ @if unitless($value) {
14
14
  $value: $value * 1px;
15
15
  }
16
- @if (unitless($context-font-size)) {
16
+ @if unitless($context-font-size) {
17
17
  $context-font-size: $context-font-size * 1px;
18
18
  }
19
19
  @return $value / $context-font-size * 1em;
@@ -12,7 +12,7 @@
12
12
  /// @access public
13
13
 
14
14
  @function govuk-px-to-rem($value) {
15
- @if (unitless($value)) {
15
+ @if unitless($value) {
16
16
  $value: $value * 1px;
17
17
  }
18
18
 
@@ -0,0 +1,21 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
3
+ typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
4
+ (factory());
5
+ }(this, (function () { 'use strict';
6
+
7
+ (function(undefined) {
8
+
9
+ // Detection from https://github.com/Financial-Times/polyfill-library/blob/v3.111.0/polyfills/Date/now/detect.js
10
+ var detect = ('Date' in self && 'now' in self.Date && 'getTime' in self.Date.prototype);
11
+
12
+ if (detect) return
13
+
14
+ // Polyfill from https://polyfill.io/v3/polyfill.js?version=3.111.0&features=Date.now&flags=always
15
+ Date.now = function () {
16
+ return new Date().getTime();
17
+ };
18
+
19
+ }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
20
+
21
+ })));