@ministryofjustice/frontend 3.3.1 → 3.5.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 (83) hide show
  1. package/README.md +4 -10
  2. package/govuk-prototype-kit.config.json +5 -16
  3. package/moj/all.jquery.min.js +15 -4
  4. package/moj/all.js +2856 -2280
  5. package/moj/all.scss +2 -0
  6. package/moj/components/_all.scss +1 -0
  7. package/moj/components/action-bar/_action-bar.scss +4 -6
  8. package/moj/components/add-another/_add-another.scss +9 -7
  9. package/moj/components/add-another/add-another.js +128 -76
  10. package/moj/components/alert/README.md +0 -0
  11. package/moj/components/alert/_alert.scss +142 -0
  12. package/moj/components/alert/alert.js +482 -0
  13. package/moj/components/alert/alert.spec.helper.js +92 -0
  14. package/moj/components/alert/macro.njk +3 -0
  15. package/moj/components/alert/template.njk +83 -0
  16. package/moj/components/badge/_badge.scss +3 -4
  17. package/moj/components/banner/_banner.scss +5 -10
  18. package/moj/components/button-menu/_button-menu.scss +10 -9
  19. package/moj/components/button-menu/button-menu.js +348 -318
  20. package/moj/components/cookie-banner/_cookie-banner.scss +6 -5
  21. package/moj/components/currency-input/_currency-input.scss +4 -4
  22. package/moj/components/date-picker/README.md +14 -17
  23. package/moj/components/date-picker/_date-picker.scss +122 -106
  24. package/moj/components/date-picker/date-picker.js +927 -900
  25. package/moj/components/filter/README.md +1 -1
  26. package/moj/components/filter/_filter.scss +53 -75
  27. package/moj/components/filter-toggle-button/filter-toggle-button.js +122 -87
  28. package/moj/components/form-validator/form-validator.js +399 -156
  29. package/moj/components/header/_header.scss +17 -19
  30. package/moj/components/identity-bar/_identity-bar.scss +5 -5
  31. package/moj/components/interruption-card/_interruption-card.scss +2 -2
  32. package/moj/components/messages/_messages.scss +12 -19
  33. package/moj/components/multi-file-upload/README.md +1 -1
  34. package/moj/components/multi-file-upload/_multi-file-upload.scss +34 -30
  35. package/moj/components/multi-file-upload/multi-file-upload.js +454 -183
  36. package/moj/components/multi-select/_multi-select.scss +4 -3
  37. package/moj/components/multi-select/multi-select.js +106 -70
  38. package/moj/components/notification-badge/_notification-badge.scss +12 -12
  39. package/moj/components/organisation-switcher/_organisation-switcher.scss +1 -1
  40. package/moj/components/page-header-actions/_page-header-actions.scss +3 -2
  41. package/moj/components/pagination/_pagination.scss +26 -31
  42. package/moj/components/password-reveal/_password-reveal.scss +1 -2
  43. package/moj/components/password-reveal/password-reveal.js +63 -31
  44. package/moj/components/primary-navigation/_primary-navigation.scss +26 -29
  45. package/moj/components/progress-bar/_progress-bar.scss +21 -26
  46. package/moj/components/rich-text-editor/_rich-text-editor.scss +17 -16
  47. package/moj/components/rich-text-editor/rich-text-editor.js +186 -139
  48. package/moj/components/search/_search.scss +6 -4
  49. package/moj/components/search-toggle/search-toggle.js +83 -53
  50. package/moj/components/search-toggle/search-toggle.scss +21 -15
  51. package/moj/components/side-navigation/_side-navigation.scss +12 -21
  52. package/moj/components/sortable-table/_sortable-table.scss +25 -23
  53. package/moj/components/sortable-table/sortable-table.js +162 -119
  54. package/moj/components/sub-navigation/_sub-navigation.scss +24 -28
  55. package/moj/components/tag/_tag.scss +8 -9
  56. package/moj/components/task-list/_task-list.scss +8 -7
  57. package/moj/components/ticket-panel/_ticket-panel.scss +14 -6
  58. package/moj/components/timeline/_timeline.scss +18 -20
  59. package/moj/filters/all.js +28 -30
  60. package/moj/filters/prototype-kit-13-filters.js +2 -1
  61. package/moj/helpers/_all.scss +1 -0
  62. package/moj/helpers/_hidden.scss +1 -1
  63. package/moj/helpers/_links.scss +20 -0
  64. package/moj/helpers.js +218 -51
  65. package/moj/init.js +2 -2
  66. package/moj/moj-frontend.min.css +2 -2
  67. package/moj/moj-frontend.min.js +15 -4
  68. package/moj/objects/_filter-layout.scss +11 -10
  69. package/moj/objects/_scrollable-pane.scss +11 -14
  70. package/moj/settings/_colours.scss +5 -0
  71. package/moj/settings/_measurements.scss +0 -2
  72. package/moj/utilities/_hidden.scss +3 -3
  73. package/moj/utilities/_width-container.scss +1 -1
  74. package/moj/version.js +28 -1
  75. package/package.json +1 -1
  76. package/moj/all.spec.js +0 -22
  77. package/moj/components/button-menu/button-menu.spec.js +0 -361
  78. package/moj/components/date-picker/date-picker.spec.js +0 -1130
  79. package/moj/components/filter-toggle-button/filter-toggle-button.spec.js +0 -304
  80. package/moj/components/multi-select/multi-select.spec.js +0 -135
  81. package/moj/components/password-reveal/password-reveal.spec.js +0 -55
  82. package/moj/components/search-toggle/search-toggle.spec.js +0 -134
  83. package/moj/namespace.js +0 -1
@@ -1,70 +1,106 @@
1
- MOJFrontend.MultiSelect = function(options) {
2
- this.container = $(options.container);
3
-
4
- if (this.container.data('moj-multi-select-initialised')) {
5
- return
6
- }
7
-
8
- this.container.data('moj-multi-select-initialised', true);
9
-
10
- const idPrefix = options.id_prefix;
11
- let allId = 'checkboxes-all';
12
- if (typeof idPrefix !== 'undefined') {
13
- allId = idPrefix + 'checkboxes-all';
14
- }
15
-
16
- this.toggle = $(this.getToggleHtml(allId));
17
- this.toggleButton = this.toggle.find('input');
18
- this.toggleButton.on('click', $.proxy(this, 'onButtonClick'));
19
- this.container.append(this.toggle);
20
- this.checkboxes = $(options.checkboxes);
21
- this.checkboxes.on('click', $.proxy(this, 'onCheckboxClick'));
22
- this.checked = options.checked || false;
23
- };
24
-
25
- MOJFrontend.MultiSelect.prototype.getToggleHtml = function (allId) {
26
- let html = '';
27
- html += '<div class="govuk-checkboxes__item govuk-checkboxes--small moj-multi-select__checkbox">';
28
- html += ` <input type="checkbox" class="govuk-checkboxes__input" id="${allId}">`;
29
- html += ` <label class="govuk-label govuk-checkboxes__label moj-multi-select__toggle-label" for="${allId}">`;
30
- html += ' <span class="govuk-visually-hidden">Select all</span>';
31
- html += ' </label>';
32
- html += '</div>';
33
- return html;
34
- };
35
-
36
- MOJFrontend.MultiSelect.prototype.onButtonClick = function(e) {
37
- if(this.checked) {
38
- this.uncheckAll();
39
- this.toggleButton[0].checked = false;
40
- } else {
41
- this.checkAll();
42
- this.toggleButton[0].checked = true;
43
- }
44
- };
45
-
46
- MOJFrontend.MultiSelect.prototype.checkAll = function() {
47
- this.checkboxes.each($.proxy(function(index, el) {
48
- el.checked = true;
49
- }, this));
50
- this.checked = true;
51
- };
52
-
53
- MOJFrontend.MultiSelect.prototype.uncheckAll = function() {
54
- this.checkboxes.each($.proxy(function(index, el) {
55
- el.checked = false;
56
- }, this));
57
- this.checked = false;
58
- };
59
-
60
- MOJFrontend.MultiSelect.prototype.onCheckboxClick = function(e) {
61
- if(!e.target.checked) {
62
- this.toggleButton[0].checked = false;
63
- this.checked = false;
64
- } else {
65
- if(this.checkboxes.filter(':checked').length === this.checkboxes.length) {
66
- this.toggleButton[0].checked = true;
67
- this.checked = true;
68
- }
69
- }
70
- };
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MOJFrontend = factory());
5
+ })(this, (function () { 'use strict';
6
+
7
+ function getDefaultExportFromCjs (x) {
8
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
+ }
10
+
11
+ var _global_window_jQuery = window.jQuery;
12
+
13
+ var multiSelect$1;
14
+ var hasRequiredMultiSelect;
15
+
16
+ function requireMultiSelect () {
17
+ if (hasRequiredMultiSelect) return multiSelect$1;
18
+ hasRequiredMultiSelect = 1;
19
+ const $ = _global_window_jQuery;
20
+
21
+ function MultiSelect(options) {
22
+ this.container = $(options.container);
23
+
24
+ if (this.container.data('moj-multi-select-initialised')) {
25
+ return
26
+ }
27
+
28
+ this.container.data('moj-multi-select-initialised', true);
29
+
30
+ const idPrefix = options.id_prefix;
31
+ let allId = 'checkboxes-all';
32
+ if (typeof idPrefix !== 'undefined') {
33
+ allId = `${idPrefix}checkboxes-all`;
34
+ }
35
+
36
+ this.toggle = $(this.getToggleHtml(allId));
37
+ this.toggleButton = this.toggle.find('input');
38
+ this.toggleButton.on('click', $.proxy(this, 'onButtonClick'));
39
+ this.container.append(this.toggle);
40
+ this.checkboxes = $(options.checkboxes);
41
+ this.checkboxes.on('click', $.proxy(this, 'onCheckboxClick'));
42
+ this.checked = options.checked || false;
43
+ }
44
+
45
+ MultiSelect.prototype.getToggleHtml = function (allId) {
46
+ let html = '';
47
+ html +=
48
+ '<div class="govuk-checkboxes__item govuk-checkboxes--small moj-multi-select__checkbox">';
49
+ html += ` <input type="checkbox" class="govuk-checkboxes__input" id="${allId}">`;
50
+ html += ` <label class="govuk-label govuk-checkboxes__label moj-multi-select__toggle-label" for="${allId}">`;
51
+ html += ' <span class="govuk-visually-hidden">Select all</span>';
52
+ html += ' </label>';
53
+ html += '</div>';
54
+ return html
55
+ };
56
+
57
+ MultiSelect.prototype.onButtonClick = function (e) {
58
+ if (this.checked) {
59
+ this.uncheckAll();
60
+ this.toggleButton[0].checked = false;
61
+ } else {
62
+ this.checkAll();
63
+ this.toggleButton[0].checked = true;
64
+ }
65
+ };
66
+
67
+ MultiSelect.prototype.checkAll = function () {
68
+ this.checkboxes.each(
69
+ $.proxy(function (index, el) {
70
+ el.checked = true;
71
+ }, this)
72
+ );
73
+ this.checked = true;
74
+ };
75
+
76
+ MultiSelect.prototype.uncheckAll = function () {
77
+ this.checkboxes.each(
78
+ $.proxy(function (index, el) {
79
+ el.checked = false;
80
+ }, this)
81
+ );
82
+ this.checked = false;
83
+ };
84
+
85
+ MultiSelect.prototype.onCheckboxClick = function (e) {
86
+ if (!e.target.checked) {
87
+ this.toggleButton[0].checked = false;
88
+ this.checked = false;
89
+ } else {
90
+ if (this.checkboxes.filter(':checked').length === this.checkboxes.length) {
91
+ this.toggleButton[0].checked = true;
92
+ this.checked = true;
93
+ }
94
+ }
95
+ };
96
+
97
+ multiSelect$1 = { MultiSelect };
98
+ return multiSelect$1;
99
+ }
100
+
101
+ var multiSelectExports = requireMultiSelect();
102
+ var multiSelect = /*@__PURE__*/getDefaultExportFromCjs(multiSelectExports);
103
+
104
+ return multiSelect;
105
+
106
+ }));
@@ -3,15 +3,15 @@
3
3
  ========================================================================== */
4
4
 
5
5
  .moj-notification-badge {
6
- @include govuk-font($size: 16, $weight: "bold");
7
- color: govuk-colour("white");
8
- display: inline-block;
9
- min-width: 15px;
10
- padding: 5px 8px 2px 8px;
11
- border-radius: 75px;
12
- background-color: govuk-colour("red");
13
- font-size: 16px;
14
- font-weight: 600;
15
- text-align: center;
16
- white-space: nowrap;
17
- }
6
+ @include govuk-font($size: 16, $weight: "bold");
7
+ display: inline-block;
8
+ min-width: 15px;
9
+ padding: 5px 8px 2px;
10
+ border-radius: 75px;
11
+ color: govuk-colour("white");
12
+ background-color: govuk-colour("red");
13
+ font-size: 16px;
14
+ font-weight: 600;
15
+ text-align: center;
16
+ white-space: nowrap;
17
+ }
@@ -13,8 +13,8 @@
13
13
  .moj-organisation-nav__title {
14
14
  @include govuk-font($size: 19, $weight: "bold");
15
15
  @include govuk-media-query($from: tablet) {
16
- float: left;
17
16
  width: 75%;
17
+ float: left;
18
18
  }
19
19
  }
20
20
 
@@ -1,11 +1,11 @@
1
1
  .moj-page-header-actions {
2
2
  display: flex;
3
+ min-height: govuk-spacing(7); // Match button height
4
+ margin-bottom: govuk-spacing(7);
3
5
  flex-wrap: wrap;
4
6
  justify-content: space-between;
5
7
  align-items: center;
6
8
  gap: govuk-spacing(2);
7
- margin-bottom: govuk-spacing(7);
8
- min-height: govuk-spacing(7); // Match button height
9
9
  }
10
10
 
11
11
  .moj-page-header-actions__title {
@@ -18,6 +18,7 @@
18
18
  .moj-button-group {
19
19
  margin-bottom: 0;
20
20
  }
21
+
21
22
  .govuk-button {
22
23
  margin-bottom: 0;
23
24
  }
@@ -2,10 +2,10 @@
2
2
  // text-align: center;
3
3
 
4
4
  @include govuk-media-query($from: desktop) {
5
+ margin-right: - govuk-spacing(1);
5
6
 
6
7
  // Alignment adjustments
7
8
  margin-left: - govuk-spacing(1);
8
- margin-right: - govuk-spacing(1);
9
9
 
10
10
  // Hide whitespace between elements
11
11
  font-size: 0;
@@ -13,19 +13,18 @@
13
13
  // Trick to remove the need for floats
14
14
  text-align: justify;
15
15
 
16
- &:after {
17
- content: '';
16
+ &::after {
17
+ content: "";
18
18
  display: inline-block;
19
19
  width: 100%;
20
20
  }
21
21
  }
22
-
23
22
  }
24
23
 
25
24
  .moj-pagination__list {
26
- list-style: none;
27
25
  margin: 0;
28
26
  padding: 0;
27
+ list-style: none;
29
28
  @include govuk-media-query($from: desktop) {
30
29
  display: inline-block;
31
30
  margin-bottom: 0;
@@ -36,6 +35,7 @@
36
35
  .moj-pagination__results {
37
36
  @include govuk-font(19);
38
37
  margin-top: 0;
38
+ padding: govuk-spacing(1);
39
39
  @include govuk-media-query($from: desktop) {
40
40
  display: inline-block;
41
41
  margin-bottom: 0;
@@ -50,49 +50,49 @@
50
50
 
51
51
  .moj-pagination__item--active,
52
52
  .moj-pagination__item--dots {
53
- font-weight: bold;
54
53
  height: 25px;
55
54
  padding: govuk-spacing(1) govuk-spacing(2);
55
+ font-weight: bold;
56
56
  text-align: center;
57
57
  }
58
58
 
59
59
  .moj-pagination__item--dots {
60
- padding-left: 0;
61
60
  padding-right: 0;
61
+ padding-left: 0;
62
62
  }
63
63
 
64
- .moj-pagination__item--prev .moj-pagination__link:before,
65
- .moj-pagination__item--next .moj-pagination__link:after {
66
- display: inline-block;
67
- height: 10px;
68
- width: 10px;
69
- border-style: solid;
70
- color: govuk-colour("black");
71
- background: transparent;
72
- -webkit-transform: rotate(-45deg);
73
- -ms-transform: rotate(-45deg);
74
- transform: rotate(-45deg);
75
- content: "";
64
+ .moj-pagination__item--prev .moj-pagination__link::before,
65
+ .moj-pagination__item--next .moj-pagination__link::after {
66
+ content: "";
67
+ display: inline-block;
68
+ width: 10px;
69
+ height: 10px;
70
+ -webkit-transform: rotate(-45deg);
71
+ -ms-transform: rotate(-45deg);
72
+ transform: rotate(-45deg);
73
+ border-style: solid;
74
+ color: govuk-colour("black");
75
+ background: transparent;
76
76
  }
77
77
 
78
- .moj-pagination__item--prev .moj-pagination__link:before {
79
- border-width: 3px 0 0 3px;
80
- margin-right: govuk-spacing(1);
78
+ .moj-pagination__item--prev .moj-pagination__link::before {
79
+ margin-right: govuk-spacing(1);
80
+ border-width: 3px 0 0 3px;
81
81
  }
82
82
 
83
- .moj-pagination__item--next .moj-pagination__link:after {
84
- border-width: 0 3px 3px 0;
85
- margin-left: govuk-spacing(1);
83
+ .moj-pagination__item--next .moj-pagination__link::after {
84
+ margin-left: govuk-spacing(1);
85
+ border-width: 0 3px 3px 0;
86
86
  }
87
87
 
88
88
  .moj-pagination__link {
89
89
  @include govuk-link-common;
90
90
  @include govuk-link-style-default;
91
91
  display: block;
92
+ min-width: 25px;
92
93
  padding: govuk-spacing(1);
93
94
  text-align: center;
94
95
  text-decoration: none;
95
- min-width: 25px;
96
96
 
97
97
  &:link,
98
98
  &:visited {
@@ -106,9 +106,4 @@
106
106
  &:focus {
107
107
  color: govuk-colour("black");
108
108
  }
109
-
110
- }
111
-
112
- .moj-pagination__results {
113
- padding: govuk-spacing(1);
114
109
  }
@@ -12,5 +12,4 @@
12
12
  &__button {
13
13
  width: 80px;
14
14
  }
15
-
16
- }
15
+ }
@@ -1,32 +1,64 @@
1
- MOJFrontend.PasswordReveal = function(element) {
2
- this.el = element;
3
- var $el = $(this.el)
4
-
5
- if ($el.data('moj-password-reveal-initialised')) {
6
- return
7
- }
8
-
9
- $el.data('moj-password-reveal-initialised', true);
10
- $el.attr('spellcheck', 'false');
11
-
12
- $el.wrap('<div class="moj-password-reveal"></div>');
13
- this.container = $(this.el).parent();
14
- this.createButton();
15
- };
16
-
17
- MOJFrontend.PasswordReveal.prototype.createButton = function() {
18
- this.button = $('<button type="button" class="govuk-button govuk-button--secondary moj-password-reveal__button">Show <span class="govuk-visually-hidden">password</span></button>');
19
- this.container.append(this.button);
20
- this.button.on('click', $.proxy(this, 'onButtonClick'));
21
- };
22
-
23
- MOJFrontend.PasswordReveal.prototype.onButtonClick = function() {
24
- if (this.el.type === 'password') {
25
- this.el.type = 'text';
26
- this.button.html('Hide <span class="govuk-visually-hidden">password</span>');
27
- } else {
28
- this.el.type = 'password';
29
- this.button.html('Show <span class="govuk-visually-hidden">password</span>');
30
- }
31
- };
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MOJFrontend = factory());
5
+ })(this, (function () { 'use strict';
32
6
 
7
+ function getDefaultExportFromCjs (x) {
8
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
+ }
10
+
11
+ var _global_window_jQuery = window.jQuery;
12
+
13
+ var passwordReveal$1;
14
+ var hasRequiredPasswordReveal;
15
+
16
+ function requirePasswordReveal () {
17
+ if (hasRequiredPasswordReveal) return passwordReveal$1;
18
+ hasRequiredPasswordReveal = 1;
19
+ const $ = _global_window_jQuery;
20
+
21
+ function PasswordReveal(element) {
22
+ this.el = element;
23
+ const $el = $(this.el);
24
+
25
+ if ($el.data('moj-password-reveal-initialised')) {
26
+ return
27
+ }
28
+
29
+ $el.data('moj-password-reveal-initialised', true);
30
+ $el.attr('spellcheck', 'false');
31
+
32
+ $el.wrap('<div class="moj-password-reveal"></div>');
33
+ this.container = $(this.el).parent();
34
+ this.createButton();
35
+ }
36
+
37
+ PasswordReveal.prototype.createButton = function () {
38
+ this.button = $(
39
+ '<button type="button" class="govuk-button govuk-button--secondary moj-password-reveal__button">Show <span class="govuk-visually-hidden">password</span></button>'
40
+ );
41
+ this.container.append(this.button);
42
+ this.button.on('click', $.proxy(this, 'onButtonClick'));
43
+ };
44
+
45
+ PasswordReveal.prototype.onButtonClick = function () {
46
+ if (this.el.type === 'password') {
47
+ this.el.type = 'text';
48
+ this.button.html('Hide <span class="govuk-visually-hidden">password</span>');
49
+ } else {
50
+ this.el.type = 'password';
51
+ this.button.html('Show <span class="govuk-visually-hidden">password</span>');
52
+ }
53
+ };
54
+
55
+ passwordReveal$1 = { PasswordReveal };
56
+ return passwordReveal$1;
57
+ }
58
+
59
+ var passwordRevealExports = requirePasswordReveal();
60
+ var passwordReveal = /*@__PURE__*/getDefaultExportFromCjs(passwordRevealExports);
61
+
62
+ return passwordReveal;
63
+
64
+ }));
@@ -11,12 +11,11 @@
11
11
  font-size: 0; // Hide whitespace between elements
12
12
  text-align: justify; // Trick to remove the need for floats
13
13
 
14
- &:after {
15
- content: '';
14
+ &::after {
15
+ content: "";
16
16
  display: inline-block;
17
17
  width: 100%;
18
18
  }
19
-
20
19
  }
21
20
 
22
21
  .moj-primary-navigation__nav {
@@ -25,36 +24,34 @@
25
24
  display: inline-block;
26
25
  vertical-align: middle;
27
26
  }
28
-
29
27
  }
30
28
 
31
29
  .moj-primary-navigation__list {
32
- font-size: 0; // Removes white space when using inline-block on child element.
33
- list-style: none;
34
30
  margin: 0;
35
31
  padding: 0;
32
+ font-size: 0; // Removes white space when using inline-block on child element.
33
+ list-style: none;
36
34
  }
37
35
 
38
36
  .moj-primary-navigation__item {
39
37
  @include govuk-font($size: 19);
40
38
  display: inline-block;
41
- margin-right: govuk-spacing(4);
42
39
  margin-top: 0;
40
+ margin-right: govuk-spacing(4);
43
41
 
44
42
  &:last-child {
45
43
  margin-right: 0;
46
44
  }
47
-
48
45
  }
49
46
 
50
47
  .moj-primary-navigation__link {
51
48
  @include govuk-link-common;
52
49
  @include govuk-link-style-default;
53
50
  display: block;
54
- padding-bottom: 15px;
55
51
  padding-top: 15px;
56
- text-decoration: none;
52
+ padding-bottom: 15px;
57
53
  font-weight: bold;
54
+ text-decoration: none;
58
55
 
59
56
  &:link,
60
57
  &:visited {
@@ -66,63 +63,63 @@
66
63
  }
67
64
 
68
65
  &:focus {
69
- color: govuk-colour("black"); // Focus colour on yellow should really be black.
70
66
  position: relative; // Ensure focus sits above everything else.
71
67
  z-index: 1;
68
+ color: govuk-colour("black"); // Focus colour on yellow should really be black.
72
69
  box-shadow: none;
73
70
  }
74
71
 
75
- &:focus:before {
76
- background-color: govuk-colour("black");
72
+ &:focus::before {
77
73
  content: "";
78
74
  display: block;
79
- height: 5px;
80
- position: absolute; bottom: 0; left: 0;
75
+ position: absolute;
76
+ bottom: 0;
77
+ left: 0;
81
78
  width: 100%;
79
+ height: 5px;
80
+ background-color: govuk-colour("black");
82
81
  }
83
82
 
84
83
  &[aria-current] {
85
- color: $govuk-link-colour;
86
84
  position: relative;
87
- text-decoration: none;
85
+ color: $govuk-link-colour;
88
86
  font-weight: bold;
89
- &:before {
90
- background-color: $govuk-link-colour;
87
+ text-decoration: none;
88
+
89
+ &::before {
91
90
  content: "";
92
91
  display: block;
93
- height: 5px;
94
- position: absolute; bottom: 0; left: 0;
92
+ position: absolute;
93
+ bottom: 0;
94
+ left: 0;
95
95
  width: 100%;
96
+ height: 5px;
97
+ background-color: $govuk-link-colour;
96
98
  }
97
99
 
98
100
  &:hover {
99
101
  color: $govuk-link-hover-colour;
100
102
 
101
- &:before {
103
+ &::before {
102
104
  background-color: $govuk-link-hover-colour;
103
105
  }
104
106
  }
105
107
 
106
108
  &:focus {
107
- color: govuk-colour("black"); // Focus colour on yellow should really be black.
108
109
  position: relative; // Ensure focus sits above everything else.
109
110
  border: none;
111
+ color: govuk-colour("black"); // Focus colour on yellow should really be black.
110
112
 
111
- &:before {
113
+ &::before {
112
114
  background-color: govuk-colour("black");
113
115
  }
114
-
115
116
  }
116
-
117
117
  }
118
-
119
118
  }
120
119
 
121
120
  .moj-primary-navigation__search {
122
-
123
121
  @include govuk-media-query($from: desktop) {
124
122
  display: inline-block;
125
123
  vertical-align: middle;
126
124
  }
127
-
128
125
  }