@amsterdam/design-system-css 0.11.0 → 0.12.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.
- package/CHANGELOG.md +37 -16
- package/README.md +69 -40
- package/dist/accordion/accordion.css +1 -1
- package/dist/accordion/accordion.css.map +1 -1
- package/dist/action-group/action-group.css +1 -0
- package/dist/action-group/action-group.css.map +1 -0
- package/dist/avatar/avatar.css +1 -1
- package/dist/avatar/avatar.css.map +1 -1
- package/dist/blockquote/blockquote.css.map +1 -1
- package/dist/breakout/breakout.css +1 -0
- package/dist/breakout/breakout.css.map +1 -0
- package/dist/button/button.css +1 -1
- package/dist/button/button.css.map +1 -1
- package/dist/checkbox/checkbox.css.map +1 -1
- package/dist/description-list/description-list.css +1 -1
- package/dist/description-list/description-list.css.map +1 -1
- package/dist/dialog/dialog.css +1 -1
- package/dist/dialog/dialog.css.map +1 -1
- package/dist/field/field.css +1 -1
- package/dist/field/field.css.map +1 -1
- package/dist/file-input/file-input.css.map +1 -1
- package/dist/grid/grid.css +1 -1
- package/dist/grid/grid.css.map +1 -1
- package/dist/header/header.css +1 -1
- package/dist/header/header.css.map +1 -1
- package/dist/hint/hint.css +1 -0
- package/dist/hint/hint.css.map +1 -0
- package/dist/icon-button/icon-button.css +1 -1
- package/dist/icon-button/icon-button.css.map +1 -1
- package/dist/image-slider/image-slider.css +1 -0
- package/dist/image-slider/image-slider.css.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/link/link.css +1 -1
- package/dist/link/link.css.map +1 -1
- package/dist/link-list/link-list.css +1 -1
- package/dist/link-list/link-list.css.map +1 -1
- package/dist/ordered-list/ordered-list.css +1 -1
- package/dist/ordered-list/ordered-list.css.map +1 -1
- package/dist/pagination/pagination.css +1 -1
- package/dist/pagination/pagination.css.map +1 -1
- package/dist/password-input/password-input.css +1 -0
- package/dist/password-input/password-input.css.map +1 -0
- package/dist/radio/radio.css +1 -1
- package/dist/radio/radio.css.map +1 -1
- package/dist/screen/screen.css +1 -1
- package/dist/screen/screen.css.map +1 -1
- package/dist/search-field/search-field.css.map +1 -1
- package/dist/select/select.css.map +1 -1
- package/dist/switch/switch.css +1 -1
- package/dist/switch/switch.css.map +1 -1
- package/dist/tabs/tabs.css +1 -1
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/unordered-list/unordered-list.css +1 -1
- package/dist/unordered-list/unordered-list.css.map +1 -1
- package/package.json +11 -6
- package/src/components/accordion/accordion.scss +10 -1
- package/src/components/action-group/README.md +14 -0
- package/src/components/action-group/action-group.scss +15 -0
- package/src/components/avatar/README.md +3 -3
- package/src/components/avatar/avatar.scss +9 -0
- package/src/components/blockquote/blockquote.scss +4 -4
- package/src/components/breadcrumb/README.md +7 -9
- package/src/components/breakout/README.md +5 -0
- package/src/components/breakout/breakout.scss +163 -0
- package/src/components/button/README.md +5 -4
- package/src/components/button/button.scss +16 -7
- package/src/components/card/README.md +5 -1
- package/src/components/checkbox/README.md +1 -1
- package/src/components/checkbox/checkbox.scss +2 -2
- package/src/components/description-list/README.md +6 -5
- package/src/components/description-list/description-list.scss +23 -7
- package/src/components/dialog/README.md +5 -7
- package/src/components/dialog/dialog.scss +13 -30
- package/src/components/field/README.md +1 -1
- package/src/components/field/field.scss +1 -0
- package/src/components/field-set/README.md +2 -0
- package/src/components/file-input/file-input.scss +2 -2
- package/src/components/footer/README.md +4 -4
- package/src/components/gap/README.md +9 -7
- package/src/components/grid/README.md +11 -12
- package/src/components/grid/_mixins.scss +110 -0
- package/src/components/grid/grid.scss +33 -37
- package/src/components/header/README.md +9 -11
- package/src/components/header/header.scss +1 -0
- package/src/components/hint/README.md +9 -0
- package/src/components/hint/hint.scss +9 -0
- package/src/components/icon-button/icon-button.scss +18 -14
- package/src/components/image-slider/README.md +25 -0
- package/src/components/image-slider/image-slider.scss +89 -0
- package/src/components/index.scss +5 -0
- package/src/components/label/README.md +3 -1
- package/src/components/link/README.md +5 -0
- package/src/components/link/link.scss +10 -10
- package/src/components/link-list/README.md +2 -3
- package/src/components/link-list/link-list.scss +6 -6
- package/src/components/margin/README.md +6 -6
- package/src/components/mark/README.md +1 -6
- package/src/components/ordered-list/README.md +5 -0
- package/src/components/ordered-list/ordered-list.scss +3 -5
- package/src/components/page-menu/README.md +5 -1
- package/src/components/pagination/pagination.scss +6 -6
- package/src/components/password-input/README.md +29 -0
- package/src/components/password-input/password-input.scss +59 -0
- package/src/components/radio/README.md +2 -2
- package/src/components/radio/radio.scss +123 -90
- package/src/components/screen/README.md +9 -8
- package/src/components/screen/screen.scss +1 -0
- package/src/components/search-field/README.md +1 -1
- package/src/components/search-field/search-field.scss +3 -3
- package/src/components/select/select.scss +2 -2
- package/src/components/skip-link/README.md +0 -5
- package/src/components/spotlight/README.md +2 -1
- package/src/components/switch/README.md +2 -2
- package/src/components/switch/switch.scss +9 -6
- package/src/components/tabs/README.md +3 -1
- package/src/components/tabs/tabs.scss +12 -0
- package/src/components/text-input/README.md +1 -1
- package/src/components/top-task-link/README.md +4 -0
- package/src/components/unordered-list/README.md +6 -0
- package/src/components/unordered-list/unordered-list.scss +3 -5
|
@@ -12,28 +12,7 @@
|
|
|
12
12
|
@include input-label-focus;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
align-items: center;
|
|
17
|
-
block-size: calc(var(--ams-radio-font-size) * var(--ams-radio-line-height));
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-shrink: 0;
|
|
20
|
-
inline-size: 1.5rem;
|
|
21
|
-
|
|
22
|
-
&::after {
|
|
23
|
-
background-position: center;
|
|
24
|
-
background-repeat: no-repeat;
|
|
25
|
-
background-size: 1rem;
|
|
26
|
-
block-size: 1.5rem;
|
|
27
|
-
border-color: var(--ams-radio-circle-border-color);
|
|
28
|
-
border-radius: 100%;
|
|
29
|
-
border-style: solid;
|
|
30
|
-
border-width: var(--ams-radio-circle-border-width);
|
|
31
|
-
box-sizing: border-box;
|
|
32
|
-
content: "";
|
|
33
|
-
inline-size: 100%;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
15
|
+
// Default
|
|
37
16
|
.ams-radio__label {
|
|
38
17
|
color: var(--ams-radio-color);
|
|
39
18
|
cursor: pointer;
|
|
@@ -44,111 +23,165 @@
|
|
|
44
23
|
gap: var(--ams-radio-gap);
|
|
45
24
|
line-height: var(--ams-radio-line-height);
|
|
46
25
|
outline-offset: var(--ams-radio-outline-offset);
|
|
26
|
+
text-decoration-thickness: var(--ams-radio-text-decoration-thickness);
|
|
27
|
+
text-underline-offset: var(--ams-radio-text-underline-offset);
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
text-decoration-line: underline;
|
|
51
|
-
text-decoration-thickness: var(--ams-radio-hover-text-decoration-thickness);
|
|
52
|
-
text-underline-offset: 0.375rem;
|
|
29
|
+
@include text-rendering;
|
|
30
|
+
}
|
|
53
31
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
.ams-radio__icon-container {
|
|
33
|
+
block-size: var(--ams-radio-icon-container-block-size);
|
|
34
|
+
display: flex;
|
|
35
|
+
flex: none;
|
|
36
|
+
inline-size: var(--ams-radio-icon-container-inline-size);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ams-radio__circle {
|
|
40
|
+
fill: none;
|
|
41
|
+
stroke: var(--ams-radio-circle-stroke);
|
|
42
|
+
stroke-width: 0.125rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ams-radio__checked-indicator {
|
|
46
|
+
display: none;
|
|
47
|
+
fill: var(--ams-radio-checked-indicator-fill);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Default hover
|
|
51
|
+
.ams-radio__label:hover {
|
|
52
|
+
color: var(--ams-radio-hover-color);
|
|
53
|
+
text-decoration-line: var(--ams-radio-hover-text-decoration-line);
|
|
54
|
+
|
|
55
|
+
.ams-radio__circle {
|
|
56
|
+
stroke: var(--ams-radio-circle-hover-stroke);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
.ams-radio__checked-indicator {
|
|
60
|
+
fill: var(--ams-radio-checked-indicator-hover-fill);
|
|
61
|
+
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
//
|
|
63
|
-
.ams-radio__input
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
// Invalid
|
|
65
|
+
.ams-radio__input[aria-invalid="true"] + .ams-radio__label {
|
|
66
|
+
.ams-radio__circle {
|
|
67
|
+
stroke: var(--ams-radio-circle-invalid-stroke);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ams-radio__checked-indicator {
|
|
71
|
+
fill: var(--ams-radio-checked-indicator-invalid-fill);
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
//
|
|
70
|
-
.ams-radio__input
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
// Checked
|
|
76
|
+
.ams-radio__input:checked + .ams-radio__label {
|
|
77
|
+
.ams-radio__checked-indicator {
|
|
78
|
+
display: block;
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
|
|
76
|
-
// Disabled
|
|
77
|
-
.ams-radio__input:disabled {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cursor: not-allowed;
|
|
82
|
+
// Disabled
|
|
83
|
+
.ams-radio__input:disabled + .ams-radio__label {
|
|
84
|
+
color: var(--ams-radio-disabled-color);
|
|
85
|
+
cursor: not-allowed;
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
.ams-radio__circle {
|
|
88
|
+
stroke: var(--ams-radio-circle-disabled-stroke);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ams-radio__checked-indicator {
|
|
92
|
+
fill: var(--ams-radio-checked-indicator-disabled-fill);
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
|
|
89
|
-
//
|
|
90
|
-
.ams-radio__input[aria-invalid="true"]:
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
// Disabled invalid
|
|
97
|
+
.ams-radio__input[aria-invalid="true"]:disabled + .ams-radio__label {
|
|
98
|
+
.ams-radio__circle {
|
|
99
|
+
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
100
|
+
stroke: var(--ams-radio-circle-disabled-invalid-stroke);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ams-radio__checked-indicator {
|
|
104
|
+
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
105
|
+
fill: var(--ams-radio-checked-indicator-disabled-invalid-fill);
|
|
93
106
|
}
|
|
94
107
|
}
|
|
95
108
|
|
|
96
|
-
//
|
|
109
|
+
// HOVER
|
|
110
|
+
|
|
111
|
+
// Disabled label hover
|
|
97
112
|
.ams-radio__input:disabled + .ams-radio__label:hover {
|
|
98
113
|
text-decoration: none;
|
|
99
114
|
}
|
|
100
115
|
|
|
101
|
-
//
|
|
102
|
-
.ams-radio__input:
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
// Invalid hover
|
|
117
|
+
.ams-radio__input[aria-invalid="true"] + .ams-radio__label:hover {
|
|
118
|
+
.ams-radio__circle {
|
|
119
|
+
// TODO: this should be the (currently non-existent) dark red hover color
|
|
120
|
+
stroke: var(--ams-radio-circle-invalid-hover-stroke);
|
|
105
121
|
}
|
|
106
|
-
}
|
|
107
122
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
112
|
-
border-color: var(--ams-radio-circle-disabled-border-color);
|
|
123
|
+
.ams-radio__checked-indicator {
|
|
124
|
+
// TODO: this should be the (currently non-existent) dark red hover color
|
|
125
|
+
fill: var(--ams-radio-checked-indicator-invalid-hover-fill);
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
128
|
|
|
116
|
-
//
|
|
129
|
+
// Disabled invalid hover
|
|
130
|
+
.ams-radio__input[aria-invalid="true"]:disabled + .ams-radio__label:hover {
|
|
131
|
+
.ams-radio__circle {
|
|
132
|
+
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
133
|
+
stroke: var(--ams-radio-circle-disabled-invalid-hover-stroke);
|
|
134
|
+
}
|
|
117
135
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
.ams-radio__checked-indicator {
|
|
137
|
+
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
138
|
+
fill: var(--ams-radio-checked-indicator-disabled-invalid-hover-fill);
|
|
139
|
+
}
|
|
122
140
|
}
|
|
123
141
|
|
|
124
|
-
//
|
|
125
|
-
.ams-radio__input:checked + .ams-radio__label:hover .ams-radio__circle::after {
|
|
126
|
-
background-image: var(--ams-radio-circle-checked-hover-background-image);
|
|
127
|
-
}
|
|
142
|
+
// FORCED COLORS
|
|
128
143
|
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
// Default
|
|
145
|
+
@media (forced-colors: active) {
|
|
146
|
+
.ams-radio__label,
|
|
147
|
+
.ams-radio__label:hover,
|
|
148
|
+
.ams-radio__input[aria-invalid="true"] + .ams-radio__label,
|
|
149
|
+
.ams-radio__input[aria-invalid="true"] + .ams-radio__label:hover {
|
|
150
|
+
.ams-radio__circle {
|
|
151
|
+
stroke: FieldText;
|
|
152
|
+
}
|
|
134
153
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
154
|
+
.ams-radio__checked-indicator {
|
|
155
|
+
fill: FieldText;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
138
158
|
}
|
|
139
159
|
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
160
|
+
// Checked
|
|
161
|
+
@media (forced-colors: active) {
|
|
162
|
+
.ams-radio__input:checked + .ams-radio__label,
|
|
163
|
+
.ams-radio__input[aria-invalid="true"]:checked + .ams-radio__label:hover {
|
|
164
|
+
.ams-radio__circle {
|
|
165
|
+
stroke: ActiveText;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ams-radio__checked-indicator {
|
|
169
|
+
fill: ActiveText;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
144
172
|
}
|
|
145
173
|
|
|
146
|
-
//
|
|
174
|
+
// Disabled
|
|
175
|
+
@media (forced-colors: active) {
|
|
176
|
+
.ams-radio__input:disabled + .ams-radio__label,
|
|
177
|
+
.ams-radio__input[aria-invalid="true"]:disabled + .ams-radio__label,
|
|
178
|
+
.ams-radio__input[aria-invalid="true"]:disabled + .ams-radio__label:hover {
|
|
179
|
+
.ams-radio__circle {
|
|
180
|
+
stroke: GrayText;
|
|
181
|
+
}
|
|
147
182
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
|
|
152
|
-
background-image: var(--ams-radio-circle-disabled-checked-background-image);
|
|
183
|
+
.ams-radio__checked-indicator {
|
|
184
|
+
fill: GrayText;
|
|
185
|
+
}
|
|
153
186
|
}
|
|
154
187
|
}
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
Manages the maximum width and alignment of the entire website or application.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Guidelines
|
|
8
8
|
|
|
9
|
-
This should be the outermost component of your website or application.
|
|
10
|
-
Within it, combine components such as
|
|
11
|
-
[Grid](/docs/components-layout-grid--docs),
|
|
12
|
-
[Header](/docs/components-containers-header--docs),
|
|
13
|
-
[Footer](/docs/components-containers-footer--docs),
|
|
14
|
-
[Spotlight](/docs/components-containers-spotlight--docs),
|
|
15
|
-
|
|
9
|
+
- This should be the outermost component of your website or application.
|
|
10
|
+
- Within it, combine components such as
|
|
11
|
+
[Grid](/docs/components-layout-grid--docs),
|
|
12
|
+
[Header](/docs/components-containers-header--docs),
|
|
13
|
+
[Footer](/docs/components-containers-footer--docs),
|
|
14
|
+
[Spotlight](/docs/components-containers-spotlight--docs),
|
|
15
|
+
[Image Slider](/docs/components-media-image-slider--docs),
|
|
16
|
+
and Figure.
|
|
16
17
|
|
|
17
18
|
## Design
|
|
18
19
|
|
|
@@ -32,4 +32,4 @@ These features can be disruptive for a user searching for part of a word, and `a
|
|
|
32
32
|
- [WCAG 1.3.5](https://www.w3.org/TR/WCAG22/#identify-input-purpose): It is clear both to the user and programmatically what the purpose of a form field is.
|
|
33
33
|
- [WCAG 2.4.6](https://www.w3.org/TR/WCAG22/#headings-and-labels): There is a label describing the purpose of the input.
|
|
34
34
|
|
|
35
|
-
Search Field is an interactive element
|
|
35
|
+
Search Field is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
|
|
72
72
|
@mixin reset-button {
|
|
73
73
|
border: 0;
|
|
74
|
+
margin-block: 0; // [1]
|
|
75
|
+
margin-inline: 0; // [1]
|
|
74
76
|
|
|
75
|
-
//
|
|
76
|
-
margin-block: 0;
|
|
77
|
-
margin-inline: 0;
|
|
77
|
+
// [1] Remove the margin in older Safari.
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.ams-search-field__button {
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
padding-inline: var(--ams-select-padding-inline);
|
|
24
24
|
touch-action: manipulation;
|
|
25
25
|
|
|
26
|
+
@include reset;
|
|
27
|
+
|
|
26
28
|
&:not([multiple]) {
|
|
27
29
|
background-image: var(--ams-select-background-image);
|
|
28
30
|
background-position: var(--ams-select-background-position);
|
|
@@ -33,8 +35,6 @@
|
|
|
33
35
|
&:hover {
|
|
34
36
|
box-shadow: var(--ams-select-hover-box-shadow);
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
@include reset;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.ams-select:invalid,
|
|
@@ -11,8 +11,6 @@ When the link is shown, it pushes the entire page down.
|
|
|
11
11
|
|
|
12
12
|
## Guidelines
|
|
13
13
|
|
|
14
|
-
### How to Use
|
|
15
|
-
|
|
16
14
|
- Place the Skip Link as the first element in `<body>` unless you have a cookie banner.
|
|
17
15
|
In that case, place the Skip Link immediately after the cookie banner.
|
|
18
16
|
- Use the Skip Link to navigate to the main content.
|
|
@@ -20,9 +18,6 @@ When the link is shown, it pushes the entire page down.
|
|
|
20
18
|
- Set `id="example-id"` on the container of that element and then use `href="#example-id"` on the Skip Link.
|
|
21
19
|
- You can use more than one Skip Link for complex pages with multiple sections.
|
|
22
20
|
In most cases, this is not necessary.
|
|
23
|
-
|
|
24
|
-
### Avoid
|
|
25
|
-
|
|
26
21
|
- Skip Links are unnecessary on a simple page with only text and minimal navigation.
|
|
27
22
|
The purpose of a Skip Link is to bypass recurring navigation blocks.
|
|
28
23
|
If those blocks are not present, a Skip Link is not needed.
|
|
@@ -6,7 +6,8 @@ Emphasizes a section on a page through a distinctive background colour.
|
|
|
6
6
|
|
|
7
7
|
## Guidelines
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Display the Spotlight at the entire width of the [Screen](/docs/components-layout-screen--docs); do not position it on the [Grid](/docs/components-layout-grid--docs).
|
|
10
|
+
- Refer to [this overview on Stijlweb](https://amsterdam.nl/stijlweb/basiselementen/kleuren/#PagCls_15671872) to determine whether you can use black or white text on the background colour of your choice.
|
|
10
11
|
|
|
11
12
|
## Relevant WCAG requirements
|
|
12
13
|
|
|
@@ -7,16 +7,16 @@ A switch applies to a page or the entire system, such as an on/off switch.
|
|
|
7
7
|
|
|
8
8
|
## Guidelines
|
|
9
9
|
|
|
10
|
+
- A Switch must have a label, and in most cases, this label should be visible.
|
|
10
11
|
- Switch only between two different states.
|
|
11
12
|
It is a binary action.
|
|
12
|
-
- Use labels with a switch to make the action clear.
|
|
13
13
|
- The action takes place immediately when the user operates the switch.
|
|
14
14
|
|
|
15
15
|
## Relevant WCAG requirements
|
|
16
16
|
|
|
17
17
|
- [WCAG 1.3.5](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html): it is both clear for a user and programmatically what the purpose of a form field is.
|
|
18
18
|
|
|
19
|
-
Switch is an interactive element
|
|
19
|
+
Switch is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
|
|
20
20
|
|
|
21
21
|
## References
|
|
22
22
|
|
|
@@ -16,16 +16,17 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.ams-switch__label {
|
|
19
|
-
--ams-switch-track-
|
|
19
|
+
--ams-switch-track-border-width: 0.0625rem;
|
|
20
20
|
|
|
21
21
|
background-color: var(--ams-switch-background-color);
|
|
22
|
+
|
|
23
|
+
// Using a transparent border to make sure the component is visible in forced colors mode.
|
|
24
|
+
border: var(--ams-switch-track-border-width) solid transparent;
|
|
22
25
|
border-radius: calc(var(--ams-switch-thumb-inline-size) * 2);
|
|
23
26
|
cursor: pointer;
|
|
24
27
|
display: inline-block;
|
|
25
28
|
inline-size: var(--ams-switch-inline-size);
|
|
26
29
|
outline-offset: var(--ams-switch-outline-offset);
|
|
27
|
-
padding-block: var(--ams-switch-track-padding);
|
|
28
|
-
padding-inline: var(--ams-switch-track-padding);
|
|
29
30
|
transition: background-color 0.2s ease-in-out;
|
|
30
31
|
|
|
31
32
|
@include reset;
|
|
@@ -41,6 +42,10 @@
|
|
|
41
42
|
transition-duration: 0.1s;
|
|
42
43
|
transition-property: box-shadow, transform;
|
|
43
44
|
transition-timing-function: ease-in-out;
|
|
45
|
+
|
|
46
|
+
@media (forced-colors: active) {
|
|
47
|
+
background-color: FieldText;
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
.ams-switch__input:checked + .ams-switch__label {
|
|
@@ -53,9 +58,7 @@
|
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
.ams-switch__input:checked + .ams-switch__label::before {
|
|
56
|
-
transform: translate(
|
|
57
|
-
calc(var(--ams-switch-inline-size) - var(--ams-switch-thumb-inline-size) - 2 * var(--ams-switch-track-padding))
|
|
58
|
-
);
|
|
61
|
+
transform: translate(calc(100% - 2 * var(--ams-switch-track-border-width)));
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
.ams-switch:hover .ams-switch__input:enabled + .ams-switch__label::before {
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
Tabs are used to bundle related content in a compact overview within a page. Each tab has a short name, and these names indicate the relationship between the information displayed in each tab.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Guidelines
|
|
8
8
|
|
|
9
9
|
- The content of each tab is viewable independently, not in the context of one another.
|
|
10
10
|
- The content within each tab should have a similar structure.
|
|
11
11
|
- Use when there is limited visual space and content needs to be divided into sections.
|
|
12
|
+
- Each tab consists of a button and a panel.
|
|
13
|
+
A `tab` prop with a corresponding value connects them.
|
|
12
14
|
|
|
13
15
|
You can navigate tabs with your keyboard:
|
|
14
16
|
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
@mixin reset-button {
|
|
9
9
|
background-color: transparent;
|
|
10
10
|
border: 0;
|
|
11
|
+
margin-block: 0; // [1]
|
|
12
|
+
margin-inline: 0; // [1]
|
|
13
|
+
|
|
14
|
+
// [1] Remove the margin in older Safari.
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
.ams-tabs {
|
|
@@ -38,6 +42,10 @@
|
|
|
38
42
|
&:disabled {
|
|
39
43
|
color: var(--ams-tabs-button-disabled-color);
|
|
40
44
|
cursor: var(--ams-tab-button-disabled-cursor);
|
|
45
|
+
|
|
46
|
+
@media (forced-colors: active) {
|
|
47
|
+
color: GrayText;
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
&:hover:not([aria-selected="true"], [disabled]) {
|
|
@@ -48,5 +56,9 @@
|
|
|
48
56
|
&[aria-selected="true"] {
|
|
49
57
|
background-color: var(--ams-tabs-button-selected-background-color);
|
|
50
58
|
color: var(--ams-tabs-button-selected-color);
|
|
59
|
+
|
|
60
|
+
@media (forced-colors: active) {
|
|
61
|
+
background-color: SelectedItem;
|
|
62
|
+
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
@@ -10,7 +10,7 @@ A form field in which a user can enter text.
|
|
|
10
10
|
- Do not use a Text Input when users could provide more than 1 sentence of text.
|
|
11
11
|
- The width of the Text Input should be appropriate for the information to be entered.
|
|
12
12
|
- A Text Input must have a Label, and in most cases, this label should be visible.
|
|
13
|
-
- Use `spellcheck="false"` for fields that may contain sensitive information, such as
|
|
13
|
+
- Use `spellcheck="false"` for fields that may contain sensitive information, such as personal data.
|
|
14
14
|
Some browser extensions for spell-checking send this information to external servers.
|
|
15
15
|
- Apply automatic assistance where possible.
|
|
16
16
|
For example, in logged-in systems, pre-filling known values can prevent errors and save time.
|
|
@@ -18,6 +18,10 @@ A prominent navigation element to quickly start a task.
|
|
|
18
18
|
If this is not possible, leave the last cells of the grid empty.
|
|
19
19
|
- If you have a group of links for which a description is unnecessary or illogical, use a [Link List](/docs/components-navigation-link--docs).
|
|
20
20
|
|
|
21
|
+
### Using links with routing libraries
|
|
22
|
+
|
|
23
|
+
Check out the [developer guide](/docs/docs-developer-guide-routing-libraries--docs) on how to integrate links with external routing libraries.
|
|
24
|
+
|
|
21
25
|
## Relevant WCAG requirements
|
|
22
26
|
|
|
23
27
|
The Top Task Link is subject to the same requirements as [regular links](/docs/components-navigation-link--docs).
|
|
@@ -7,3 +7,9 @@ This list can have 2 levels.
|
|
|
7
7
|
The first level consists of squares.
|
|
8
8
|
The second level consists of en dashes (–).
|
|
9
9
|
Text in the list items is indented by a fixed distance.
|
|
10
|
+
|
|
11
|
+
## Design
|
|
12
|
+
|
|
13
|
+
Items of an unordered list have square markers.
|
|
14
|
+
There is extra white space between the items.
|
|
15
|
+
This provides better distinction between the items, especially when they consist of multiple lines of text.
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
@import "../../common/text-rendering";
|
|
7
7
|
|
|
8
|
-
/** Apply border box sizing, reset white space and list styles. */
|
|
9
8
|
@mixin reset {
|
|
10
9
|
box-sizing: border-box;
|
|
11
10
|
list-style: none;
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
padding-inline-start: 0;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
/** A list is a grid column with a gap between items. */
|
|
17
15
|
.ams-unordered-list {
|
|
18
16
|
display: grid;
|
|
19
17
|
gap: var(--ams-unordered-list-gap);
|
|
@@ -22,7 +20,6 @@
|
|
|
22
20
|
@include reset;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
/** A list with markers sets typography for its text content. */
|
|
26
23
|
.ams-unordered-list:not(.ams-unordered-list--no-markers) {
|
|
27
24
|
color: var(--ams-unordered-list-color);
|
|
28
25
|
font-family: var(--ams-unordered-list-font-family);
|
|
@@ -31,7 +28,6 @@
|
|
|
31
28
|
line-height: var(--ams-unordered-list-line-height);
|
|
32
29
|
list-style-type: var(--ams-unordered-list-list-style-type);
|
|
33
30
|
|
|
34
|
-
/** List items are responsible for indentation and marker positioning. */
|
|
35
31
|
.ams-unordered-list__item {
|
|
36
32
|
margin-inline-start: var(--ams-unordered-list-item-margin-inline-start);
|
|
37
33
|
padding-inline-start: var(--ams-unordered-list-item-padding-inline-start);
|
|
@@ -47,9 +43,11 @@
|
|
|
47
43
|
line-height: var(--ams-unordered-list-small-line-height);
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
/** A nested list has a different marker and less indentation for correct alignment. */
|
|
51
46
|
:is(.ams-ordered-list, .ams-unordered-list) .ams-unordered-list {
|
|
47
|
+
gap: var(--ams-unordered-list-unordered-list-gap);
|
|
52
48
|
list-style-type: var(--ams-unordered-list-unordered-list-list-style-type);
|
|
49
|
+
padding-block-end: var(--ams-unordered-list-unordered-list-padding-block-end);
|
|
50
|
+
padding-block-start: var(--ams-unordered-list-unordered-list-padding-block-start);
|
|
53
51
|
|
|
54
52
|
.ams-unordered-list__item {
|
|
55
53
|
margin-inline-start: var(--ams-unordered-list-unordered-list-item-margin-inline-start);
|