dxw_govuk_frontend_rails 3.3.0 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gempush.yml +2 -2
- data/.github/workflows/test.yml +19 -0
- data/Gemfile.lock +3 -3
- data/dxw_govuk_frontend_rails.gemspec +1 -1
- data/lib/dxw_govuk_frontend_rails.rb +12 -1
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +3 -3
- data/package.json +1 -1
- data/vendor/assets/javascripts/govuk_frontend_rails.js +41 -68
- data/vendor/assets/stylesheets/_base.scss +3 -0
- data/vendor/assets/stylesheets/all.scss +1 -3
- data/vendor/assets/stylesheets/components/_all.scss +31 -29
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -208
- data/vendor/assets/stylesheets/components/accordion/_index.scss +207 -0
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -62
- data/vendor/assets/stylesheets/components/back-link/_index.scss +112 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -118
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +138 -0
- data/vendor/assets/stylesheets/components/button/_button.scss +2 -290
- data/vendor/assets/stylesheets/components/button/_index.scss +280 -0
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -31
- data/vendor/assets/stylesheets/components/character-count/_index.scss +28 -0
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -308
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +304 -0
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -30
- data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
- data/vendor/assets/stylesheets/components/details/_details.scss +2 -88
- data/vendor/assets/stylesheets/components/details/_index.scss +84 -0
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -15
- data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -59
- data/vendor/assets/stylesheets/components/error-summary/_index.scss +55 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -68
- data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -81
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +77 -0
- data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -269
- data/vendor/assets/stylesheets/components/footer/_index.scss +238 -0
- data/vendor/assets/stylesheets/components/header/_header.scss +2 -318
- data/vendor/assets/stylesheets/components/header/_index.scss +312 -0
- data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -50
- data/vendor/assets/stylesheets/components/hint/_index.scss +46 -0
- data/vendor/assets/stylesheets/components/input/_index.scss +99 -0
- data/vendor/assets/stylesheets/components/input/_input.scss +2 -103
- data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -28
- data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
- data/vendor/assets/stylesheets/components/label/_label.scss +2 -45
- data/vendor/assets/stylesheets/components/panel/_index.scss +40 -0
- data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -44
- data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -31
- data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
- data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -346
- data/vendor/assets/stylesheets/components/select/_index.scss +53 -0
- data/vendor/assets/stylesheets/components/select/_select.scss +2 -57
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +33 -0
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -31
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +153 -0
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -157
- data/vendor/assets/stylesheets/components/table/_index.scss +50 -0
- data/vendor/assets/stylesheets/components/table/_table.scss +2 -54
- data/vendor/assets/stylesheets/components/tabs/_index.scss +138 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -142
- data/vendor/assets/stylesheets/components/tag/_index.scss +87 -0
- data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -44
- data/vendor/assets/stylesheets/components/textarea/_index.scss +51 -0
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -55
- data/vendor/assets/stylesheets/components/warning-text/_index.scss +56 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -60
- data/vendor/assets/stylesheets/core/_global-styles.scss +5 -3
- data/vendor/assets/stylesheets/core/_links.scss +5 -3
- data/vendor/assets/stylesheets/core/_lists.scss +17 -3
- data/vendor/assets/stylesheets/core/_section-break.scss +5 -3
- data/vendor/assets/stylesheets/core/_template.scss +5 -3
- data/vendor/assets/stylesheets/core/_typography.scss +5 -3
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_focused.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_grid.scss +2 -1
- data/vendor/assets/stylesheets/helpers/_links.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +1 -1
- data/vendor/assets/stylesheets/helpers/_spacing.scss +5 -5
- data/vendor/assets/stylesheets/helpers/_typography.scss +6 -6
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +30 -30
- data/vendor/assets/stylesheets/objects/_form-group.scss +1 -3
- data/vendor/assets/stylesheets/objects/_grid.scss +1 -3
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +5 -3
- data/vendor/assets/stylesheets/objects/_width-container.scss +34 -13
- data/vendor/assets/stylesheets/overrides/_display.scss +11 -3
- data/vendor/assets/stylesheets/overrides/_spacing.scss +5 -3
- data/vendor/assets/stylesheets/overrides/_typography.scss +5 -3
- data/vendor/assets/stylesheets/overrides/_width.scss +5 -3
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +1 -1
- data/vendor/assets/stylesheets/settings/_ie8.scss +1 -1
- data/vendor/assets/stylesheets/tools/_compatibility.scss +1 -1
- data/vendor/assets/stylesheets/tools/_font-url.scss +1 -1
- data/vendor/assets/stylesheets/tools/_ie8.scss +1 -1
- data/vendor/assets/stylesheets/tools/_iff.scss +3 -1
- data/vendor/assets/stylesheets/tools/_image-url.scss +1 -1
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +1 -1
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +1 -1
- metadata +36 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76252356e718d773b335f5c46af4aa74fb1c7d1a7145941c030183ce45043340
|
4
|
+
data.tar.gz: 1a2df5ee7e9080f9975aa76b749074405fed3a6f48062fc9996e0f82dbbf49c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 435fc41bbd556daab6ab8286d78b7c9f7d22166e64b345653e221d01aa035cb478bc566d792d55cb99a335cfdb56b0391764b7566839185c86cffe13765cc86a
|
7
|
+
data.tar.gz: 8ae7e6ca9a70f1c4796f4950dee3b11e4e8dde78be034614a7c95f4fc3eacff6de59b3c31f2d9690cb9e710da920725654a31c319b98eaa2e7ae1c9d850a372f
|
@@ -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
|
+
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dxw_govuk_frontend_rails (3.
|
4
|
+
dxw_govuk_frontend_rails (3.7.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
rake (
|
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 (~>
|
17
|
+
rake (~> 13.0)
|
18
18
|
|
19
19
|
BUNDLED WITH
|
20
20
|
2.0.2
|
@@ -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
|
-
|
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
|
data/package-lock.json
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
"requires": true,
|
6
6
|
"dependencies": {
|
7
7
|
"govuk-frontend": {
|
8
|
-
"version": "3.
|
9
|
-
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.
|
10
|
-
"integrity": "sha512-
|
8
|
+
"version": "3.7.0",
|
9
|
+
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.7.0.tgz",
|
10
|
+
"integrity": "sha512-G3bqoKGGF8YQ18UJH9tTARrwB8i7iPwN1xc8RXwWyx91q0p/Xl10uNywZLkzGWcJDzEz1vwmBTTL3SLDU/KxNg=="
|
11
11
|
}
|
12
12
|
}
|
13
13
|
}
|
data/package.json
CHANGED
@@ -891,7 +891,7 @@ Accordion.prototype.initHeaderAttributes = function ($headerWrapper, index) {
|
|
891
891
|
icon.className = this.iconClass;
|
892
892
|
icon.setAttribute('aria-hidden', 'true');
|
893
893
|
|
894
|
-
$
|
894
|
+
$button.appendChild(icon);
|
895
895
|
};
|
896
896
|
|
897
897
|
// When section toggled, set and store state
|
@@ -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
|
-
|
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
|
-
//
|
1534
|
-
|
1535
|
-
this.countMessage = boundCreateCountMessage();
|
1542
|
+
// Remove hard limit if set
|
1543
|
+
$module.removeAttribute('maxlength');
|
1536
1544
|
|
1537
|
-
//
|
1538
|
-
|
1539
|
-
|
1540
|
-
$module.removeAttribute('maxlength');
|
1545
|
+
// Bind event changes to the textarea
|
1546
|
+
var boundChangeEvents = this.bindChangeEvents.bind(this);
|
1547
|
+
boundChangeEvents();
|
1541
1548
|
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
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
|
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
|
-
|
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
|
|
@@ -2045,49 +2026,41 @@ Radios.prototype.handleClick = function (event) {
|
|
2045
2026
|
|
2046
2027
|
(function(undefined) {
|
2047
2028
|
|
2048
|
-
// Detection from https://
|
2029
|
+
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/detect.js
|
2049
2030
|
var detect = (
|
2050
|
-
'
|
2031
|
+
'document' in this && "nextElementSibling" in document.documentElement
|
2051
2032
|
);
|
2052
2033
|
|
2053
2034
|
if (detect) return
|
2054
2035
|
|
2055
|
-
|
2056
|
-
(
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
return (el.nodeType === 1) ? el : null;
|
2064
|
-
}
|
2065
|
-
});
|
2066
|
-
|
2067
|
-
}(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
|
+
});
|
2068
2044
|
|
2069
2045
|
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
2070
2046
|
|
2071
2047
|
(function(undefined) {
|
2072
2048
|
|
2073
|
-
// Detection from https://
|
2049
|
+
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/detect.js
|
2074
2050
|
var detect = (
|
2075
|
-
'
|
2051
|
+
'document' in this && "previousElementSibling" in document.documentElement
|
2076
2052
|
);
|
2077
2053
|
|
2078
2054
|
if (detect) return
|
2079
2055
|
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
});
|
2089
|
-
|
2090
|
-
}(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
|
+
});
|
2091
2064
|
|
2092
2065
|
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
2093
2066
|
|
@@ -1,29 +1,31 @@
|
|
1
|
-
@import "
|
2
|
-
|
3
|
-
@import "
|
4
|
-
@import "
|
5
|
-
@import "
|
6
|
-
@import "
|
7
|
-
@import "
|
8
|
-
@import "
|
9
|
-
@import "
|
10
|
-
@import "
|
11
|
-
@import "
|
12
|
-
@import "
|
13
|
-
@import "
|
14
|
-
@import "
|
15
|
-
@import "
|
16
|
-
@import "
|
17
|
-
@import "
|
18
|
-
@import "
|
19
|
-
@import "
|
20
|
-
@import "
|
21
|
-
@import "
|
22
|
-
@import "
|
23
|
-
@import "
|
24
|
-
@import "
|
25
|
-
@import "
|
26
|
-
@import "
|
27
|
-
@import "
|
28
|
-
@import "
|
29
|
-
@import "
|
1
|
+
@import "../base";
|
2
|
+
|
3
|
+
@import "accordion/index";
|
4
|
+
@import "back-link/index";
|
5
|
+
@import "breadcrumbs/index";
|
6
|
+
@import "button/index";
|
7
|
+
@import "checkboxes/index";
|
8
|
+
@import "character-count/index";
|
9
|
+
@import "summary-list/index";
|
10
|
+
@import "date-input/index";
|
11
|
+
@import "details/index";
|
12
|
+
@import "error-message/index";
|
13
|
+
@import "error-summary/index";
|
14
|
+
@import "fieldset/index";
|
15
|
+
@import "file-upload/index";
|
16
|
+
@import "footer/index";
|
17
|
+
@import "hint/index";
|
18
|
+
@import "header/index";
|
19
|
+
@import "input/index";
|
20
|
+
@import "inset-text/index";
|
21
|
+
@import "label/index";
|
22
|
+
@import "panel/index";
|
23
|
+
@import "phase-banner/index";
|
24
|
+
@import "tabs/index";
|
25
|
+
@import "tag/index";
|
26
|
+
@import "radios/index";
|
27
|
+
@import "select/index";
|
28
|
+
@import "skip-link/index";
|
29
|
+
@import "table/index";
|
30
|
+
@import "textarea/index";
|
31
|
+
@import "warning-text/index";
|
@@ -1,208 +1,2 @@
|
|
1
|
-
@import "../../
|
2
|
-
@import "
|
3
|
-
@import "../../helpers/all";
|
4
|
-
|
5
|
-
|
6
|
-
@include govuk-exports("govuk/component/accordion") {
|
7
|
-
|
8
|
-
$govuk-accordion-link-colour: $govuk-link-colour;
|
9
|
-
$govuk-accordion-link-hover-colour: govuk-colour("light-blue");
|
10
|
-
$govuk-accordion-border-width: 3px;
|
11
|
-
|
12
|
-
.govuk-accordion {
|
13
|
-
@include govuk-responsive-margin(6, "bottom");
|
14
|
-
}
|
15
|
-
|
16
|
-
// Borders between accordion sections
|
17
|
-
.govuk-accordion__section {
|
18
|
-
padding-top: govuk-spacing(3);
|
19
|
-
}
|
20
|
-
|
21
|
-
.govuk-accordion__section-header {
|
22
|
-
padding-top: govuk-spacing(3);
|
23
|
-
padding-bottom: govuk-spacing(3);
|
24
|
-
}
|
25
|
-
|
26
|
-
.govuk-accordion__section-heading {
|
27
|
-
margin-top: 0; // Override browser default
|
28
|
-
margin-bottom: 0; // Override browser default
|
29
|
-
}
|
30
|
-
|
31
|
-
// Buttons within the sections don’t need default styling
|
32
|
-
.govuk-accordion__section-button {
|
33
|
-
@include govuk-font($size: 24, $weight: bold);
|
34
|
-
display: inline-block;
|
35
|
-
margin-bottom: 0;
|
36
|
-
padding-top: govuk-spacing(3);
|
37
|
-
}
|
38
|
-
|
39
|
-
.govuk-accordion__section-summary {
|
40
|
-
margin-top: govuk-spacing(2);
|
41
|
-
margin-bottom: 0;
|
42
|
-
}
|
43
|
-
|
44
|
-
// Remove the bottom margin from the last item inside the content
|
45
|
-
.govuk-accordion__section-content > :last-child {
|
46
|
-
margin-bottom: 0;
|
47
|
-
}
|
48
|
-
|
49
|
-
// JavaScript enabled
|
50
|
-
.js-enabled {
|
51
|
-
|
52
|
-
.govuk-accordion {
|
53
|
-
// Border at the bottom of the whole accordion
|
54
|
-
border-bottom: 1px solid $govuk-border-colour;
|
55
|
-
}
|
56
|
-
|
57
|
-
// Borders between accordion sections
|
58
|
-
.govuk-accordion__section {
|
59
|
-
padding-top: 0;
|
60
|
-
}
|
61
|
-
|
62
|
-
// Hide the body of collapsed sections
|
63
|
-
.govuk-accordion__section-content {
|
64
|
-
display: none;
|
65
|
-
@include govuk-responsive-padding(3, "top");
|
66
|
-
@include govuk-responsive-padding(3, "bottom");
|
67
|
-
}
|
68
|
-
|
69
|
-
// Show the body of expanded sections
|
70
|
-
.govuk-accordion__section--expanded .govuk-accordion__section-content {
|
71
|
-
display: block;
|
72
|
-
}
|
73
|
-
|
74
|
-
// This is styled to look like a link not a button
|
75
|
-
.govuk-accordion__open-all {
|
76
|
-
@include govuk-font($size: 16);
|
77
|
-
position: relative;
|
78
|
-
z-index: 1;
|
79
|
-
margin: 0;
|
80
|
-
padding: 0;
|
81
|
-
border-width: 0;
|
82
|
-
color: $govuk-link-colour;
|
83
|
-
background: none;
|
84
|
-
cursor: pointer;
|
85
|
-
-webkit-appearance: none;
|
86
|
-
|
87
|
-
@include govuk-link-common;
|
88
|
-
@include govuk-link-style-default;
|
89
|
-
|
90
|
-
// Remove default button focus outline in Firefox
|
91
|
-
&::-moz-focus-inner {
|
92
|
-
padding: 0;
|
93
|
-
border: 0;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
// Section headers have a pointer cursor as an additional affordance
|
98
|
-
.govuk-accordion__section-header {
|
99
|
-
position: relative;
|
100
|
-
// Safe area on the right to avoid clashing with icon
|
101
|
-
padding-right: 40px;
|
102
|
-
border-top: 1px solid $govuk-border-colour;
|
103
|
-
color: $govuk-accordion-link-colour;
|
104
|
-
cursor: pointer;
|
105
|
-
}
|
106
|
-
|
107
|
-
// For devices that can't hover such as touch devices,
|
108
|
-
// remove hover state as it can be stuck in that state (iOS).
|
109
|
-
@media (hover: none) {
|
110
|
-
.govuk-accordion__section-header:hover {
|
111
|
-
border-top-color: $govuk-accordion-link-colour;
|
112
|
-
box-shadow: inset 0 $govuk-accordion-border-width 0 0 $govuk-accordion-link-colour;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
|
116
|
-
// Buttons within the headers don’t need default styling
|
117
|
-
.govuk-accordion__section-button {
|
118
|
-
@include govuk-typography-common;
|
119
|
-
margin-top: 0;
|
120
|
-
margin-bottom: 0;
|
121
|
-
margin-left: 0;
|
122
|
-
padding: 0;
|
123
|
-
border-width: 0;
|
124
|
-
color: inherit;
|
125
|
-
background: none;
|
126
|
-
text-align: left;
|
127
|
-
cursor: pointer;
|
128
|
-
-webkit-appearance: none;
|
129
|
-
|
130
|
-
&:focus {
|
131
|
-
@include govuk-focused-text;
|
132
|
-
}
|
133
|
-
|
134
|
-
// Remove default button focus outline in Firefox
|
135
|
-
&::-moz-focus-inner {
|
136
|
-
padding: 0;
|
137
|
-
border: 0;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
// Extend the touch area of the button to span the section header
|
142
|
-
.govuk-accordion__section-button:after {
|
143
|
-
content: "";
|
144
|
-
position: absolute;
|
145
|
-
top: 0;
|
146
|
-
right: 0;
|
147
|
-
bottom: 0;
|
148
|
-
left: 0;
|
149
|
-
}
|
150
|
-
|
151
|
-
.govuk-accordion__section-button:hover:not(:focus) {
|
152
|
-
text-decoration: underline;
|
153
|
-
}
|
154
|
-
|
155
|
-
// For devices that can't hover such as touch devices,
|
156
|
-
// remove hover state as it can be stuck in that state (iOS).
|
157
|
-
@media (hover: none) {
|
158
|
-
.govuk-accordion__section-button:hover {
|
159
|
-
text-decoration: none;
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
.govuk-accordion__controls {
|
164
|
-
text-align: right;
|
165
|
-
}
|
166
|
-
|
167
|
-
// Display an icon to the right of each header to indicate open/closed status,
|
168
|
-
// and as an additional affordance.
|
169
|
-
.govuk-accordion__icon {
|
170
|
-
position: absolute;
|
171
|
-
top: 50%;
|
172
|
-
right: 15px;
|
173
|
-
width: 16px;
|
174
|
-
height: 16px;
|
175
|
-
margin-top: -8px;
|
176
|
-
}
|
177
|
-
|
178
|
-
.govuk-accordion__icon:after,
|
179
|
-
.govuk-accordion__icon:before {
|
180
|
-
content: "";
|
181
|
-
box-sizing: border-box;
|
182
|
-
position: absolute;
|
183
|
-
top: 0;
|
184
|
-
right: 0;
|
185
|
-
bottom: 0;
|
186
|
-
left: 0;
|
187
|
-
width: 25%;
|
188
|
-
height: 25%;
|
189
|
-
margin: auto;
|
190
|
-
border: 2px solid transparent;
|
191
|
-
background-color: govuk-colour("black");
|
192
|
-
}
|
193
|
-
|
194
|
-
.govuk-accordion__icon:before {
|
195
|
-
width: 100%;
|
196
|
-
}
|
197
|
-
|
198
|
-
.govuk-accordion__icon:after {
|
199
|
-
height: 100%;
|
200
|
-
}
|
201
|
-
|
202
|
-
// Vertical bar should be hidden when section is open, to display a '-' icon
|
203
|
-
.govuk-accordion__section--expanded .govuk-accordion__icon:after {
|
204
|
-
content: " ";
|
205
|
-
display: none;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
}
|
1
|
+
@import "../../base";
|
2
|
+
@import "./index";
|