dxw_govuk_frontend_rails 3.8.0 → 3.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +61 -40
  4. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  5. data/package-lock.json +22 -4
  6. data/package.json +1 -1
  7. data/vendor/assets/javascripts/govuk_frontend_rails.js +84 -33
  8. data/vendor/assets/stylesheets/components/_all.scss +2 -0
  9. data/vendor/assets/stylesheets/components/accordion/_index.scss +7 -17
  10. data/vendor/assets/stylesheets/components/back-link/_index.scss +4 -17
  11. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +0 -1
  12. data/vendor/assets/stylesheets/components/button/_index.scss +5 -3
  13. data/vendor/assets/stylesheets/components/character-count/_index.scss +1 -4
  14. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +13 -13
  15. data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +2 -0
  16. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +51 -0
  17. data/vendor/assets/stylesheets/components/details/_index.scss +5 -2
  18. data/vendor/assets/stylesheets/components/error-summary/_index.scss +2 -14
  19. data/vendor/assets/stylesheets/components/fieldset/_index.scss +1 -1
  20. data/vendor/assets/stylesheets/components/file-upload/_index.scss +13 -14
  21. data/vendor/assets/stylesheets/components/footer/_index.scss +14 -20
  22. data/vendor/assets/stylesheets/components/header/_index.scss +41 -26
  23. data/vendor/assets/stylesheets/components/hint/_index.scss +0 -2
  24. data/vendor/assets/stylesheets/components/input/_index.scss +91 -0
  25. data/vendor/assets/stylesheets/components/notification-banner/_index.scss +89 -0
  26. data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +2 -0
  27. data/vendor/assets/stylesheets/components/panel/_index.scss +6 -2
  28. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +1 -1
  29. data/vendor/assets/stylesheets/components/radios/_index.scss +13 -13
  30. data/vendor/assets/stylesheets/components/select/_index.scss +0 -1
  31. data/vendor/assets/stylesheets/components/skip-link/_index.scss +1 -1
  32. data/vendor/assets/stylesheets/components/summary-list/_index.scss +2 -10
  33. data/vendor/assets/stylesheets/components/table/_index.scss +21 -0
  34. data/vendor/assets/stylesheets/components/tabs/_index.scss +4 -12
  35. data/vendor/assets/stylesheets/components/tag/_index.scss +0 -1
  36. data/vendor/assets/stylesheets/components/textarea/_index.scss +0 -1
  37. data/vendor/assets/stylesheets/components/warning-text/_index.scss +10 -1
  38. data/vendor/assets/stylesheets/core/_links.scss +8 -0
  39. data/vendor/assets/stylesheets/helpers/_device-pixels.scss +3 -3
  40. data/vendor/assets/stylesheets/helpers/_font-faces.scss +9 -11
  41. data/vendor/assets/stylesheets/helpers/_links.scss +239 -32
  42. data/vendor/assets/stylesheets/helpers/_media-queries.scss +1 -5
  43. data/vendor/assets/stylesheets/helpers/_spacing.scss +2 -1
  44. data/vendor/assets/stylesheets/helpers/_typography.scss +7 -6
  45. data/vendor/assets/stylesheets/objects/_all.scss +1 -0
  46. data/vendor/assets/stylesheets/objects/_button-group.scss +94 -0
  47. data/vendor/assets/stylesheets/objects/_form-group.scss +0 -1
  48. data/vendor/assets/stylesheets/objects/_grid.scss +2 -3
  49. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +0 -1
  50. data/vendor/assets/stylesheets/overrides/_display.scss +1 -1
  51. data/vendor/assets/stylesheets/overrides/_width.scss +1 -0
  52. data/vendor/assets/stylesheets/settings/_all.scss +2 -0
  53. data/vendor/assets/stylesheets/settings/_colours-applied.scss +9 -3
  54. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +3 -0
  55. data/vendor/assets/stylesheets/settings/_colours-palette.scss +42 -35
  56. data/vendor/assets/stylesheets/settings/_compatibility.scss +0 -1
  57. data/vendor/assets/stylesheets/settings/_links.scss +62 -0
  58. data/vendor/assets/stylesheets/settings/_measurements.scss +0 -4
  59. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +2 -2
  60. data/vendor/assets/stylesheets/settings/_typography-font.scss +14 -5
  61. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +6 -2
  62. data/vendor/assets/stylesheets/tools/_font-url.scss +0 -3
  63. data/vendor/assets/stylesheets/tools/_image-url.scss +0 -3
  64. data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +0 -1
  65. data/vendor/assets/stylesheets/vendor/_sass-mq.scss +0 -4
  66. metadata +9 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24366e1d10fcdffc7d4ce6ab81b1af6bc53a01971488e7dc4d1e3dc82b3edf3c
4
- data.tar.gz: 9ef221edb271314433d1944067443cb2500536c98cf89e84e672ffd56c5ccc05
3
+ metadata.gz: e42e5531caedbe80f014557b076fc609f16ca85d666bdcc86bfb4e7c280e28a1
4
+ data.tar.gz: c712317b305d72d5960a65a1d4dbf0e7b0ebaf4bd482b057f32c6518d4fc90cc
5
5
  SHA512:
6
- metadata.gz: 5fb712c7e9a7b679f9727b49d57eefe2ca24c0e2b01b0216999ef20ff4ca5c476a63be78d803ff4651b330d5361a4bd13d342dc44118a667cd41b86c1fd44dee
7
- data.tar.gz: 3c0f0d0f3d3dd1182d366a2a547345a63ea13ba90d44a7fa0e914201954c7547aafeff04119f64dcdb1db39c9002d922161df2758f5fc1f05a5290ce45312cc4
6
+ metadata.gz: 5f6a004060916897d45767e91565c3cdc6322d860814f2acbc027d35eca9a22f2d328e955095e4c9d0b14b478de12c259f064d88bdc5468bc0ffda3dcd325085
7
+ data.tar.gz: 3c4a6afe51e11a479d23a3e1ec51e17660511e4dba977af9a89545f5a55be39ac0cffb0cc82626e053323841efdf4976858b4fecf2f11f2664af4341e755e44b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dxw_govuk_frontend_rails (3.8.0)
4
+ dxw_govuk_frontend_rails (3.12.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -18,4 +18,4 @@ DEPENDENCIES
18
18
  rake (~> 13.0)
19
19
 
20
20
  BUNDLED WITH
21
- 2.2.1
21
+ 2.2.24
data/README.md CHANGED
@@ -1,91 +1,112 @@
1
- # GOVUK Frontend for Rails
1
+ # GOV.UK Frontend for Rails
2
2
 
3
3
  ## Read this first
4
4
 
5
- Although this gem makes it super easy to add the GOVUK Frontend to your
6
- Rails applications, we would recommend using it as a guide to add the
7
- GOVUK Frontend yourself.
5
+ Although this gem makes it super easy to add the GOV.UK Frontend to your Rails
6
+ applications, we would recommend using it as a guide to add the GOV.UK Frontend
7
+ yourself.
8
8
 
9
- ## About Adds the GOVUK Frontend for Rails using the asset pipeline.
9
+ ## About
10
+
11
+ Adds the GOV.UK Frontend for Rails using the asset pipeline.
10
12
 
11
13
  https://github.com/alphagov/govuk-frontend
12
14
 
13
15
  ## Breaking Changes in v3.0.0
14
16
 
15
- This release of the GOVUK Frontend has breaking changes! Do not update to this
17
+ This release of the GOV.UK Frontend has breaking changes! Do not update to this
16
18
  version until you have read and understood:
17
19
 
18
- You will not be required to updated any file paths with govuk as we take care of
19
- that for you, all others changes will need to be managed:
20
+ You will not be required to updated any file paths with `govuk` as we take care
21
+ of that for you, all others changes will need to be managed:
20
22
 
21
23
  https://github.com/alphagov/govuk-frontend/releases/tag/v3.0.0
22
24
 
23
25
  ## Limitations
24
26
 
25
- This gem does not include the ie8 version of GOVUK Frontend, as the service
26
- standard no longer requires it:
27
+ This gem does not include the `ie8` version of GOV.UK Frontend, as the service
28
+ standard no longer requires support for Internet Explorer versions less than 11:
27
29
 
28
30
  https://www.gov.uk/service-manual/technology/designing-for-different-browsers-and-devices
29
31
 
30
- This gem and its documentation cannot tell you how to use the GOVUK effectively,
31
- see the GOVUK Design System documentation for that:
32
+ This gem and its documentation cannot tell you how to use the GOV.UK patterns
33
+ effectively, see the GOV.UK Design System documentation for that:
34
+
35
+ https://design-system.service.gov.uk/
32
36
 
33
- https://design-system.service.gov.uk/ ## Installation
37
+ ## Installation
34
38
 
35
39
  Add this line to your application's Gemfile:
36
40
 
37
- ```ruby gem 'dxw_govuk_frontend_rails' ```
41
+ ```ruby
42
+ gem 'dxw_govuk_frontend_rails'
43
+ ```
38
44
 
39
45
  And then execute:
40
46
 
41
- $ bundle
47
+ ```
48
+ $ bundle
49
+ ```
50
+
51
+ ## Usage
42
52
 
43
- ## Usage Your Rails app will need to have sass enabled.
53
+ Your Rails app will need to have SCSS enabled.
54
+
55
+ **IMPORTANT: You must not use this library without changes if the service you
56
+ are building is not on GOV.UK. Read and understand the guidance here:**
57
+
58
+ https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk
44
59
 
45
60
  ### Basic usage
46
61
 
47
- If the service you are building does not need to modify or extend the GOVUK
48
- Frontend all you need to do is import the main sass and javascript files into
62
+ If the service you are building does not need to modify or extend the GOV.UK
63
+ Frontend, all you need to do is import the main SCSS and JavaScript files into
49
64
  your Rails app:
50
65
 
51
- - create a sass file in your application: ```
52
- app/assets/stylesheets/govuk_frontend_rails.scss ```
53
- - import the styles into `govuk_frontend_rails.scss`: ```sass @import
54
- "govuk-frontend-rails"; ```
55
- - require the `govuk-frontend-rails.scss` file in `application.css` or
56
- equivalent:
66
+ - create a SCSS file in your application:
57
67
 
58
- ``` *= require govuk_frontend_rails ```
68
+ `app/assets/stylesheets/govuk_frontend_rails.scss`
59
69
 
60
- - require the javascript into `app/assets/javascripts/application.js`:
70
+ - import the styles into `govuk_frontend_rails.scss`:
61
71
 
62
- ``` //= require govuk_frontend_rails ```
63
- - initialise the GOVUK Frontend either in a .js file on in your application
72
+ `@import "govuk-frontend-rails";`
73
+
74
+ - import the `govuk-frontend-rails.scss` file in the comment block in
75
+ `app/assets/stylesheets/application.css` or equivalent:
76
+
77
+ `*= require govuk_frontend_rails`
78
+
79
+ - import the JavaScript in the comment block of
80
+ `app/assets/javascripts/application.js`:
81
+
82
+ `//= require govuk_frontend_rails`
83
+
84
+ - initialise the GOV.UK Frontend either in a .js file or in your application
64
85
  layout:
65
86
 
66
- ```javascript window.onload = function() { window.GOVUKFrontend.initAll() }; ```
67
- - update your application markup to use the GOVUK Frontend class names
87
+ `window.onload = function() { window.GOVUKFrontend.initAll() };`
68
88
 
69
- IMPORTANT: You cannot use the GOVUK Frontend without changes if the service you
70
- are building is not on GOV.UK, read and understand the guidance here:
89
+ - update your application markup to use the GOV.UK Frontend class names
71
90
 
72
- https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk
91
+ ## Tracking GOV.UK Frontend versions
73
92
 
74
- ## Tracking version We aim to tracking the version of GOVUK Frontend.
93
+ We aim to track the latest version of GOV.UK Frontend but we may fall behind.
94
+ Opening an issue if we are behind on a new release would be helpful, or open a
95
+ PR to update to the latest release!
75
96
 
76
- ## Updating to a new Version of GOVUK Frontend
97
+ ## Updating to a new version of GOV.UK Frontend
77
98
 
78
- When a new version of the GOVUK Frontend is released:
99
+ When a new version of the GOV.UK Frontend is released:
79
100
 
80
- - make a new branch with the GOVUK Frontend version number
101
+ - make a new branch with the GOV.UK Frontend version number
81
102
  - set the new version number in `package.json` and
82
103
  `lib/dxw_govuk_frontend_rails/version.rb`
83
- - run `npm update` to get the new release of the GOVUK Frontend
104
+ - run `npm update` to get the new release of the GOV.UK Frontend
84
105
  - run `bundle exec rake` to compile the new assets
85
106
  - commit the changes
86
- - tag with the same release number as GOVUK Frontend
107
+ - tag with the same release number as GOV.UK Frontend
87
108
  - push the change
88
109
  - push the tag
89
110
  - merge your branch
90
111
  - make a new release of the tag on GitHub
91
- - GitHub acitons will build the gem and push to Rubygems
112
+ - GitHub actions will build the gem and push to RubyGems
@@ -1,3 +1,3 @@
1
1
  module DxwGovukFrontendRails
2
- VERSION = "3.8.0"
2
+ VERSION = "3.12.0"
3
3
  end
data/package-lock.json CHANGED
@@ -1,13 +1,31 @@
1
1
  {
2
2
  "name": "dxw_govuk_frontend_rails",
3
3
  "version": "1.0.0",
4
- "lockfileVersion": 1,
4
+ "lockfileVersion": 2,
5
5
  "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "dxw_govuk_frontend_rails",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "govuk-frontend": "3.12.0"
13
+ }
14
+ },
15
+ "node_modules/govuk-frontend": {
16
+ "version": "3.12.0",
17
+ "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.12.0.tgz",
18
+ "integrity": "sha512-+mM8BqEUqsBVSV/ud0dEhE8OmMdhkK53eEUp5YyPN+y3mwcdRnwwP2A2B5qFdFi6E6j/2AYuCG8l5kXD+JXNxA==",
19
+ "engines": {
20
+ "node": ">= 4.2.0"
21
+ }
22
+ }
23
+ },
6
24
  "dependencies": {
7
25
  "govuk-frontend": {
8
- "version": "3.8.0",
9
- "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.8.0.tgz",
10
- "integrity": "sha512-+vgXzFsh7wpLRGjFSDvDcA2zNA2wOxT6gGs/KUpkTjF1Uop9BerW/1W/YB1BMpeTEJoPlmrkA19+DS1fqJtL9Q=="
26
+ "version": "3.12.0",
27
+ "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.12.0.tgz",
28
+ "integrity": "sha512-+mM8BqEUqsBVSV/ud0dEhE8OmMdhkK53eEUp5YyPN+y3mwcdRnwwP2A2B5qFdFi6E6j/2AYuCG8l5kXD+JXNxA=="
11
29
  }
12
30
  }
13
31
  }
data/package.json CHANGED
@@ -21,6 +21,6 @@
21
21
  },
22
22
  "homepage": "https://github.com/mec/dxw_govuk_frontend_rails#readme",
23
23
  "dependencies": {
24
- "govuk-frontend": "3.8.0"
24
+ "govuk-frontend": "3.12.0"
25
25
  }
26
26
  }
@@ -1498,7 +1498,7 @@ function CharacterCount ($module) {
1498
1498
  this.$module = $module;
1499
1499
  this.$textarea = $module.querySelector('.govuk-js-character-count');
1500
1500
  if (this.$textarea) {
1501
- this.$countMessage = $module.querySelector('[id=' + this.$textarea.id + '-info]');
1501
+ this.$countMessage = $module.querySelector('[id="' + this.$textarea.id + '-info"]');
1502
1502
  }
1503
1503
  }
1504
1504
 
@@ -1959,57 +1959,103 @@ ErrorSummary.prototype.getAssociatedLegendOrLabel = function ($input) {
1959
1959
  $input.closest('label')
1960
1960
  };
1961
1961
 
1962
- function Header ($module) {
1962
+ function NotificationBanner ($module) {
1963
1963
  this.$module = $module;
1964
1964
  }
1965
1965
 
1966
- Header.prototype.init = function () {
1967
- // Check for module
1966
+ /**
1967
+ * Initialise the component
1968
+ */
1969
+ NotificationBanner.prototype.init = function () {
1968
1970
  var $module = this.$module;
1971
+ // Check for module
1969
1972
  if (!$module) {
1970
1973
  return
1971
1974
  }
1972
1975
 
1973
- // Check for button
1974
- var $toggleButton = $module.querySelector('.govuk-js-header-toggle');
1975
- if (!$toggleButton) {
1976
+ this.setFocus();
1977
+ };
1978
+
1979
+ /**
1980
+ * Focus the element
1981
+ *
1982
+ * If `role="alert"` is set, focus the element to help some assistive technologies
1983
+ * prioritise announcing it.
1984
+ *
1985
+ * You can turn off the auto-focus functionality by setting `data-disable-auto-focus="true"` in the
1986
+ * component HTML. You might wish to do this based on user research findings, or to avoid a clash
1987
+ * with another element which should be focused when the page loads.
1988
+ */
1989
+ NotificationBanner.prototype.setFocus = function () {
1990
+ var $module = this.$module;
1991
+
1992
+ if ($module.getAttribute('data-disable-auto-focus') === 'true') {
1993
+ return
1994
+ }
1995
+
1996
+ if ($module.getAttribute('role') !== 'alert') {
1976
1997
  return
1977
1998
  }
1978
1999
 
1979
- // Handle $toggleButton click events
1980
- $toggleButton.addEventListener('click', this.handleClick.bind(this));
2000
+ // Set tabindex to -1 to make the element focusable with JavaScript.
2001
+ // Remove the tabindex on blur as the component doesn't need to be focusable after the page has
2002
+ // loaded.
2003
+ if (!$module.getAttribute('tabindex')) {
2004
+ $module.setAttribute('tabindex', '-1');
2005
+
2006
+ $module.addEventListener('blur', function () {
2007
+ $module.removeAttribute('tabindex');
2008
+ });
2009
+ }
2010
+
2011
+ $module.focus();
1981
2012
  };
1982
2013
 
2014
+ function Header ($module) {
2015
+ this.$module = $module;
2016
+ this.$menuButton = $module && $module.querySelector('.govuk-js-header-toggle');
2017
+ this.$menu = this.$menuButton && $module.querySelector(
2018
+ '#' + this.$menuButton.getAttribute('aria-controls')
2019
+ );
2020
+ }
2021
+
1983
2022
  /**
1984
- * Toggle class
1985
- * @param {object} node element
1986
- * @param {string} className to toggle
1987
- */
1988
- Header.prototype.toggleClass = function (node, className) {
1989
- if (node.className.indexOf(className) > 0) {
1990
- node.className = node.className.replace(' ' + className, '');
1991
- } else {
1992
- node.className += ' ' + className;
2023
+ * Initialise header
2024
+ *
2025
+ * Check for the presence of the header, menu and menu button – if any are
2026
+ * missing then there's nothing to do so return early.
2027
+ */
2028
+ Header.prototype.init = function () {
2029
+ if (!this.$module || !this.$menuButton || !this.$menu) {
2030
+ return
1993
2031
  }
2032
+
2033
+ this.syncState(this.$menu.classList.contains('govuk-header__navigation--open'));
2034
+ this.$menuButton.addEventListener('click', this.handleMenuButtonClick.bind(this));
1994
2035
  };
1995
2036
 
1996
2037
  /**
1997
- * An event handler for click event on $toggleButton
1998
- * @param {object} event event
1999
- */
2000
- Header.prototype.handleClick = function (event) {
2001
- var $module = this.$module;
2002
- var $toggleButton = event.target || event.srcElement;
2003
- var $target = $module.querySelector('#' + $toggleButton.getAttribute('aria-controls'));
2004
-
2005
- // If a button with aria-controls, handle click
2006
- if ($toggleButton && $target) {
2007
- this.toggleClass($target, 'govuk-header__navigation--open');
2008
- this.toggleClass($toggleButton, 'govuk-header__menu-button--open');
2038
+ * Sync menu state
2039
+ *
2040
+ * Sync the menu button class and the accessible state of the menu and the menu
2041
+ * button with the visible state of the menu
2042
+ *
2043
+ * @param {boolean} isVisible Whether the menu is currently visible
2044
+ */
2045
+ Header.prototype.syncState = function (isVisible) {
2046
+ this.$menuButton.classList.toggle('govuk-header__menu-button--open', isVisible);
2047
+ this.$menuButton.setAttribute('aria-expanded', isVisible);
2048
+ };
2009
2049
 
2010
- $toggleButton.setAttribute('aria-expanded', $toggleButton.getAttribute('aria-expanded') !== 'true');
2011
- $target.setAttribute('aria-hidden', $target.getAttribute('aria-hidden') === 'false');
2012
- }
2050
+ /**
2051
+ * Handle menu button click
2052
+ *
2053
+ * When the menu button is clicked, change the visibility of the menu and then
2054
+ * sync the accessibility state and menu button state
2055
+ */
2056
+ Header.prototype.handleMenuButtonClick = function () {
2057
+ var isVisible = this.$menu.classList.toggle('govuk-header__navigation--open');
2058
+ this.syncState(isVisible);
2013
2059
  };
2014
2060
 
2015
2061
  function Radios ($module) {
@@ -2482,6 +2528,11 @@ function initAll (options) {
2482
2528
  var $toggleButton = scope.querySelector('[data-module="govuk-header"]');
2483
2529
  new Header($toggleButton).init();
2484
2530
 
2531
+ var $notificationBanners = scope.querySelectorAll('[data-module="govuk-notification-banner"]');
2532
+ nodeListForEach($notificationBanners, function ($notificationBanner) {
2533
+ new NotificationBanner($notificationBanner).init();
2534
+ });
2535
+
2485
2536
  var $radios = scope.querySelectorAll('[data-module="govuk-radios"]');
2486
2537
  nodeListForEach($radios, function ($radio) {
2487
2538
  new Radios($radio).init();
@@ -6,6 +6,7 @@
6
6
  @import "button/index";
7
7
  @import "checkboxes/index";
8
8
  @import "character-count/index";
9
+ @import "cookie-banner/index";
9
10
  @import "summary-list/index";
10
11
  @import "date-input/index";
11
12
  @import "details/index";
@@ -19,6 +20,7 @@
19
20
  @import "input/index";
20
21
  @import "inset-text/index";
21
22
  @import "label/index";
23
+ @import "notification-banner/index";
22
24
  @import "panel/index";
23
25
  @import "phase-banner/index";
24
26
  @import "tabs/index";
@@ -1,9 +1,4 @@
1
1
  @include govuk-exports("govuk/component/accordion") {
2
-
3
- $govuk-accordion-link-colour: $govuk-link-colour;
4
- $govuk-accordion-link-hover-colour: govuk-colour("light-blue");
5
- $govuk-accordion-border-width: 3px;
6
-
7
2
  .govuk-accordion {
8
3
  @include govuk-responsive-margin(6, "bottom");
9
4
  }
@@ -47,7 +42,6 @@
47
42
 
48
43
  // JavaScript enabled
49
44
  .js-enabled {
50
-
51
45
  .govuk-accordion {
52
46
  // Border at the bottom of the whole accordion
53
47
  border-bottom: 1px solid $govuk-border-colour;
@@ -99,19 +93,9 @@
99
93
  // Safe area on the right to avoid clashing with icon
100
94
  padding-right: 40px;
101
95
  border-top: 1px solid $govuk-border-colour;
102
- color: $govuk-accordion-link-colour;
103
96
  cursor: pointer;
104
97
  }
105
98
 
106
- // For devices that can't hover such as touch devices,
107
- // remove hover state as it can be stuck in that state (iOS).
108
- @media (hover: none) {
109
- .govuk-accordion__section-header:hover {
110
- border-top-color: $govuk-accordion-link-colour;
111
- box-shadow: inset 0 $govuk-accordion-border-width 0 0 $govuk-accordion-link-colour;
112
- }
113
- }
114
-
115
99
  // Buttons within the headers don’t need default styling
116
100
  .govuk-accordion__section-button {
117
101
  @include govuk-typography-common;
@@ -120,7 +104,7 @@
120
104
  margin-left: 0;
121
105
  padding: 0;
122
106
  border-width: 0;
123
- color: inherit;
107
+ color: $govuk-link-colour;
124
108
  background: none;
125
109
  text-align: left;
126
110
  cursor: pointer;
@@ -148,7 +132,13 @@
148
132
  }
149
133
 
150
134
  .govuk-accordion__section-button:hover:not(:focus) {
135
+ color: $govuk-link-hover-colour;
151
136
  text-decoration: underline;
137
+
138
+ // This needs to come after the text-decoration property otherwise
139
+ // text-decoration, as a shorthand property, resets it to auto
140
+ @include govuk-link-hover-decoration;
141
+ text-underline-offset: $govuk-link-underline-offset;
152
142
  }
153
143
 
154
144
  // For devices that can't hover such as touch devices,
@@ -24,21 +24,6 @@
24
24
  padding-left: 14px;
25
25
  }
26
26
 
27
- // Only underline if the component is linkable
28
- .govuk-back-link[href] {
29
- text-decoration: underline;
30
-
31
- // When the back link is focused, hide the bottom link border as the
32
- // focus styles has a bottom border.
33
- &:focus {
34
- text-decoration: none;
35
-
36
- &:before {
37
- border-color: $govuk-text-colour;
38
- }
39
- }
40
- }
41
-
42
27
  // Prepend left pointing chevron
43
28
  .govuk-back-link:before {
44
29
  content: "";
@@ -52,7 +37,6 @@
52
37
  // These should be removed when legacy font support is dropped
53
38
  top: -1px;
54
39
  bottom: 1px;
55
-
56
40
  } @else {
57
41
  top: 0;
58
42
  bottom: 0;
@@ -89,6 +73,10 @@
89
73
  }
90
74
  }
91
75
 
76
+ .govuk-back-link:focus:before {
77
+ border-color: $govuk-focus-text-colour;
78
+ }
79
+
92
80
  .govuk-back-link:after {
93
81
  content: "";
94
82
  position: absolute;
@@ -108,5 +96,4 @@
108
96
  bottom: $offset;
109
97
  }
110
98
  }
111
-
112
99
  }
@@ -57,7 +57,6 @@
57
57
  // These should be removed when legacy font support is dropped
58
58
  top: -1px;
59
59
  bottom: 1px;
60
-
61
60
  } @else {
62
61
  top: 0;
63
62
  bottom: 0;
@@ -1,5 +1,5 @@
1
1
  @include govuk-exports("govuk/component/button") {
2
- $govuk-button-colour: govuk-colour("green", $legacy: #00823b); // sass-lint:disable no-color-literals
2
+ $govuk-button-colour: govuk-colour("green", $legacy: #00823b);
3
3
  $govuk-button-hover-colour: govuk-shade($govuk-button-colour, 20%);
4
4
  $govuk-button-shadow-colour: govuk-shade($govuk-button-colour, 60%);
5
5
  $govuk-button-text-colour: govuk-colour("white");
@@ -29,6 +29,8 @@
29
29
  position: relative;
30
30
  width: 100%;
31
31
  margin-top: 0;
32
+ margin-right: 0;
33
+ margin-left: 0;
32
34
  @include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2
33
35
  padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2) (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)); // s1
34
36
  border: $govuk-border-width-form-element solid transparent;
@@ -117,7 +119,7 @@
117
119
 
118
120
  // Use a pseudo element to expand the click target area to include the
119
121
  // button's shadow as well, in case users try to click it.
120
- &::before {
122
+ &:before {
121
123
  content: "";
122
124
  display: block;
123
125
 
@@ -141,7 +143,7 @@
141
143
  // the click event is still fired.
142
144
  //
143
145
  // 🎉
144
- &:active::before {
146
+ &:active:before {
145
147
  top: -($govuk-border-width-form-element + $button-shadow-size);
146
148
  }
147
149
  }
@@ -11,13 +11,10 @@
11
11
  .govuk-textarea {
12
12
  margin-bottom: govuk-spacing(1);
13
13
  }
14
-
15
- .govuk-textarea--error {
16
- padding: govuk-spacing(1) - 2; // Stop a "jump" when width of border changes
17
- }
18
14
  }
19
15
 
20
16
  .govuk-character-count__message {
17
+ @include govuk-font($size: false, $tabular: true);
21
18
  margin-top: 0;
22
19
  margin-bottom: 0;
23
20
  }
@@ -74,7 +74,7 @@
74
74
  }
75
75
 
76
76
  // [ ] Check box
77
- .govuk-checkboxes__label::before {
77
+ .govuk-checkboxes__label:before {
78
78
  content: "";
79
79
  box-sizing: border-box;
80
80
  position: absolute;
@@ -90,7 +90,7 @@
90
90
  //
91
91
  // The check mark is a box with a border on the left and bottom side (└──),
92
92
  // rotated 45 degrees
93
- .govuk-checkboxes__label::after {
93
+ .govuk-checkboxes__label:after {
94
94
  content: "";
95
95
  box-sizing: border-box;
96
96
 
@@ -123,13 +123,13 @@
123
123
  }
124
124
 
125
125
  // Focused state
126
- .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
126
+ .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
127
127
  border-width: 4px;
128
128
  box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
129
129
  }
130
130
 
131
131
  // Selected state
132
- .govuk-checkboxes__input:checked + .govuk-checkboxes__label::after {
132
+ .govuk-checkboxes__input:checked + .govuk-checkboxes__label:after {
133
133
  opacity: 1;
134
134
  }
135
135
 
@@ -227,7 +227,7 @@
227
227
  //
228
228
  // Reduce the size of the check box [1], vertically center it within the
229
229
  // touch target [2]
230
- .govuk-checkboxes__label::before {
230
+ .govuk-checkboxes__label:before {
231
231
  top: $input-offset - $govuk-border-width-form-element; // 2
232
232
  width: $govuk-small-checkboxes-size; // 1
233
233
  height: $govuk-small-checkboxes-size; // 1
@@ -236,7 +236,7 @@
236
236
  // ✔ Check mark
237
237
  //
238
238
  // Reduce the size of the check mark and re-align within the checkbox
239
- .govuk-checkboxes__label::after {
239
+ .govuk-checkboxes__label:after {
240
240
  top: 15px;
241
241
  left: 6px;
242
242
  width: 12px;
@@ -271,7 +271,7 @@
271
271
  // is so much larger than their visible size, and so we need to provide
272
272
  // feedback to the user as to which checkbox they will select when their
273
273
  // cursor is outside of the visible area.
274
- .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {
274
+ .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
275
275
  box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
276
276
  }
277
277
 
@@ -280,10 +280,10 @@
280
280
  //
281
281
  // We use two box shadows, one that restores the original focus state [1]
282
282
  // and another that then applies the hover state [2].
283
- .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
284
- // sass-lint:disable indentation
285
- box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour, // 1
286
- 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
283
+ .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
284
+ box-shadow:
285
+ 0 0 0 $govuk-focus-width $govuk-focus-colour, // 1
286
+ 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
287
287
  }
288
288
 
289
289
  // For devices that explicitly don't support hover, don't provide a hover
@@ -293,11 +293,11 @@
293
293
  // state in browsers that don't support `@media (hover)` (like Internet
294
294
  // Explorer) – so we have to 'undo' the hover state instead.
295
295
  @media (hover: none), (pointer: coarse) {
296
- .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label::before {
296
+ .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
297
297
  box-shadow: initial;
298
298
  }
299
299
 
300
- .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
300
+ .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
301
301
  box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
302
302
  }
303
303
  }
@@ -0,0 +1,2 @@
1
+ @import "../../base";
2
+ @import "./index";