katalyst-govuk-formbuilder 1.10.2 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/builds/katalyst/govuk/formbuilder.css +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +35 -31
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +6 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +16 -13
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +1 -2
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -5
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +8 -9
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -4
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +24 -37
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +13 -9
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +12 -9
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +0 -8
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +162 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +6 -4
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +11 -8
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +12 -10
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +44 -8
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +17 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +30 -62
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +235 -9
- metadata +5 -3
@@ -4,30 +4,33 @@
|
|
4
4
|
@include govuk-exports("govuk/component/password-input") {
|
5
5
|
.govuk-password-input__wrapper {
|
6
6
|
// This element inherits styles from .govuk-input__wrapper, including:
|
7
|
-
// - being display: block with contents in a stacked column below the mobile
|
7
|
+
// - being display: block with contents in a stacked column below the mobile
|
8
|
+
// breakpoint
|
8
9
|
// - being display: flex above the mobile breakpoint
|
9
10
|
|
10
11
|
@include govuk-media-query($from: mobile) {
|
11
12
|
flex-direction: row;
|
12
13
|
|
13
|
-
// The default of `stretch` makes the toggle button appear taller than the
|
14
|
-
// box-shadow, which we don't particularly want in
|
14
|
+
// The default of `stretch` makes the toggle button appear taller than the
|
15
|
+
// input, due to using box-shadow, which we don't particularly want in
|
16
|
+
// this situation
|
15
17
|
align-items: flex-start;
|
16
18
|
}
|
17
19
|
}
|
18
20
|
|
19
21
|
.govuk-password-input__input {
|
20
|
-
// IE 11 and Microsoft Edge comes with its own password reveal function. We
|
21
|
-
// so that there aren't two controls presented to the user
|
22
|
-
// sync with one another. This doesn't
|
23
|
-
//
|
22
|
+
// IE 11 and Microsoft Edge comes with its own password reveal function. We
|
23
|
+
// want to hide it, so that there aren't two controls presented to the user
|
24
|
+
// that do the same thing but aren't in sync with one another. This doesn't
|
25
|
+
// affect the function that allows Edge users to toggle password visibility
|
26
|
+
// by pressing Alt+F8, which cannot be programmatically disabled.
|
24
27
|
&::-ms-reveal {
|
25
28
|
display: none;
|
26
29
|
}
|
27
30
|
}
|
28
31
|
|
29
32
|
.govuk-password-input__toggle {
|
30
|
-
// Add margin
|
33
|
+
// Add top margin so the button doesn't obscure the input's focus style
|
31
34
|
margin-top: govuk-spacing(1);
|
32
35
|
|
33
36
|
// Remove default margin-bottom from button
|
@@ -39,7 +42,7 @@
|
|
39
42
|
}
|
40
43
|
|
41
44
|
@include govuk-media-query($from: mobile) {
|
42
|
-
// Buttons are normally 100%
|
45
|
+
// Buttons are normally 100% wide on mobile, but we don't want that here
|
43
46
|
width: auto;
|
44
47
|
flex-shrink: 0;
|
45
48
|
flex-basis: 5em;
|
@@ -25,14 +25,6 @@
|
|
25
25
|
margin-right: govuk-spacing(2);
|
26
26
|
}
|
27
27
|
}
|
28
|
-
|
29
|
-
// When forced colour mode is active, for example to provide high contrast,
|
30
|
-
// the background colour of the tag is the same as the rest of the page. To ensure
|
31
|
-
// that the tag is perceived as separate to the rest of the text in the phase banner,
|
32
|
-
// it is made bold.
|
33
|
-
@media screen and (forced-colors: active) {
|
34
|
-
font-weight: bold;
|
35
|
-
}
|
36
28
|
}
|
37
29
|
|
38
30
|
.govuk-phase-banner__text {
|
@@ -9,8 +9,9 @@
|
|
9
9
|
$govuk-touch-target-size: ($govuk-radios-size + $govuk-touch-target-gutter);
|
10
10
|
$govuk-small-radios-size: 24px;
|
11
11
|
$govuk-radios-label-padding-left-right: govuk-spacing(3);
|
12
|
-
// When the default focus width is used on a curved edge it looks visually
|
13
|
-
// So for the circular radios we bump the default to make it look
|
12
|
+
// When the default focus width is used on a curved edge it looks visually
|
13
|
+
// smaller. So for the circular radios we bump the default to make it look
|
14
|
+
// visually consistent.
|
14
15
|
$govuk-radios-focus-width: $govuk-focus-width + 1px;
|
15
16
|
|
16
17
|
.govuk-radios__item {
|
@@ -173,10 +174,11 @@
|
|
173
174
|
// =========================================================
|
174
175
|
|
175
176
|
// The narrow border is used in the conditional reveals because the border has
|
176
|
-
// to be an even number in order to be centred under the 40px checkbox
|
177
|
+
// to be an even number in order to be centred under the 40px checkbox radio.
|
177
178
|
$conditional-border-width: $govuk-border-width-narrow;
|
178
|
-
// Calculate the amount of padding needed to keep the border centered against
|
179
|
-
|
179
|
+
// Calculate the amount of padding needed to keep the border centered against
|
180
|
+
// the radios.
|
181
|
+
$conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);
|
180
182
|
// Move the border centered with the radios
|
181
183
|
$conditional-margin-left: $conditional-border-padding;
|
182
184
|
// Move the contents of the conditional inline with the label
|
@@ -6,16 +6,16 @@
|
|
6
6
|
.govuk-select {
|
7
7
|
@include govuk-font($size: 19, $line-height: 1.25);
|
8
8
|
|
9
|
-
box-sizing: border-box;
|
9
|
+
box-sizing: border-box;
|
10
10
|
|
11
11
|
// This min-width was chosen because:
|
12
|
-
// - it makes the Select
|
12
|
+
// - it makes the Select wider than it is tall (which is what users expect)
|
13
13
|
// - 11.5em matches the 'length-10' variant of the input component
|
14
14
|
// - it fits comfortably on screens as narrow as 240px wide
|
15
15
|
min-width: 11.5em;
|
16
16
|
max-width: 100%;
|
17
17
|
height: govuk-px-to-rem(40px);
|
18
|
-
padding: govuk-spacing(1);
|
18
|
+
padding: govuk-spacing(1);
|
19
19
|
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
20
20
|
|
21
21
|
// Default user agent colours for selects can have low contrast,
|
@@ -28,8 +28,8 @@
|
|
28
28
|
// Ensure outline appears outside of the element
|
29
29
|
outline-offset: 0;
|
30
30
|
// Double the border by adding its width again. Use `box-shadow` to do
|
31
|
-
// this instead of changing `border-width` (which changes element size)
|
32
|
-
// since `outline` is already used for the yellow focus state.
|
31
|
+
// this instead of changing `border-width` (which changes element size)
|
32
|
+
// and since `outline` is already used for the yellow focus state.
|
33
33
|
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
34
34
|
}
|
35
35
|
|
@@ -0,0 +1,162 @@
|
|
1
|
+
@include govuk-exports("govuk/component/service-navigation") {
|
2
|
+
$govuk-service-navigation-active-link-border-width: govuk-spacing(1);
|
3
|
+
$govuk-service-navigation-background: $govuk-canvas-background-colour;
|
4
|
+
$govuk-service-navigation-border-colour: $govuk-border-colour;
|
5
|
+
|
6
|
+
// We make the link colour a little darker than normal here so that it has
|
7
|
+
// better perceptual contrast with the navigation background.
|
8
|
+
$govuk-service-navigation-link-colour: govuk-shade($govuk-link-colour, 10%);
|
9
|
+
|
10
|
+
.govuk-service-navigation {
|
11
|
+
border-bottom: 1px solid $govuk-service-navigation-border-colour;
|
12
|
+
background-color: $govuk-service-navigation-background;
|
13
|
+
}
|
14
|
+
|
15
|
+
.govuk-service-navigation__container {
|
16
|
+
display: flex;
|
17
|
+
flex-direction: column;
|
18
|
+
align-items: start;
|
19
|
+
|
20
|
+
@include govuk-media-query($from: tablet) {
|
21
|
+
flex-direction: row;
|
22
|
+
flex-wrap: wrap;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
// These styles are shared between nav items and the service name, they
|
27
|
+
// ensure that both of them remain vertically aligned with one another
|
28
|
+
.govuk-service-navigation__item,
|
29
|
+
.govuk-service-navigation__service-name {
|
30
|
+
position: relative;
|
31
|
+
margin: govuk-spacing(2) 0;
|
32
|
+
border: 0 solid $govuk-service-navigation-link-colour;
|
33
|
+
|
34
|
+
@include govuk-media-query($from: tablet) {
|
35
|
+
margin-top: 0;
|
36
|
+
margin-bottom: 0;
|
37
|
+
padding: govuk-spacing(4) 0;
|
38
|
+
|
39
|
+
&:not(:last-child) {
|
40
|
+
@include govuk-responsive-margin(6, $direction: right);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
.govuk-service-navigation__item--active {
|
46
|
+
@include govuk-media-query($until: tablet) {
|
47
|
+
// Negative offset the left margin so we can place a current page indicator
|
48
|
+
// to the left without misaligning the list item text.
|
49
|
+
margin-left: ((govuk-spacing(2) + $govuk-service-navigation-active-link-border-width) * -1);
|
50
|
+
padding-left: govuk-spacing(2);
|
51
|
+
border-left-width: $govuk-service-navigation-active-link-border-width;
|
52
|
+
}
|
53
|
+
|
54
|
+
@include govuk-media-query($from: tablet) {
|
55
|
+
padding-bottom: govuk-spacing(4) - $govuk-service-navigation-active-link-border-width;
|
56
|
+
border-bottom-width: $govuk-service-navigation-active-link-border-width;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.govuk-service-navigation__link {
|
61
|
+
@include govuk-link-common;
|
62
|
+
@include govuk-link-style-no-underline;
|
63
|
+
@include govuk-link-style-no-visited-state;
|
64
|
+
|
65
|
+
&:not(:hover):not(:focus) {
|
66
|
+
// We set the colour here as we don't want to override the hover or
|
67
|
+
// focus colours
|
68
|
+
color: $govuk-service-navigation-link-colour;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
//
|
73
|
+
// Service name specific code
|
74
|
+
//
|
75
|
+
|
76
|
+
.govuk-service-navigation__service-name {
|
77
|
+
@include govuk-font($size: 19, $weight: bold);
|
78
|
+
}
|
79
|
+
|
80
|
+
// Annoyingly this requires a compound selector in order to overcome the
|
81
|
+
// specificity of the other link colour override we're doing
|
82
|
+
.govuk-service-navigation__service-name .govuk-service-navigation__link {
|
83
|
+
@include govuk-link-style-text;
|
84
|
+
}
|
85
|
+
|
86
|
+
//
|
87
|
+
// Navigation list specific code
|
88
|
+
//
|
89
|
+
|
90
|
+
.govuk-service-navigation__toggle {
|
91
|
+
@include govuk-font($size: 19, $weight: bold);
|
92
|
+
display: inline-flex;
|
93
|
+
margin: 0 0 govuk-spacing(2);
|
94
|
+
padding: 0;
|
95
|
+
border: 0;
|
96
|
+
color: $govuk-service-navigation-link-colour;
|
97
|
+
background: none;
|
98
|
+
word-break: break-all;
|
99
|
+
cursor: pointer;
|
100
|
+
align-items: center;
|
101
|
+
|
102
|
+
&:focus {
|
103
|
+
@include govuk-focused-text;
|
104
|
+
}
|
105
|
+
|
106
|
+
&::after {
|
107
|
+
@include govuk-shape-arrow($direction: down, $base: 10px, $display: inline-block);
|
108
|
+
content: "";
|
109
|
+
margin-left: govuk-spacing(1);
|
110
|
+
}
|
111
|
+
|
112
|
+
&[aria-expanded="true"]::after {
|
113
|
+
@include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
|
114
|
+
}
|
115
|
+
|
116
|
+
// Ensure the button stays hidden if the hidden attribute is present
|
117
|
+
&[hidden] {
|
118
|
+
display: none;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
.govuk-service-navigation__list {
|
123
|
+
@include govuk-font($size: 19);
|
124
|
+
margin: 0;
|
125
|
+
margin-bottom: govuk-spacing(3);
|
126
|
+
padding: 0;
|
127
|
+
list-style: none;
|
128
|
+
|
129
|
+
// Make the navigation list a flexbox. Doing so resolves a couple of
|
130
|
+
// accessibility problems caused by the list items being inline-blocks:
|
131
|
+
// - Removes the extra whitespace from between each list item that screen
|
132
|
+
// readers would pointlessly announce.
|
133
|
+
// - Fixes an NVDA issue in Firefox and Chrome <= 124 where it would read
|
134
|
+
// all of the links as a run-on sentence.
|
135
|
+
@include govuk-media-query($from: tablet) {
|
136
|
+
display: flex;
|
137
|
+
flex-wrap: wrap;
|
138
|
+
margin-bottom: 0;
|
139
|
+
|
140
|
+
// However... IE11 totally trips over flexbox and doesn't wrap anything,
|
141
|
+
// making all of the items into a single, horizontally scrolling row,
|
142
|
+
// which is no good. This CSS hack removes the flexbox definition for
|
143
|
+
// IE 10 & 11, reverting it to the flawed, but OK, non-flexbox version.
|
144
|
+
//
|
145
|
+
// CSS hack taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860
|
146
|
+
// which also includes an explanation of why this works
|
147
|
+
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
148
|
+
display: block;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
// This is a <strong> element that is used as a fallback mechanism for
|
154
|
+
// visually indicating the current page in scenarios where CSS isn't
|
155
|
+
// available. We don't actually want it to be bold normally, so set it to
|
156
|
+
// inherit the parent font-weight.
|
157
|
+
.govuk-service-navigation__active-fallback {
|
158
|
+
font-weight: inherit;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/*# sourceMappingURL=_index.scss.map */
|
@@ -35,11 +35,13 @@
|
|
35
35
|
|
36
36
|
.govuk-skip-link-focused-element {
|
37
37
|
&:focus {
|
38
|
-
// Remove the native visible focus indicator when the element is
|
38
|
+
// Remove the native visible focus indicator when the element is
|
39
|
+
// programmatically focused.
|
39
40
|
//
|
40
|
-
// We set the focus on the linked element (this is usually the <main>
|
41
|
-
// link is activated to improve screen reader
|
42
|
-
//
|
41
|
+
// We set the focus on the linked element (this is usually the <main>
|
42
|
+
// element) when the skip link is activated to improve screen reader
|
43
|
+
// announcements. However, we remove the visible focus indicator from the
|
44
|
+
// linked element because the user cannot interact with it.
|
43
45
|
//
|
44
46
|
// A related discussion: https://github.com/w3c/wcag/issues/1001
|
45
47
|
outline: none;
|
@@ -179,7 +179,8 @@
|
|
179
179
|
.govuk-summary-card__title-wrapper {
|
180
180
|
padding: govuk-spacing(3);
|
181
181
|
|
182
|
-
// Ensures the card header appears separate to the summary list in forced
|
182
|
+
// Ensures the card header appears separate to the summary list in forced
|
183
|
+
// colours mode
|
183
184
|
border-bottom: 1px solid transparent;
|
184
185
|
background-color: govuk-colour("light-grey");
|
185
186
|
|
@@ -12,11 +12,12 @@
|
|
12
12
|
// where to break off of.
|
13
13
|
max-width: $govuk-tag-max-width;
|
14
14
|
|
15
|
-
// These negative margins make sure that the tag component doesn’t increase
|
16
|
-
// size of its container. Otherwise, for example, a table row containing
|
17
|
-
// will be taller than one containing plain text.
|
15
|
+
// These negative margins make sure that the tag component doesn’t increase
|
16
|
+
// the size of its container. Otherwise, for example, a table row containing
|
17
|
+
// a tag will be taller than one containing plain text.
|
18
18
|
//
|
19
|
-
// The negative margin added to the top and bottom matches the extra padding
|
19
|
+
// The negative margin added to the top and bottom matches the extra padding
|
20
|
+
// added.
|
20
21
|
margin-top: -2px;
|
21
22
|
margin-bottom: -3px;
|
22
23
|
|
@@ -30,11 +31,13 @@
|
|
30
31
|
overflow-wrap: break-word;
|
31
32
|
|
32
33
|
// When forced colour mode is active, for example to provide high contrast,
|
33
|
-
// the background colour of the tag is the same as the rest of the page. To
|
34
|
-
// that the tag is perceived as separate from any surround text, it
|
34
|
+
// the background colour of the tag is the same as the rest of the page. To
|
35
|
+
// ensure that the tag is perceived as separate from any surround text, it
|
36
|
+
// is made bold.
|
35
37
|
//
|
36
|
-
// Transparent outlines are no longer added, as they make the Tag look
|
37
|
-
// from a button – but the tag is not interactive in the
|
38
|
+
// Transparent outlines are no longer added, as they make the Tag look
|
39
|
+
// indistinguishable from a button – but the tag is not interactive in the
|
40
|
+
// same way.
|
38
41
|
@media screen and (forced-colors: active) {
|
39
42
|
font-weight: bold;
|
40
43
|
}
|
@@ -11,11 +11,13 @@
|
|
11
11
|
list-style-type: none;
|
12
12
|
}
|
13
13
|
|
14
|
-
// This uses table layout so that the task name and status always appear
|
15
|
-
// each 'column' being flexible depending upon
|
14
|
+
// This uses table layout so that the task name and status always appear
|
15
|
+
// side-by-side, with the width of each 'column' being flexible depending upon
|
16
|
+
// the length of the task names and statuses.
|
16
17
|
//
|
17
|
-
// The position is set to 'relative' so than an absolutely-positioned
|
18
|
-
// can be added within the link so that the whole row
|
18
|
+
// The position is set to 'relative' so than an absolutely-positioned
|
19
|
+
// transparent element box can be added within the link so that the whole row
|
20
|
+
// can be clickable.
|
19
21
|
.govuk-task-list__item {
|
20
22
|
display: table;
|
21
23
|
position: relative;
|
@@ -30,9 +32,9 @@
|
|
30
32
|
border-top: 1px solid $govuk-border-colour;
|
31
33
|
}
|
32
34
|
|
33
|
-
// This class is added to the <li> elements where the task name is a link.
|
34
|
-
//
|
35
|
-
// than just the visible link text.
|
35
|
+
// This class is added to the <li> elements where the task name is a link. The
|
36
|
+
// background hover colour is added to help indicate that the whole row is
|
37
|
+
// clickable, rather than just the visible link text.
|
36
38
|
.govuk-task-list__item--with-link:hover {
|
37
39
|
background: $govuk-task-list-hover-colour;
|
38
40
|
}
|
@@ -55,9 +57,9 @@
|
|
55
57
|
color: $govuk-secondary-text-colour;
|
56
58
|
}
|
57
59
|
|
58
|
-
// This adds an empty transparent box covering the whole row, including the
|
59
|
-
// any hint text. Because this is generated within the link
|
60
|
-
// to be clickable.
|
60
|
+
// This adds an empty transparent box covering the whole row, including the
|
61
|
+
// task status and any hint text. Because this is generated within the link
|
62
|
+
// element, this allows the whole area to be clickable.
|
61
63
|
.govuk-task-list__link::after {
|
62
64
|
content: "";
|
63
65
|
display: block;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
.govuk-textarea {
|
7
7
|
@include govuk-font($size: 19, $line-height: 1.25);
|
8
8
|
|
9
|
-
box-sizing: border-box;
|
9
|
+
box-sizing: border-box;
|
10
10
|
display: block;
|
11
11
|
width: 100%;
|
12
12
|
min-height: 40px;
|
@@ -25,8 +25,8 @@
|
|
25
25
|
// Ensure outline appears outside of the element
|
26
26
|
outline-offset: 0;
|
27
27
|
// Double the border by adding its width again. Use `box-shadow` to do
|
28
|
-
// this instead of changing `border-width` (which changes element size)
|
29
|
-
// since `outline` is already used for the yellow focus state.
|
28
|
+
// this instead of changing `border-width` (which changes element size)
|
29
|
+
// and since `outline` is already used for the yellow focus state.
|
30
30
|
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
31
31
|
}
|
32
32
|
|
@@ -25,8 +25,8 @@
|
|
25
25
|
margin-top: -5px;
|
26
26
|
}
|
27
27
|
|
28
|
-
// When a user customises their colours the background colour will often be
|
29
|
-
// Adding a border to the component keeps it's shape as a circle.
|
28
|
+
// When a user customises their colours the background colour will often be
|
29
|
+
// removed. Adding a border to the component keeps it's shape as a circle.
|
30
30
|
border: 3px solid $govuk-text-colour;
|
31
31
|
border-radius: 50%;
|
32
32
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
:root {
|
2
2
|
// This variable is automatically overwritten during builds and releases.
|
3
3
|
// It doesn't need to be updated manually.
|
4
|
-
--govuk-frontend-version: "5.
|
4
|
+
--govuk-frontend-version: "5.6.0";
|
5
5
|
|
6
6
|
// CSS custom property for each breakpoint
|
7
7
|
@each $name, $value in $govuk-breakpoints {
|
@@ -42,25 +42,61 @@
|
|
42
42
|
/// Get the colour for a government organisation
|
43
43
|
///
|
44
44
|
/// @param {String} $organisation - Organisation name, lowercase, hyphenated
|
45
|
-
/// @param {Boolean} $websafe
|
46
|
-
///
|
47
|
-
///
|
48
|
-
///
|
49
|
-
///
|
45
|
+
/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.
|
46
|
+
/// @param {Boolean} $contrast-safe [true] - By default a version of the colour
|
47
|
+
/// will be returned which has a minimum 4.5:1 contrast ratio when used with
|
48
|
+
/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the
|
49
|
+
/// non-contrast safe version you can set this to `false` but your should
|
50
|
+
/// ensure that you still meets contrast requirements for accessibility -
|
51
|
+
/// for example, do not use the non-contrast safe version for text.
|
50
52
|
///
|
51
53
|
/// @return {Colour} Representation of colour for organisation
|
52
54
|
/// @throw if `$organisation` is not a known organisation
|
53
55
|
/// @access public
|
54
56
|
|
55
|
-
@function govuk-organisation-colour($organisation, $websafe: true) {
|
57
|
+
@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {
|
58
|
+
// Check if the $organisation exists in the aliases map. If so, change the
|
59
|
+
// value of $organisation to the aliased value.
|
60
|
+
@if map-has-key($_govuk_colours-organisations-aliases, $organisation) {
|
61
|
+
$organisation: map-get($_govuk_colours-organisations-aliases, $organisation);
|
62
|
+
}
|
63
|
+
|
64
|
+
// Check to see if the organisation exists
|
56
65
|
@if not map-has-key($govuk-colours-organisations, $organisation) {
|
57
66
|
@error "Unknown organisation `#{$organisation}`";
|
58
67
|
}
|
59
68
|
|
69
|
+
// Output a warning if $websafe is set.
|
70
|
+
@if $websafe and not index($govuk-suppressed-warnings, "organisation-colour-websafe-param") {
|
71
|
+
@warn _warning-text("organisation-colour-websafe-param",
|
72
|
+
"The `$websafe` parameter of `govuk-organisation-colour` has been " +
|
73
|
+
"renamed to `$contrast-safe`. The old parameter name will be removed in " +
|
74
|
+
"the next major version."
|
75
|
+
);
|
76
|
+
}
|
77
|
+
|
60
78
|
$org-colour: map-get($govuk-colours-organisations, $organisation);
|
61
79
|
|
62
|
-
@if
|
63
|
-
@
|
80
|
+
@if map-has-key($org-colour, deprecation-message) and not index($govuk-suppressed-warnings, "organisation-colours") {
|
81
|
+
@warn _warning-text(
|
82
|
+
"organisation-colours",
|
83
|
+
map-get($org-colour, deprecation-message)
|
84
|
+
);
|
85
|
+
}
|
86
|
+
|
87
|
+
// If the $websafe parameter is being used (it has been explicitly set as true
|
88
|
+
// or false), assume the user hasn't updated to use $contrast-safe yet and map
|
89
|
+
// the old parameter's value onto the new parameter.
|
90
|
+
@if type-of($websafe) != "null" {
|
91
|
+
$contrast-safe: $websafe;
|
92
|
+
}
|
93
|
+
|
94
|
+
// Determine the contrast-safe key to use depending on whether it's the new
|
95
|
+
// palette or the legacy palette
|
96
|
+
$safe-key: if($govuk-new-organisation-colours, "contrast-safe", "colour-websafe");
|
97
|
+
|
98
|
+
@if $contrast-safe and map-has-key($org-colour, $safe-key) {
|
99
|
+
@return map-get($org-colour, $safe-key);
|
64
100
|
} @else {
|
65
101
|
@return map-get($org-colour, colour);
|
66
102
|
}
|
@@ -37,7 +37,7 @@
|
|
37
37
|
/// }
|
38
38
|
///
|
39
39
|
/// @example scss - Customising the breakpoint where width percentage is applied
|
40
|
-
/// .govuk-grid-column-one-half-
|
40
|
+
/// .govuk-grid-column-one-half-from-desktop {
|
41
41
|
/// @include govuk-grid-column(one-half, $at: desktop);
|
42
42
|
/// }
|
43
43
|
///
|
@@ -229,7 +229,7 @@
|
|
229
229
|
}
|
230
230
|
|
231
231
|
// Force a colour change on hover to work around a bug in Safari
|
232
|
-
// https://
|
232
|
+
// https://webkit.org/b/224483
|
233
233
|
&:hover {
|
234
234
|
@if type-of($govuk-text-colour) == color {
|
235
235
|
color: rgba($govuk-text-colour, 0.99);
|
@@ -265,7 +265,7 @@
|
|
265
265
|
}
|
266
266
|
|
267
267
|
// Force a colour change on hover to work around a bug in Safari
|
268
|
-
// https://
|
268
|
+
// https://webkit.org/b/224483
|
269
269
|
&:hover,
|
270
270
|
&:active {
|
271
271
|
color: rgba(govuk-colour("white"), 0.99);
|
@@ -54,7 +54,7 @@
|
|
54
54
|
-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
|
55
55
|
clip-path: polygon(50% 0%, 0% 100%, 100% 100%); // 3
|
56
56
|
|
57
|
-
border-width: 0 $perpendicular $height
|
57
|
+
border-width: 0 $perpendicular $height;
|
58
58
|
border-bottom-color: inherit; // 2
|
59
59
|
} @else if $direction == "right" {
|
60
60
|
-webkit-clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
|
@@ -79,6 +79,23 @@
|
|
79
79
|
font-variant-numeric: tabular-nums if($important, !important, null);
|
80
80
|
}
|
81
81
|
|
82
|
+
/// Word break helper
|
83
|
+
///
|
84
|
+
/// Forcibly breaks long words that lack spaces, such as email addresses,
|
85
|
+
/// across multiple lines when they wouldn't otherwise fit.
|
86
|
+
///
|
87
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
88
|
+
/// `!important`. Generally used to create override classes.
|
89
|
+
/// @access public
|
90
|
+
|
91
|
+
@mixin govuk-text-break-word($important: false) {
|
92
|
+
// IE 11 and Edge 16–17 only support the non-standard `word-wrap` property
|
93
|
+
word-wrap: break-word if($important, !important, null);
|
94
|
+
|
95
|
+
// All other browsers support `overflow-wrap`
|
96
|
+
overflow-wrap: break-word if($important, !important, null);
|
97
|
+
}
|
98
|
+
|
82
99
|
/// Convert line-heights specified in pixels into a relative value, unless
|
83
100
|
/// they are already unit-less (and thus already treated as relative values)
|
84
101
|
/// or the units do not match the units used for the font size.
|