dxw_govuk_frontend_rails 3.2.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gempush.yml +2 -2
  3. data/.github/workflows/test.yml +19 -0
  4. data/Gemfile.lock +3 -3
  5. data/dxw_govuk_frontend_rails.gemspec +1 -1
  6. data/lib/dxw_govuk_frontend_rails.rb +12 -1
  7. data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
  8. data/package-lock.json +3 -3
  9. data/package.json +2 -2
  10. data/vendor/assets/javascripts/govuk_frontend_rails.js +69 -69
  11. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +14 -11
  12. data/vendor/assets/stylesheets/components/button/_button.scss +4 -10
  13. data/vendor/assets/stylesheets/components/footer/_footer.scss +16 -41
  14. data/vendor/assets/stylesheets/components/header/_header.scss +8 -7
  15. data/vendor/assets/stylesheets/components/input/_input.scss +3 -0
  16. data/vendor/assets/stylesheets/components/radios/_radios.scss +1 -1
  17. data/vendor/assets/stylesheets/components/select/_select.scss +3 -0
  18. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +6 -0
  19. data/vendor/assets/stylesheets/components/tag/_tag.scss +47 -0
  20. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +10 -9
  21. data/vendor/assets/stylesheets/helpers/_spacing.scss +4 -4
  22. data/vendor/assets/stylesheets/helpers/_typography.scss +5 -5
  23. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +29 -29
  24. data/vendor/assets/stylesheets/objects/_width-container.scss +33 -10
  25. data/vendor/assets/stylesheets/overrides/_display.scss +10 -0
  26. data/vendor/assets/stylesheets/settings/_colours-palette.scss +1 -1
  27. data/vendor/assets/stylesheets/tools/_iff.scss +3 -1
  28. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61748f1e13e72d91ec0f332ab57f1aed6576a0aefd522c7c302778a8618f74e5
4
- data.tar.gz: 2ba98295582b3a676de197ee93e0625542579925020a169c672802eee641be52
3
+ metadata.gz: de482bfdfa09a6ce5fa71d92b1e3aeba8067157a06e3da22bc86b34713b7c9b8
4
+ data.tar.gz: f3e866b3cb02ec7ef83d934beddb3ee3a84d17cf191228051301a5301d551f10
5
5
  SHA512:
6
- metadata.gz: 9b59f87fef5d49b8519d8bf8f6fbd4899b8fb4c602fbe7ebf4a934f73e70e0addb429edc341c66ce94734716bee9637a70be02bb05be5f3d4b23407294d6bb97
7
- data.tar.gz: 362e8387f34f0995a5d7bb00d03fcb0fb2f8a71f03219ae9b42df429cfd9a1e19a6ebdfae9e337a7d7dd6e3b7a1b33f94b75d3057d08535aa761dc601136218d
6
+ metadata.gz: 9e1a93086b6f6ed875cb2d63452496cd20ba10c82d6b3f344ea3aa8bc82abf82ce07c5b76e473a864065066cf3cdd852425973c6105f47ec2991e71bc85f5e4e
7
+ data.tar.gz: b45b9b5aa0bcc6f675d07438cfb9092dec30f836fe95f2ac594b74034c0ec85ff277dcf0478fb2f133398ccf30a0fc47670769e75ed997737984bdcb899a43a9
@@ -1,4 +1,4 @@
1
- name: Ruby Gem
1
+ name: Ruby Gems
2
2
 
3
3
  on:
4
4
  push:
@@ -13,7 +13,7 @@ jobs:
13
13
  steps:
14
14
  - uses: actions/checkout@master
15
15
  - name: Set up Ruby 2.6
16
- uses: actions/setup-ruby@v1
16
+ uses: actions/setup-ruby@master
17
17
  with:
18
18
  version: 2.6.x
19
19
 
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ name: Test that the sass compiles
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@master
12
+ - uses: actions/setup-node@master
13
+ with:
14
+ node-version: '10.x'
15
+ - run: npm test
16
+ env:
17
+ CI: true
18
+
19
+
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dxw_govuk_frontend_rails (3.2.0)
4
+ dxw_govuk_frontend_rails (3.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- rake (10.5.0)
9
+ rake (13.0.1)
10
10
 
11
11
  PLATFORMS
12
12
  ruby
@@ -14,7 +14,7 @@ PLATFORMS
14
14
  DEPENDENCIES
15
15
  bundler (~> 2.0)
16
16
  dxw_govuk_frontend_rails!
17
- rake (~> 10.0)
17
+ rake (~> 13.0)
18
18
 
19
19
  BUNDLED WITH
20
20
  2.0.2
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 2.0"
26
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rake", "~> 13.0"
27
27
  end
@@ -5,7 +5,18 @@ module DxwGovukFrontendRails
5
5
  class Engine < ::Rails::Engine
6
6
  initializer 'GovukFrontendRails.assets.precompile' do |app|
7
7
  app.config.assets.precompile <<
8
- /[\w]+\.(?:png|svg|gif|ico|eot|woff|woff2)$/
8
+ [
9
+ "favicon.ico",
10
+ "govuk-apple-touch-icon-152x152.png",
11
+ "govuk-apple-touch-icon-167x167.png",
12
+ "govuk-apple-touch-icon-180x180.png",
13
+ "govuk-apple-touch-icon.png",
14
+ "govuk-crest-2x.png",
15
+ "govuk-crest.png",
16
+ "govuk-logotype-crown.png",
17
+ "govuk-mask-icon.svg",
18
+ "govuk-opengraph-image.png",
19
+ ]
9
20
  end
10
21
  end
11
22
  end
@@ -1,3 +1,3 @@
1
1
  module DxwGovukFrontendRails
2
- VERSION = "3.2.0"
2
+ VERSION = "3.6.0"
3
3
  end
@@ -5,9 +5,9 @@
5
5
  "requires": true,
6
6
  "dependencies": {
7
7
  "govuk-frontend": {
8
- "version": "3.2.0",
9
- "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.2.0.tgz",
10
- "integrity": "sha512-OtJozAGMEKFu195fNVVrQHUX7+znCkA4cXDKs4lgFlRQOTzN1ogT9010GBARuoTwbeL0VqQ8nerZYjVxH/wafA=="
8
+ "version": "3.6.0",
9
+ "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.6.0.tgz",
10
+ "integrity": "sha512-wTxufdY8vFvKJ2EmmQKmarrQ7n30kzg+vvqgGib2dawl7c5Wst8dffkEJQpy9Zs99TE/yEEFgj0VUO4GRUO22A=="
11
11
  }
12
12
  }
13
13
  }
@@ -7,7 +7,7 @@
7
7
  "lib": "lib"
8
8
  },
9
9
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
10
+ "test": "npx node-sass ./vendor/assets/stylesheets/govuk-frontend-rails.scss /tmp/govuk-frontend-rails.css"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -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.2.0"
24
+ "govuk-frontend": "3.6.0"
25
25
  }
26
26
  }
@@ -1497,6 +1497,9 @@ Details.prototype.polyfillHandleInputs = function (node, callback) {
1497
1497
  function CharacterCount ($module) {
1498
1498
  this.$module = $module;
1499
1499
  this.$textarea = $module.querySelector('.govuk-js-character-count');
1500
+ if (this.$textarea) {
1501
+ this.$countMessage = $module.querySelector('[id=' + this.$textarea.id + '-info]');
1502
+ }
1500
1503
  }
1501
1504
 
1502
1505
  CharacterCount.prototype.defaults = {
@@ -1509,10 +1512,16 @@ CharacterCount.prototype.init = function () {
1509
1512
  // Check for module
1510
1513
  var $module = this.$module;
1511
1514
  var $textarea = this.$textarea;
1512
- if (!$textarea) {
1515
+ var $countMessage = this.$countMessage;
1516
+
1517
+ if (!$textarea || !$countMessage) {
1513
1518
  return
1514
1519
  }
1515
1520
 
1521
+ // We move count message right after the field
1522
+ // Kept for backwards compatibility
1523
+ $textarea.insertAdjacentElement('afterend', $countMessage);
1524
+
1516
1525
  // Read options set using dataset ('data-' values)
1517
1526
  this.options = this.getDataset($module);
1518
1527
 
@@ -1530,23 +1539,16 @@ CharacterCount.prototype.init = function () {
1530
1539
  return
1531
1540
  }
1532
1541
 
1533
- // Generate and reference message
1534
- var boundCreateCountMessage = this.createCountMessage.bind(this);
1535
- this.countMessage = boundCreateCountMessage();
1536
-
1537
- // If there's a maximum length defined and the count message exists
1538
- if (this.countMessage) {
1539
- // Remove hard limit if set
1540
- $module.removeAttribute('maxlength');
1542
+ // Remove hard limit if set
1543
+ $module.removeAttribute('maxlength');
1541
1544
 
1542
- // Bind event changes to the textarea
1543
- var boundChangeEvents = this.bindChangeEvents.bind(this);
1544
- boundChangeEvents();
1545
+ // Bind event changes to the textarea
1546
+ var boundChangeEvents = this.bindChangeEvents.bind(this);
1547
+ boundChangeEvents();
1545
1548
 
1546
- // Update count message
1547
- var boundUpdateCountMessage = this.updateCountMessage.bind(this);
1548
- boundUpdateCountMessage();
1549
- }
1549
+ // Update count message
1550
+ var boundUpdateCountMessage = this.updateCountMessage.bind(this);
1551
+ boundUpdateCountMessage();
1550
1552
  };
1551
1553
 
1552
1554
  // Read data attributes
@@ -1577,27 +1579,6 @@ CharacterCount.prototype.count = function (text) {
1577
1579
  return length
1578
1580
  };
1579
1581
 
1580
- // Generate count message and bind it to the input
1581
- // returns reference to the generated element
1582
- CharacterCount.prototype.createCountMessage = function () {
1583
- var countElement = this.$textarea;
1584
- var elementId = countElement.id;
1585
- // Check for existing info count message
1586
- var countMessage = document.getElementById(elementId + '-info');
1587
- // If there is no existing info count message we add one right after the field
1588
- if (elementId && !countMessage) {
1589
- countElement.insertAdjacentHTML('afterend', '<span id="' + elementId + '-info" class="govuk-hint govuk-character-count__message" aria-live="polite"></span>');
1590
- this.describedBy = countElement.getAttribute('aria-describedby');
1591
- this.describedByInfo = this.describedBy + ' ' + elementId + '-info';
1592
- countElement.setAttribute('aria-describedby', this.describedByInfo);
1593
- countMessage = document.getElementById(elementId + '-info');
1594
- } else {
1595
- // If there is an existing info count message we move it right after the field
1596
- countElement.insertAdjacentElement('afterend', countMessage);
1597
- }
1598
- return countMessage
1599
- };
1600
-
1601
1582
  // Bind input propertychange to the elements and update based on the change
1602
1583
  CharacterCount.prototype.bindChangeEvents = function () {
1603
1584
  var $textarea = this.$textarea;
@@ -1624,7 +1605,7 @@ CharacterCount.prototype.checkIfValueChanged = function () {
1624
1605
  CharacterCount.prototype.updateCountMessage = function () {
1625
1606
  var countElement = this.$textarea;
1626
1607
  var options = this.options;
1627
- var countMessage = this.countMessage;
1608
+ var countMessage = this.$countMessage;
1628
1609
 
1629
1610
  // Determine the remaining number of characters/words
1630
1611
  var currentLength = this.count(countElement.value);
@@ -1767,7 +1748,7 @@ Checkboxes.prototype.handleClick = function (event) {
1767
1748
 
1768
1749
  if (detect) return
1769
1750
 
1770
- // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-service/1f3c09b402f65bf6e393f933a15ba63f1b86ef1f/packages/polyfill-library/polyfills/Element/prototype/closest/polyfill.js
1751
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-service/1f3c09b402f65bf6e393f933a15ba63f1b86ef1f/packages/polyfill-library/polyfills/Element/prototype/closest/polyfill.js
1771
1752
  Element.prototype.closest = function closest(selector) {
1772
1753
  var node = this;
1773
1754
 
@@ -1873,7 +1854,9 @@ ErrorSummary.prototype.getFragmentFromUrl = function (url) {
1873
1854
  *
1874
1855
  * Returns the first element that exists from this list:
1875
1856
  *
1876
- * - The `<legend>` associated with the closest `<fieldset>` ancestor
1857
+ * - The `<legend>` associated with the closest `<fieldset>` ancestor, as long
1858
+ * as the top of it is no more than half a viewport height away from the
1859
+ * bottom of the input
1877
1860
  * - The first `<label>` that is associated with the input using for="inputId"
1878
1861
  * - The closest parent `<label>`
1879
1862
  *
@@ -1888,7 +1871,32 @@ ErrorSummary.prototype.getAssociatedLegendOrLabel = function ($input) {
1888
1871
  var legends = $fieldset.getElementsByTagName('legend');
1889
1872
 
1890
1873
  if (legends.length) {
1891
- return legends[0]
1874
+ var $candidateLegend = legends[0];
1875
+
1876
+ // If the input type is radio or checkbox, always use the legend if there
1877
+ // is one.
1878
+ if ($input.type === 'checkbox' || $input.type === 'radio') {
1879
+ return $candidateLegend
1880
+ }
1881
+
1882
+ // For other input types, only scroll to the fieldset’s legend (instead of
1883
+ // the label associated with the input) if the input would end up in the
1884
+ // top half of the screen.
1885
+ //
1886
+ // This should avoid situations where the input either ends up off the
1887
+ // screen, or obscured by a software keyboard.
1888
+ var legendTop = $candidateLegend.getBoundingClientRect().top;
1889
+ var inputRect = $input.getBoundingClientRect();
1890
+
1891
+ // If the browser doesn't support Element.getBoundingClientRect().height
1892
+ // or window.innerHeight (like IE8), bail and just link to the label.
1893
+ if (inputRect.height && window.innerHeight) {
1894
+ var inputBottom = inputRect.top + inputRect.height;
1895
+
1896
+ if (inputBottom - legendTop < window.innerHeight / 2) {
1897
+ return $candidateLegend
1898
+ }
1899
+ }
1892
1900
  }
1893
1901
  }
1894
1902
 
@@ -2018,49 +2026,41 @@ Radios.prototype.handleClick = function (event) {
2018
2026
 
2019
2027
  (function(undefined) {
2020
2028
 
2021
- // Detection from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-b09a5d2acf3314b46a6c8f8d0c31b85c
2029
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/detect.js
2022
2030
  var detect = (
2023
- 'Element' in this && "nextElementSibling" in document.documentElement
2031
+ 'document' in this && "nextElementSibling" in document.documentElement
2024
2032
  );
2025
2033
 
2026
2034
  if (detect) return
2027
2035
 
2028
-
2029
- (function (global) {
2030
-
2031
- // Polyfill from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-404b69b4750d18dea4174930a49170fd
2032
- Object.defineProperty(Element.prototype, "nextElementSibling", {
2033
- get: function(){
2034
- var el = this.nextSibling;
2035
- while (el && el.nodeType !== 1) { el = el.nextSibling; }
2036
- return (el.nodeType === 1) ? el : null;
2037
- }
2038
- });
2039
-
2040
- }(this));
2036
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/polyfill.js
2037
+ Object.defineProperty(Element.prototype, "nextElementSibling", {
2038
+ get: function(){
2039
+ var el = this.nextSibling;
2040
+ while (el && el.nodeType !== 1) { el = el.nextSibling; }
2041
+ return el;
2042
+ }
2043
+ });
2041
2044
 
2042
2045
  }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
2043
2046
 
2044
2047
  (function(undefined) {
2045
2048
 
2046
- // Detection from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-a162235fbc9c0dd40d4032265f44942e
2049
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/detect.js
2047
2050
  var detect = (
2048
- 'Element' in this && 'previousElementSibling' in document.documentElement
2051
+ 'document' in this && "previousElementSibling" in document.documentElement
2049
2052
  );
2050
2053
 
2051
2054
  if (detect) return
2052
2055
 
2053
- (function (global) {
2054
- // Polyfill from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-b45a1197b842728cb76b624b6ba7d739
2055
- Object.defineProperty(Element.prototype, 'previousElementSibling', {
2056
- get: function(){
2057
- var el = this.previousSibling;
2058
- while (el && el.nodeType !== 1) { el = el.previousSibling; }
2059
- return (el.nodeType === 1) ? el : null;
2060
- }
2061
- });
2062
-
2063
- }(this));
2056
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/polyfill.js
2057
+ Object.defineProperty(Element.prototype, 'previousElementSibling', {
2058
+ get: function(){
2059
+ var el = this.previousSibling;
2060
+ while (el && el.nodeType !== 1) { el = el.previousSibling; }
2061
+ return el;
2062
+ }
2063
+ });
2064
2064
 
2065
2065
  }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
2066
2066
 
@@ -17,7 +17,10 @@
17
17
 
18
18
  // Allow space for the arrow
19
19
  padding-left: 14px;
20
+ }
20
21
 
22
+ // Only add a custom underline if the component is linkable
23
+ .govuk-back-link[href] {
21
24
  // Use border-bottom rather than text-decoration so that the arrow is
22
25
  // underlined as well.
23
26
  border-bottom: 1px solid govuk-colour("black");
@@ -30,22 +33,22 @@
30
33
  &:focus {
31
34
  border-bottom-color: transparent;
32
35
  }
36
+ }
33
37
 
34
- // Prepend left pointing arrow
35
- &:before {
36
- @include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
38
+ // Prepend left pointing arrow
39
+ .govuk-back-link:before {
40
+ @include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
37
41
 
38
- content: "";
42
+ content: "";
39
43
 
40
- // Vertically align with the parent element
41
- position: absolute;
44
+ // Vertically align with the parent element
45
+ position: absolute;
42
46
 
43
- top: 0;
44
- bottom: 0;
45
- left: 0;
47
+ top: 0;
48
+ bottom: 0;
49
+ left: 0;
46
50
 
47
- margin: auto;
48
- }
51
+ margin: auto;
49
52
  }
50
53
 
51
54
  @if $govuk-use-legacy-font {
@@ -243,8 +243,6 @@
243
243
 
244
244
  display: -webkit-inline-box;
245
245
 
246
- display: -webkit-inline-flex;
247
-
248
246
  display: -ms-inline-flexbox;
249
247
 
250
248
  display: inline-flex;
@@ -252,8 +250,6 @@
252
250
 
253
251
  -webkit-box-pack: center;
254
252
 
255
- -webkit-justify-content: center;
256
-
257
253
  -ms-flex-pack: center;
258
254
 
259
255
  justify-content: center;
@@ -266,12 +262,10 @@
266
262
  margin-left: govuk-spacing(2);
267
263
  }
268
264
  vertical-align: middle;
269
- -webkit-flex-shrink: 0;
270
- -ms-flex-negative: 0;
271
- flex-shrink: 0;
272
- -webkit-align-self: center;
273
- -ms-flex-item-align: center;
274
- align-self: center;
265
+ -ms-flex-negative: 0;
266
+ flex-shrink: 0;
267
+ -ms-flex-item-align: center;
268
+ align-self: center;
275
269
  }
276
270
 
277
271
  @if $govuk-use-legacy-font {
@@ -77,19 +77,6 @@
77
77
  }
78
78
  }
79
79
 
80
- // Internet Explorer 8 does not support `:not()` selectors, so don't conditionally show underlines.
81
- @include govuk-not-ie8 {
82
- .govuk-footer__inline-list .govuk-footer__link,
83
- .govuk-footer__list .govuk-footer__link {
84
- text-decoration: none;
85
-
86
- &:hover:not(:focus),
87
- &:active:not(:focus) {
88
- text-decoration: underline;
89
- }
90
- }
91
- }
92
-
93
80
  .govuk-footer__section-break {
94
81
  margin: 0; // Reset `<hr>` default margins
95
82
  @include govuk-responsive-margin(8, "bottom");
@@ -99,20 +86,16 @@
99
86
 
100
87
  .govuk-footer__meta {
101
88
  display: -webkit-box;
102
- display: -webkit-flex;
103
89
  display: -ms-flexbox;
104
90
  display: flex; // Support: Flexbox
105
91
  margin-right: -$govuk-gutter-half;
106
92
  margin-left: -$govuk-gutter-half;
107
- -webkit-flex-wrap: wrap;
108
- -ms-flex-wrap: wrap;
109
- flex-wrap: wrap; // Support: Flexbox
93
+ -ms-flex-wrap: wrap;
94
+ flex-wrap: wrap; // Support: Flexbox
110
95
  -webkit-box-align: end;
111
- -webkit-align-items: flex-end;
112
96
  -ms-flex-align: end;
113
97
  align-items: flex-end; // Support: Flexbox
114
98
  -webkit-box-pack: center;
115
- -webkit-justify-content: center;
116
99
  -ms-flex-pack: center;
117
100
  justify-content: center; // Support: Flexbox
118
101
  }
@@ -125,20 +108,18 @@
125
108
 
126
109
  .govuk-footer__meta-item--grow {
127
110
  -webkit-box-flex: 1;
128
- -webkit-flex: 1;
129
111
  -ms-flex: 1;
130
112
  flex: 1; // Support: Flexbox
131
- @include mq ($until: tablet) {
132
- -webkit-flex-basis: 320px;
133
- -ms-flex-preferred-size: 320px;
134
- flex-basis: 320px; // Support: Flexbox
113
+ @include govuk-media-query ($until: tablet) {
114
+ -ms-flex-preferred-size: 320px;
115
+ flex-basis: 320px; // Support: Flexbox
135
116
  }
136
117
  }
137
118
 
138
119
  .govuk-footer__licence-logo {
139
120
  display: inline-block;
140
121
  margin-right: govuk-spacing(2);
141
- @include mq ($until: desktop) {
122
+ @include govuk-media-query ($until: desktop) {
142
123
  margin-bottom: govuk-spacing(3);
143
124
  }
144
125
  vertical-align: top;
@@ -183,7 +164,7 @@
183
164
  .govuk-footer__heading {
184
165
  @include govuk-responsive-margin(7, "bottom");
185
166
  padding-bottom: govuk-spacing(4);
186
- @include mq ($until: tablet) {
167
+ @include govuk-media-query ($until: tablet) {
187
168
  padding-bottom: govuk-spacing(2);
188
169
  }
189
170
  border-bottom: 1px solid $govuk-footer-border;
@@ -191,14 +172,12 @@
191
172
 
192
173
  .govuk-footer__navigation {
193
174
  display: -webkit-box;
194
- display: -webkit-flex;
195
175
  display: -ms-flexbox;
196
176
  display: flex; // Support: Flexbox
197
177
  margin-right: -$govuk-gutter-half;
198
178
  margin-left: -$govuk-gutter-half;
199
- -webkit-flex-wrap: wrap;
200
- -ms-flex-wrap: wrap;
201
- flex-wrap: wrap; // Support: Flexbox
179
+ -ms-flex-wrap: wrap;
180
+ flex-wrap: wrap; // Support: Flexbox
202
181
  }
203
182
 
204
183
  .govuk-footer__section {
@@ -209,28 +188,24 @@
209
188
  vertical-align: top;
210
189
  // Ensure columns take up equal width (typically one-half:one-half)
211
190
  -webkit-box-flex: 1;
212
- -webkit-flex-grow: 1;
213
191
  -ms-flex-positive: 1;
214
192
  flex-grow: 1; // Support: Flexbox
215
- -webkit-flex-shrink: 1;
216
- -ms-flex-negative: 1;
217
- flex-shrink: 1; // Support: Flexbox
218
- @include mq ($until: desktop) {
193
+ -ms-flex-negative: 1;
194
+ flex-shrink: 1; // Support: Flexbox
195
+ @include govuk-media-query ($until: desktop) {
219
196
  // Make sure columns do not drop below 200px in width
220
197
  // Will typically result in wrapping, and end up in a single column on smaller screens.
221
- -webkit-flex-basis: 200px;
222
- -ms-flex-preferred-size: 200px;
223
- flex-basis: 200px; // Support: Flexbox
198
+ -ms-flex-preferred-size: 200px;
199
+ flex-basis: 200px; // Support: Flexbox
224
200
  }
225
201
  }
226
202
 
227
203
  // If there are only two sections, set the layout to be two-third:one-third on desktop
228
- @include mq ($from: desktop) {
204
+ @include govuk-media-query ($from: desktop) {
229
205
  // We match the first section with `:first-child`.
230
206
  // To ensure the section is one of two, we can count backwards using `:nth-last-child(2)`.
231
207
  .govuk-footer__section:first-child:nth-last-child(2) {
232
208
  -webkit-box-flex: 2;
233
- -webkit-flex-grow: 2;
234
209
  -ms-flex-positive: 2;
235
210
  flex-grow: 2; // Support: Flexbox
236
211
  }
@@ -245,7 +220,7 @@
245
220
  column-gap: $govuk-gutter; // Support: Columns
246
221
  }
247
222
 
248
- @include mq ($from: desktop) {
223
+ @include govuk-media-query ($from: desktop) {
249
224
  .govuk-footer__list--columns-2 {
250
225
  -webkit-column-count: 2;
251
226
  -moz-column-count: 2;
@@ -42,6 +42,7 @@
42
42
  }
43
43
 
44
44
  .govuk-header__logotype {
45
+ display: inline-block;
45
46
  margin-right: govuk-spacing(1);
46
47
  }
47
48
 
@@ -137,7 +138,7 @@
137
138
  @include govuk-responsive-margin(2, "bottom");
138
139
  padding-right: govuk-spacing(8);
139
140
 
140
- @include mq ($from: desktop) {
141
+ @include govuk-media-query ($from: desktop) {
141
142
  width: 33.33%;
142
143
  padding-right: $govuk-gutter-half;
143
144
  float: left;
@@ -146,7 +147,7 @@
146
147
  }
147
148
 
148
149
  .govuk-header__content {
149
- @include mq ($from: desktop) {
150
+ @include govuk-media-query ($from: desktop) {
150
151
  width: 66.66%;
151
152
  padding-left: $govuk-gutter-half;
152
153
  float: left;
@@ -179,7 +180,7 @@
179
180
  margin-left: govuk-spacing(1);
180
181
  }
181
182
 
182
- @include mq ($from: tablet) {
183
+ @include govuk-media-query ($from: tablet) {
183
184
  top: govuk-spacing(3);
184
185
  }
185
186
  }
@@ -201,14 +202,14 @@
201
202
  .js-enabled {
202
203
  .govuk-header__menu-button {
203
204
  display: block;
204
- @include mq ($from: desktop) {
205
+ @include govuk-media-query ($from: desktop) {
205
206
  display: none;
206
207
  }
207
208
  }
208
209
 
209
210
  .govuk-header__navigation {
210
211
  display: none;
211
- @include mq ($from: desktop) {
212
+ @include govuk-media-query ($from: desktop) {
212
213
  display: block;
213
214
  }
214
215
  }
@@ -220,7 +221,7 @@
220
221
 
221
222
 
222
223
  .govuk-header__navigation--end {
223
- @include mq ($from: desktop) {
224
+ @include govuk-media-query ($from: desktop) {
224
225
  margin: 0;
225
226
  padding: govuk-spacing(1) 0;
226
227
  text-align: right;
@@ -235,7 +236,7 @@
235
236
  padding: govuk-spacing(2) 0;
236
237
  border-bottom: 1px solid $govuk-header-nav-item-border-color;
237
238
 
238
- @include mq ($from: desktop) {
239
+ @include govuk-media-query ($from: desktop) {
239
240
  display: inline-block;
240
241
  margin-right: govuk-spacing(3);
241
242
  padding: govuk-spacing(1) 0;
@@ -13,6 +13,9 @@
13
13
  box-sizing: border-box;
14
14
  width: 100%;
15
15
  height: 40px;
16
+ @if $govuk-typography-use-rem {
17
+ height: govuk-px-to-rem(40px);
18
+ }
16
19
  margin-top: 0;
17
20
 
18
21
  padding: govuk-spacing(1);
@@ -148,7 +148,7 @@
148
148
  // =========================================================
149
149
 
150
150
  .govuk-radios--inline {
151
- @include mq ($from: tablet) {
151
+ @include govuk-media-query ($from: tablet) {
152
152
  @include govuk-clearfix;
153
153
 
154
154
  .govuk-radios__item {
@@ -13,6 +13,9 @@
13
13
  box-sizing: border-box; // should this be global?
14
14
  max-width: 100%;
15
15
  height: 40px;
16
+ @if $govuk-typography-use-rem {
17
+ height: govuk-px-to-rem(40px);
18
+ }
16
19
  padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
17
20
  border: $govuk-border-width-form-element solid $govuk-input-border-colour;
18
21
 
@@ -26,6 +26,12 @@
26
26
  &:focus {
27
27
  outline: $govuk-focus-width solid $govuk-focus-colour;
28
28
  background-color: $govuk-focus-colour;
29
+
30
+ // Undo unwanted changes when global styles are enabled
31
+ @if ($govuk-global-styles) {
32
+ box-shadow: none;
33
+ text-decoration: underline;
34
+ }
29
35
  }
30
36
  }
31
37
  }
@@ -38,7 +38,54 @@
38
38
  }
39
39
  }
40
40
 
41
+ // Deprecated. We'll remove this class in a future release. Use `.govuk-tag--grey` instead.
41
42
  .govuk-tag--inactive {
42
43
  background-color: govuk-colour("dark-grey", $legacy: "grey-1");
43
44
  }
45
+
46
+ .govuk-tag--grey {
47
+ color: govuk-shade(govuk-colour("dark-grey", $legacy: "grey-1"), 30);
48
+ background: govuk-tint(govuk-colour("dark-grey", $legacy: "grey-1"), 90);
49
+ }
50
+
51
+ .govuk-tag--purple {
52
+ color: govuk-shade(govuk-colour("purple"), 20);
53
+ background: govuk-tint(govuk-colour("purple"), 80);
54
+ }
55
+
56
+ .govuk-tag--turquoise {
57
+ color: govuk-shade(govuk-colour("turquoise"), 60);
58
+ background: govuk-tint(govuk-colour("turquoise"), 70);
59
+ }
60
+
61
+ .govuk-tag--blue {
62
+ color: govuk-shade(govuk-colour("blue"), 30);
63
+ background: govuk-tint(govuk-colour("blue"), 80);
64
+ }
65
+
66
+ .govuk-tag--yellow {
67
+ color: govuk-shade(govuk-colour("yellow"), 65);
68
+ background: govuk-tint(govuk-colour("yellow"), 75);
69
+ }
70
+
71
+ .govuk-tag--orange {
72
+ color: govuk-shade(govuk-colour("orange"), 55);
73
+ background: govuk-tint(govuk-colour("orange"), 70);
74
+ }
75
+
76
+ .govuk-tag--red {
77
+ color: govuk-shade(govuk-colour("red"), 30);
78
+ background: govuk-tint(govuk-colour("red"), 80);
79
+ }
80
+
81
+ .govuk-tag--pink {
82
+ color: govuk-shade(govuk-colour("pink"), 40);
83
+ background: govuk-tint(govuk-colour("pink"), 80);
84
+ }
85
+
86
+ .govuk-tag--green {
87
+ color: govuk-shade(govuk-colour("green"), 20);
88
+ background: govuk-tint(govuk-colour("green"), 80);
89
+ }
90
+
44
91
  }
@@ -5,9 +5,6 @@
5
5
  @include govuk-exports("govuk/component/warning-text") {
6
6
 
7
7
  .govuk-warning-text {
8
- @include govuk-font($size: 19);
9
- @include govuk-text-colour;
10
-
11
8
  position: relative;
12
9
  @include govuk-responsive-margin(6, "bottom");
13
10
  padding: govuk-spacing(2) 0;
@@ -23,13 +20,15 @@
23
20
  display: inline-block;
24
21
 
25
22
  position: absolute;
26
- top: 50%;
27
23
  left: 0;
28
24
 
29
- min-width: 32px;
25
+ min-width: 29px;
30
26
  min-height: 29px;
31
- margin-top: -20px; // Half the height of the circle (adjusted for NTA)
32
- padding-top: 3px;
27
+ margin-top: -7px;
28
+
29
+ @include govuk-media-query($from: tablet) {
30
+ margin-top: -5px;
31
+ }
33
32
 
34
33
  // When a user customises their colours the background colour will often be removed.
35
34
  // Adding a border to the component keeps it's shape as a circle.
@@ -39,7 +38,7 @@
39
38
  color: govuk-colour("white");
40
39
  background: govuk-colour("black");
41
40
 
42
- font-size: 1.6em;
41
+ font-size: 30px;
43
42
  line-height: 29px;
44
43
 
45
44
  text-align: center;
@@ -53,7 +52,9 @@
53
52
  }
54
53
 
55
54
  .govuk-warning-text__text {
55
+ @include govuk-font($size: 19, $weight: bold);
56
+ @include govuk-text-colour;
56
57
  display: block;
57
- padding-left: 50px;
58
+ padding-left: 45px;
58
59
  }
59
60
  }
@@ -82,16 +82,16 @@
82
82
  @if $breakpoint == null {
83
83
 
84
84
  @if $direction == all {
85
- #{$property}: $breakpoint-value iff($important, !important);
85
+ #{$property}: $breakpoint-value if($important, !important, null);
86
86
  } @else {
87
- #{$property}-#{$direction}: $breakpoint-value iff($important, !important);
87
+ #{$property}-#{$direction}: $breakpoint-value if($important, !important, null);
88
88
  }
89
89
  } @else {
90
90
  @include govuk-media-query($from: $breakpoint) {
91
91
  @if $direction == all {
92
- #{$property}: $breakpoint-value iff($important, !important);
92
+ #{$property}: $breakpoint-value if($important, !important, null);
93
93
  } @else {
94
- #{$property}-#{$direction}: $breakpoint-value iff($important, !important);
94
+ #{$property}-#{$direction}: $breakpoint-value if($important, !important, null);
95
95
  }
96
96
  }
97
97
  }
@@ -53,7 +53,7 @@
53
53
  /// @access public
54
54
 
55
55
  @mixin govuk-typography-weight-regular($important: false) {
56
- font-weight: $govuk-font-weight-regular iff($important, !important);
56
+ font-weight: $govuk-font-weight-regular if($important, !important, null);
57
57
  }
58
58
 
59
59
  /// Bold font weight helper
@@ -63,7 +63,7 @@
63
63
  /// @access public
64
64
 
65
65
  @mixin govuk-typography-weight-bold($important: false) {
66
- font-weight: $govuk-font-weight-bold iff($important, !important);
66
+ font-weight: $govuk-font-weight-bold if($important, !important, null);
67
67
  }
68
68
 
69
69
  /// Convert line-heights specified in pixels into a relative value, unless
@@ -137,9 +137,9 @@
137
137
  // Mark rules as !important if $important is true - this will result in
138
138
  // these variables becoming strings, so this needs to happen *after* they
139
139
  // are used in calculations
140
- $font-size: $font-size iff($important, !important);
141
- $font-size-rem: $font-size-rem iff($important, !important);
142
- $line-height: $line-height iff($important, !important);
140
+ $font-size: $font-size if($important, !important, null);
141
+ $font-size-rem: $font-size-rem if($important, !important, null);
142
+ $line-height: $line-height if($important, !important, null);
143
143
 
144
144
  @if $breakpoint == null {
145
145
  font-size: $font-size; // sass-lint:disable no-duplicate-properties
@@ -14,26 +14,26 @@
14
14
  /// @access public
15
15
 
16
16
  @mixin govuk-visually-hidden($important: true) {
17
- position: absolute iff($important, !important);
17
+ position: absolute if($important, !important, null);
18
18
 
19
- width: 1px iff($important, !important);
20
- height: 1px iff($important, !important);
19
+ width: 1px if($important, !important, null);
20
+ height: 1px if($important, !important, null);
21
21
  // If margin is set to a negative value it can cause text to be announced in
22
22
  // the wrong order in VoiceOver for OSX
23
- margin: 0 iff($important, !important);
24
- padding: 0 iff($important, !important);
23
+ margin: 0 if($important, !important, null);
24
+ padding: 0 if($important, !important, null);
25
25
 
26
- overflow: hidden iff($important, !important);
27
- clip: rect(0 0 0 0) iff($important, !important);
28
- -webkit-clip-path: inset(50%) iff($important, !important);
29
- clip-path: inset(50%) iff($important, !important);
26
+ overflow: hidden if($important, !important, null);
27
+ clip: rect(0 0 0 0) if($important, !important, null);
28
+ -webkit-clip-path: inset(50%) if($important, !important, null);
29
+ clip-path: inset(50%) if($important, !important, null);
30
30
 
31
- border: 0 iff($important, !important);
31
+ border: 0 if($important, !important, null);
32
32
 
33
33
  // For long content, line feeds are not interpreted as spaces and small width
34
34
  // causes content to wrap 1 word per line:
35
35
  // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
36
- white-space: nowrap iff($important, !important);
36
+ white-space: nowrap if($important, !important, null);
37
37
  }
38
38
 
39
39
  /// Hide an element visually, but have it available for screen readers whilst
@@ -48,37 +48,37 @@
48
48
  /// @access public
49
49
 
50
50
  @mixin govuk-visually-hidden-focusable($important: true) {
51
- position: absolute iff($important, !important);
51
+ position: absolute if($important, !important, null);
52
52
 
53
- width: 1px iff($important, !important);
54
- height: 1px iff($important, !important);
53
+ width: 1px if($important, !important, null);
54
+ height: 1px if($important, !important, null);
55
55
  // If margin is set to a negative value it can cause text to be announced in
56
56
  // the wrong order in VoiceOver for OSX
57
- margin: 0 iff($important, !important);
57
+ margin: 0 if($important, !important, null);
58
58
 
59
- overflow: hidden iff($important, !important);
60
- clip: rect(0 0 0 0) iff($important, !important);
61
- -webkit-clip-path: inset(50%) iff($important, !important);
62
- clip-path: inset(50%) iff($important, !important);
59
+ overflow: hidden if($important, !important, null);
60
+ clip: rect(0 0 0 0) if($important, !important, null);
61
+ -webkit-clip-path: inset(50%) if($important, !important, null);
62
+ clip-path: inset(50%) if($important, !important, null);
63
63
 
64
64
  // For long content, line feeds are not interpreted as spaces and small width
65
65
  // causes content to wrap 1 word per line:
66
66
  // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
67
- white-space: nowrap iff($important, !important);
67
+ white-space: nowrap if($important, !important, null);
68
68
 
69
69
  &:active,
70
70
  &:focus {
71
- position: static iff($important, !important);
71
+ position: static if($important, !important, null);
72
72
 
73
- width: auto iff($important, !important);
74
- height: auto iff($important, !important);
75
- margin: inherit iff($important, !important);
73
+ width: auto if($important, !important, null);
74
+ height: auto if($important, !important, null);
75
+ margin: inherit if($important, !important, null);
76
76
 
77
- overflow: visible iff($important, !important);
78
- clip: auto iff($important, !important);
79
- -webkit-clip-path: none iff($important, !important);
80
- clip-path: none iff($important, !important);
77
+ overflow: visible if($important, !important, null);
78
+ clip: auto if($important, !important, null);
79
+ -webkit-clip-path: none if($important, !important, null);
80
+ clip-path: none if($important, !important, null);
81
81
 
82
- white-space: inherit iff($important, !important);
82
+ white-space: inherit if($important, !important, null);
83
83
  }
84
84
  }
@@ -2,12 +2,31 @@
2
2
  @import "../tools/all";
3
3
  @import "../helpers/all";
4
4
 
5
- @mixin govuk-width-container {
6
- // Limit the width of the container to the page width
7
- max-width: $govuk-page-width;
5
+ ////
6
+ /// @group objects
7
+ ////
8
+
9
+ /// Width container mixin
10
+ ///
11
+ /// Used to create page width and custom width container classes.
12
+ ///
13
+ /// @param {String} $width [$govuk-page-width] - Width in pixels
14
+ ///
15
+ /// @example scss - Creating a 1200px wide container class
16
+ /// .app-width-container--wide {
17
+ /// @include govuk-width-container(1200px);
18
+ /// }
19
+ ///
20
+ /// @access public
21
+
22
+ @mixin govuk-width-container($width: $govuk-page-width) {
23
+
24
+ // By default, limit the width of the container to the page width
25
+ max-width: $width;
8
26
 
9
27
  // On mobile, add half width gutters
10
- margin: 0 $govuk-gutter-half;
28
+ margin-right: $govuk-gutter-half;
29
+ margin-left: $govuk-gutter-half;
11
30
 
12
31
  // Respect 'display cutout' safe area (avoids notches and rounded corners)
13
32
  @supports (margin: unquote("max(calc(0px))")) {
@@ -22,7 +41,8 @@
22
41
 
23
42
  // On tablet, add full width gutters
24
43
  @include govuk-media-query($from: tablet) {
25
- margin: 0 $govuk-gutter;
44
+ margin-right: $govuk-gutter;
45
+ margin-left: $govuk-gutter;
26
46
 
27
47
  // Respect 'display cutout' safe area (avoids notches and rounded corners)
28
48
  @supports (margin: unquote("max(calc(0px))")) {
@@ -38,21 +58,24 @@
38
58
 
39
59
  // As soon as the viewport is greater than the width of the page plus the
40
60
  // gutters, just centre the content instead of adding gutters.
41
- @include govuk-media-query($and: "(min-width: #{($govuk-page-width + $govuk-gutter * 2)})") {
42
- margin: 0 auto;
61
+ @include govuk-media-query($and: "(min-width: #{($width + $govuk-gutter * 2)})") {
62
+ margin-right: auto;
63
+ margin-left: auto;
43
64
 
44
65
  // Since a safe area may have previously been set above,
45
66
  // we need to duplicate this margin that centers the page.
46
67
  @supports (margin: unquote("max(calc(0px))")) {
47
- margin: 0 auto;
68
+ margin-right: auto;
69
+ margin-left: auto;
48
70
  }
49
71
  }
50
72
 
51
73
  @include govuk-if-ie8 {
52
- width: $govuk-page-width;
74
+ width: $width;
53
75
  // Since media queries are not supported in IE8,
54
76
  // we need to duplicate this margin that centers the page.
55
- margin: 0 auto;
77
+ margin-right: auto;
78
+ margin-left: auto;
56
79
  }
57
80
  }
58
81
 
@@ -15,4 +15,14 @@
15
15
  .govuk-\!-display-block {
16
16
  display: block !important;
17
17
  }
18
+
19
+ .govuk-\!-display-none {
20
+ display: none !important;
21
+ }
22
+
23
+ @include govuk-media-query($media-type: print) {
24
+ .govuk-\!-display-none-print {
25
+ display: none !important;
26
+ }
27
+ }
18
28
  }
@@ -70,7 +70,7 @@ $_govuk-colour-palette-modern: (
70
70
  "purple": #4c2c92,
71
71
 
72
72
  "black": #0b0c0c,
73
- "dark-grey": #6f777b,
73
+ "dark-grey": #626a6e,
74
74
  "mid-grey": #b1b4b6,
75
75
  "light-grey": #f3f2f1,
76
76
  "white": #ffffff,
@@ -8,8 +8,10 @@
8
8
  /// @param {Boolean} $condition - Whether to return the value of `$if-true`
9
9
  /// @param {Mixed} $if-true - Value to return if `$condition` is truthy
10
10
  /// @return {Mixed} Value of `$if-true` if `$condition` is truthy, else null
11
- /// @access public
11
+ /// @access private
12
+ /// @deprecated We will be removing this function in a future release, use `if($condition, $if-true, null);` instead.
12
13
 
13
14
  @function iff($condition, $if-true) {
15
+ @warn "The `iff` function will be removed in a future release, use `if($condition, $if-true, null);` instead.";
14
16
  @return if($condition, $if-true, null);
15
17
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxw_govuk_frontend_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mec
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-10-09 00:00:00.000000000 Z
12
+ date: 2020-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '10.0'
34
+ version: '13.0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '10.0'
41
+ version: '13.0'
42
42
  description: Adds the GOVUK frontend to a Rails application that uses the Asset Pipeline.
43
43
  email:
44
44
  executables: []
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".github/workflows/gempush.yml"
49
+ - ".github/workflows/test.yml"
49
50
  - ".gitignore"
50
51
  - CODE_OF_CONDUCT.md
51
52
  - Gemfile
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  - !ruby/object:Gem::Version
185
186
  version: '0'
186
187
  requirements: []
187
- rubygems_version: 3.0.3
188
+ rubygems_version: 3.1.2
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: Adds the GOVUK frontend to a Rails application that uses the Asset Pipeline.