|
7 | 7 | display: block;
|
8 | 8 | }
|
9 | 9 |
|
10 |
| - .govuk-details__summary { |
11 |
| - // Make the focus outline shrink-wrap the text content of the summary |
12 |
| - display: inline-block; |
13 |
| - |
14 |
| - // Absolutely position the marker against this element |
15 |
| - position: relative; |
| 10 | + .govuk-details__text { |
| 11 | + padding-top: govuk-spacing(3); |
| 12 | + padding-bottom: govuk-spacing(3); |
| 13 | + padding-left: govuk-spacing(4); |
| 14 | + border-left: $govuk-border-width solid $govuk-border-colour; |
| 15 | + } |
16 | 16 |
|
| 17 | + .govuk-details__summary { |
17 | 18 | margin-bottom: govuk-spacing(1);
|
| 19 | + } |
18 | 20 |
|
19 |
| - // Allow for absolutely positioned marker and align with disclosed text |
20 |
| - padding-left: govuk-spacing(4) + $govuk-border-width; |
21 |
| - |
22 |
| - // Style the summary to look like a link... |
23 |
| - color: $govuk-link-colour; |
24 |
| - cursor: pointer; |
25 |
| - |
26 |
| - &:hover { |
27 |
| - color: $govuk-link-hover-colour; |
| 21 | + // Fix for older browsers which: |
| 22 | + // - support ES6 modules but not the <details> element (Edge 16 - 18) |
| 23 | + // - do not support ES6 modules or the <details> element (eg, IE8+) |
| 24 | + // -ms-ime-align is only supported by Edge 12 - 18 |
| 25 | + // Older browsers ignore the entire feature query and use the styles above |
| 26 | + @supports not (-ms-ime-align: auto) { |
| 27 | + .govuk-details__summary { |
| 28 | + // Make the focus outline shrink-wrap the text content of the summary |
| 29 | + display: inline-block; |
| 30 | + |
| 31 | + // Absolutely position the marker against this element |
| 32 | + position: relative; |
| 33 | + |
| 34 | + // Allow for absolutely positioned marker and align with disclosed text |
| 35 | + padding-left: govuk-spacing(4) + $govuk-border-width; |
| 36 | + |
| 37 | + // Style the summary to look like a link... |
| 38 | + color: $govuk-link-colour; |
| 39 | + cursor: pointer; |
| 40 | + |
| 41 | + &:hover { |
| 42 | + color: $govuk-link-hover-colour; |
| 43 | + } |
| 44 | + |
| 45 | + &:focus { |
| 46 | + @include govuk-focused-text; |
| 47 | + } |
28 | 48 | }
|
29 |
| - |
30 |
| - &:focus { |
31 |
| - @include govuk-focused-text; |
| 49 | + // ...but only underline the text, not the arrow |
| 50 | + .govuk-details__summary-text { |
| 51 | + @include govuk-link-decoration; |
32 | 52 | }
|
33 |
| - } |
34 |
| - |
35 |
| - // ...but only underline the text, not the arrow |
36 |
| - .govuk-details__summary-text { |
37 |
| - @include govuk-link-decoration; |
38 |
| - } |
39 | 53 |
|
40 |
| - .govuk-details__summary:hover .govuk-details__summary-text { |
41 |
| - @include govuk-link-hover-decoration; |
42 |
| - } |
| 54 | + .govuk-details__summary:hover .govuk-details__summary-text { |
| 55 | + @include govuk-link-hover-decoration; |
| 56 | + } |
43 | 57 |
|
44 |
| - // Remove the underline when focussed to avoid duplicate borders |
45 |
| - .govuk-details__summary:focus .govuk-details__summary-text { |
46 |
| - text-decoration: none; |
47 |
| - } |
| 58 | + // Remove the underline when focussed to avoid duplicate borders |
| 59 | + .govuk-details__summary:focus .govuk-details__summary-text { |
| 60 | + text-decoration: none; |
| 61 | + } |
48 | 62 |
|
49 |
| - // Remove the default details marker so we can style our own consistently and |
50 |
| - // ensure it displays in Firefox (see implementation.md for details) |
51 |
| - .govuk-details__summary::-webkit-details-marker { |
52 |
| - display: none; |
53 |
| - } |
| 63 | + // Remove the default details marker so we can style our own consistently and |
| 64 | + // ensure it displays in Firefox (see implementation.md for details) |
| 65 | + .govuk-details__summary::-webkit-details-marker { |
| 66 | + display: none; |
| 67 | + } |
54 | 68 |
|
55 |
| - // Append our own open / closed marker using a pseudo-element |
56 |
| - .govuk-details__summary::before { |
57 |
| - content: ""; |
58 |
| - position: absolute; |
| 69 | + // Append our own open / closed marker using a pseudo-element |
| 70 | + .govuk-details__summary::before { |
| 71 | + content: ""; |
| 72 | + position: absolute; |
59 | 73 |
|
60 |
| - top: -1px; |
61 |
| - bottom: 0; |
62 |
| - left: 0; |
| 74 | + top: -1px; |
| 75 | + bottom: 0; |
| 76 | + left: 0; |
63 | 77 |
|
64 |
| - margin: auto; |
| 78 | + margin: auto; |
65 | 79 |
|
66 |
| - @include govuk-shape-arrow($direction: right, $base: 14px); |
| 80 | + @include govuk-shape-arrow($direction: right, $base: 14px); |
67 | 81 |
|
68 |
| - .govuk-details[open] > & { |
69 |
| - @include govuk-shape-arrow($direction: down, $base: 14px); |
| 82 | + .govuk-details[open] > & { |
| 83 | + @include govuk-shape-arrow($direction: down, $base: 14px); |
| 84 | + } |
70 | 85 | }
|
71 |
| - } |
72 |
| - |
73 |
| - .govuk-details__text { |
74 |
| - padding-top: govuk-spacing(3); |
75 |
| - padding-bottom: govuk-spacing(3); |
76 |
| - padding-left: govuk-spacing(4); |
77 |
| - border-left: $govuk-border-width solid $govuk-border-colour; |
78 |
| - } |
79 | 86 |
|
80 |
| - .govuk-details__text p { |
81 |
| - margin-top: 0; |
82 |
| - margin-bottom: govuk-spacing(4); |
83 |
| - } |
| 87 | + .govuk-details__text p { |
| 88 | + margin-top: 0; |
| 89 | + margin-bottom: govuk-spacing(4); |
| 90 | + } |
84 | 91 |
|
85 |
| - .govuk-details__text > :last-child { |
86 |
| - margin-bottom: 0; |
| 92 | + .govuk-details__text > :last-child { |
| 93 | + margin-bottom: 0; |
| 94 | + } |
87 | 95 | }
|
88 | 96 | }
|
0 commit comments