@amsterdam/design-system-css 0.13.1 → 0.14.1
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 +39 -2
- package/README.md +1 -1
- package/dist/alert/alert.css +1 -1
- package/dist/alert/alert.css.map +1 -1
- package/dist/aspect-ratio/aspect-ratio.css +1 -1
- package/dist/aspect-ratio/aspect-ratio.css.map +1 -1
- package/dist/blockquote/blockquote.css +1 -1
- package/dist/blockquote/blockquote.css.map +1 -1
- package/dist/breadcrumb/breadcrumb.css +1 -1
- package/dist/breadcrumb/breadcrumb.css.map +1 -1
- package/dist/breakout/breakout.css.map +1 -1
- package/dist/date-input/date-input.css +1 -1
- package/dist/date-input/date-input.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/error-message/error-message.css +1 -1
- package/dist/error-message/error-message.css.map +1 -1
- package/dist/figure/figure.css +1 -0
- package/dist/figure/figure.css.map +1 -0
- package/dist/file-input/file-input.css +1 -1
- package/dist/file-input/file-input.css.map +1 -1
- package/dist/file-list/file-list.css +1 -0
- package/dist/file-list/file-list.css.map +1 -0
- package/dist/footer/footer.css +1 -0
- package/dist/footer/footer.css.map +1 -0
- package/dist/gap/gap.css.map +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/heading/heading.css +1 -1
- package/dist/heading/heading.css.map +1 -1
- package/dist/icon/icon.css +1 -1
- package/dist/icon/icon.css.map +1 -1
- package/dist/image/image.css +1 -1
- package/dist/image/image.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.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/logo/logo.css +1 -1
- package/dist/logo/logo.css.map +1 -1
- package/dist/margin/margin.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/overlap/overlap.css +1 -1
- package/dist/overlap/overlap.css.map +1 -1
- package/dist/page-heading/page-heading.css +1 -1
- package/dist/page-heading/page-heading.css.map +1 -1
- package/dist/page-menu/page-menu.css +1 -1
- package/dist/page-menu/page-menu.css.map +1 -1
- package/dist/pagination/pagination.css +1 -1
- package/dist/pagination/pagination.css.map +1 -1
- package/dist/paragraph/paragraph.css +1 -1
- package/dist/paragraph/paragraph.css.map +1 -1
- package/dist/password-input/password-input.css +1 -1
- package/dist/password-input/password-input.css.map +1 -1
- 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 +1 -1
- package/dist/search-field/search-field.css.map +1 -1
- package/dist/spotlight/spotlight.css +1 -1
- package/dist/spotlight/spotlight.css.map +1 -1
- package/dist/switch/switch.css +1 -1
- package/dist/switch/switch.css.map +1 -1
- package/dist/table-of-contents/table-of-contents.css +1 -1
- package/dist/table-of-contents/table-of-contents.css.map +1 -1
- package/dist/tabs/tabs.css +1 -1
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/text-area/text-area.css +1 -1
- package/dist/text-area/text-area.css.map +1 -1
- package/dist/text-input/text-input.css +1 -1
- package/dist/text-input/text-input.css.map +1 -1
- package/dist/time-input/time-input.css +1 -1
- package/dist/time-input/time-input.css.map +1 -1
- package/dist/top-task-link/top-task-link.css +1 -1
- package/dist/top-task-link/top-task-link.css.map +1 -1
- package/dist/unordered-list/unordered-list.css +1 -1
- package/dist/unordered-list/unordered-list.css.map +1 -1
- package/documentation/coding-conventions.md +5 -1
- package/package.json +4 -4
- package/src/components/accordion/accordion.scss +1 -1
- package/src/components/alert/alert.scss +1 -0
- package/src/components/aspect-ratio/README.md +15 -11
- package/src/components/aspect-ratio/aspect-ratio.scss +5 -26
- package/src/components/blockquote/blockquote.scss +5 -5
- package/src/components/breadcrumb/breadcrumb.scss +4 -4
- package/src/components/breakout/breakout.scss +3 -3
- package/src/components/button/button.scss +1 -1
- package/src/components/character-count/character-count.scss +1 -1
- package/src/components/checkbox/checkbox.scss +3 -3
- package/src/components/column/column.scss +1 -1
- package/src/components/date-input/date-input.scss +4 -4
- package/src/components/description-list/description-list.scss +34 -12
- package/src/components/dialog/dialog.scss +1 -1
- package/src/components/error-message/error-message.scss +6 -4
- package/src/components/field-set/field-set.scss +4 -4
- package/src/components/figure/README.md +5 -0
- package/src/components/figure/figure.scss +33 -0
- package/src/components/file-input/file-input.scss +4 -3
- package/src/components/file-list/README.md +5 -0
- package/src/components/file-list/file-list.scss +55 -0
- package/src/components/footer/README.md +6 -6
- package/src/components/footer/footer.scss +8 -0
- package/src/components/gap/gap.scss +3 -2
- package/src/components/grid/_mixins.scss +2 -0
- package/src/components/grid/grid.scss +2 -2
- package/src/components/header/README.md +7 -5
- package/src/components/header/header.scss +183 -53
- package/src/components/heading/heading.scss +5 -5
- package/src/components/icon/icon.scss +4 -0
- package/src/components/icon-button/icon-button.scss +2 -2
- package/src/components/image/README.md +27 -5
- package/src/components/image/image.scss +4 -4
- package/src/components/image-slider/image-slider.scss +1 -1
- package/src/components/index.scss +66 -63
- package/src/components/label/label.scss +2 -2
- package/src/components/link/link.scss +1 -1
- package/src/components/link-list/link-list.scss +5 -5
- package/src/components/logo/README.md +1 -1
- package/src/components/logo/logo.scss +1 -0
- package/src/components/margin/margin.scss +3 -2
- package/src/components/ordered-list/ordered-list.scss +4 -4
- package/src/components/overlap/overlap.scss +2 -1
- package/src/components/page-heading/page-heading.scss +5 -5
- package/src/components/page-menu/page-menu.scss +6 -9
- package/src/components/pagination/pagination.scss +4 -4
- package/src/components/paragraph/paragraph.scss +4 -4
- package/src/components/password-input/password-input.scss +4 -4
- package/src/components/radio/radio.scss +28 -6
- package/src/components/row/row.scss +1 -1
- package/src/components/screen/screen.scss +1 -6
- package/src/components/search-field/search-field.scss +2 -28
- package/src/components/select/select.scss +2 -2
- package/src/components/skip-link/README.md +11 -13
- package/src/components/spotlight/README.md +2 -0
- package/src/components/spotlight/spotlight.scss +4 -4
- package/src/components/switch/switch.scss +3 -8
- package/src/components/table-of-contents/table-of-contents.scss +4 -4
- package/src/components/tabs/tabs.scss +24 -5
- package/src/components/text-area/text-area.scss +4 -4
- package/src/components/text-input/text-input.scss +4 -4
- package/src/components/time-input/time-input.scss +4 -4
- package/src/components/top-task-link/top-task-link.scss +4 -9
- package/src/components/unordered-list/unordered-list.scss +4 -4
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
7
|
-
@
|
|
6
|
+
@use "../../common/breakpoint" as *;
|
|
7
|
+
@use "../../common/text-rendering" as *;
|
|
8
8
|
|
|
9
|
-
@mixin reset {
|
|
10
|
-
box-sizing: border-box;
|
|
9
|
+
@mixin reset-dl {
|
|
11
10
|
margin-block: 0;
|
|
12
11
|
}
|
|
13
12
|
|
|
13
|
+
@mixin reset-dd {
|
|
14
|
+
margin-inline: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
14
17
|
.ams-description-list {
|
|
18
|
+
box-sizing: border-box;
|
|
15
19
|
color: var(--ams-description-list-color);
|
|
16
20
|
column-gap: var(--ams-description-list-column-gap);
|
|
17
21
|
display: grid;
|
|
@@ -20,24 +24,28 @@
|
|
|
20
24
|
line-height: var(--ams-description-list-line-height);
|
|
21
25
|
row-gap: var(--ams-description-list-row-gap);
|
|
22
26
|
|
|
23
|
-
@include reset;
|
|
27
|
+
@include reset-dl;
|
|
24
28
|
@include text-rendering;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
@media screen and (min-width: $ams-breakpoint-medium) {
|
|
28
|
-
.ams-description-list
|
|
32
|
+
.ams-description-list,
|
|
33
|
+
.ams-description-list__section {
|
|
29
34
|
grid-template-columns: auto 1fr;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
.ams-description-list--terms-width-sm
|
|
37
|
+
.ams-description-list--terms-width-sm,
|
|
38
|
+
.ams-description-list--terms-width-sm .ams-description-list__section {
|
|
33
39
|
grid-template-columns: 1fr 4fr;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
.ams-description-list--terms-width-md
|
|
42
|
+
.ams-description-list--terms-width-md,
|
|
43
|
+
.ams-description-list--terms-width-md .ams-description-list__section {
|
|
37
44
|
grid-template-columns: 1fr 2fr;
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
.ams-description-list--terms-width-lg
|
|
47
|
+
.ams-description-list--terms-width-lg,
|
|
48
|
+
.ams-description-list--terms-width-lg .ams-description-list__section {
|
|
41
49
|
grid-template-columns: 1fr 1fr;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
@@ -54,15 +62,29 @@
|
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
.ams-description-list__section {
|
|
66
|
+
@media screen and (min-width: $ams-breakpoint-medium) {
|
|
67
|
+
column-gap: var(--ams-description-list-column-gap);
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-column: span 2;
|
|
70
|
+
|
|
71
|
+
> :only-of-type {
|
|
72
|
+
grid-row: 1 / 9;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Aligns terms and descriptions in a section to the grid of the list.
|
|
78
|
+
// The extra class selector increases specificity to match earlier declarations.
|
|
79
|
+
.ams-description-list .ams-description-list__section {
|
|
80
|
+
grid-template-columns: subgrid;
|
|
59
81
|
}
|
|
60
82
|
|
|
61
83
|
.ams-description-list__description {
|
|
62
84
|
font-weight: var(--ams-description-list-description-font-weight);
|
|
63
85
|
padding-inline-start: var(--ams-description-list-description-padding-inline-start);
|
|
64
86
|
|
|
65
|
-
@include reset-
|
|
87
|
+
@include reset-dd;
|
|
66
88
|
|
|
67
89
|
@media screen and (min-width: $ams-breakpoint-medium) {
|
|
68
90
|
grid-column-start: 2;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
@mixin reset-dialog {
|
|
7
|
-
box-sizing: border-box;
|
|
8
7
|
inset-block: 0;
|
|
9
8
|
}
|
|
10
9
|
|
|
@@ -13,6 +12,7 @@ so do not apply these styles without an `open` attribute. */
|
|
|
13
12
|
.ams-dialog:not(dialog:not([open])) {
|
|
14
13
|
background-color: var(--ams-dialog-background-color);
|
|
15
14
|
border: var(--ams-dialog-border);
|
|
15
|
+
box-sizing: border-box;
|
|
16
16
|
display: flex; // Using flex here, because grid works strangely in Safari
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
gap: var(--ams-dialog-gap);
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@use "../../common/text-rendering" as *;
|
|
7
7
|
|
|
8
|
-
@mixin reset {
|
|
9
|
-
box-sizing: border-box;
|
|
8
|
+
@mixin reset-p {
|
|
10
9
|
margin-block: 0;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
.ams-error-message {
|
|
13
|
+
box-sizing: border-box;
|
|
14
14
|
color: var(--ams-error-message-color);
|
|
15
|
+
display: inline-flex;
|
|
15
16
|
font-family: var(--ams-error-message-font-family);
|
|
16
17
|
font-size: var(--ams-error-message-font-size);
|
|
17
18
|
font-weight: var(--ams-error-message-font-weight);
|
|
19
|
+
gap: var(--ams-error-message-gap);
|
|
18
20
|
line-height: var(--ams-error-message-line-height);
|
|
19
21
|
|
|
20
22
|
@include text-rendering;
|
|
21
|
-
@include reset;
|
|
23
|
+
@include reset-p;
|
|
22
24
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
7
|
-
@
|
|
6
|
+
@use "../../common/hyphenation" as *;
|
|
7
|
+
@use "../../common/text-rendering" as *;
|
|
8
8
|
|
|
9
|
-
@mixin reset {
|
|
9
|
+
@mixin reset-fieldset {
|
|
10
10
|
border: 0;
|
|
11
11
|
margin-inline: 0;
|
|
12
12
|
padding-block: 0;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.ams-field-set {
|
|
17
17
|
break-inside: avoid;
|
|
18
18
|
|
|
19
|
-
@include reset;
|
|
19
|
+
@include reset-fieldset;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.ams-field-set--invalid {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use "../../common/text-rendering" as *;
|
|
7
|
+
|
|
8
|
+
@mixin reset-figure {
|
|
9
|
+
margin-block: 0;
|
|
10
|
+
margin-inline: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ams-figure {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--ams-figure-gap);
|
|
17
|
+
|
|
18
|
+
@include reset-figure;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ams-figure__caption {
|
|
22
|
+
color: var(--ams-figure-caption-color);
|
|
23
|
+
font-family: var(--ams-figure-caption-font-family);
|
|
24
|
+
font-size: var(--ams-figure-caption-font-size);
|
|
25
|
+
font-weight: var(--ams-figure-caption-font-weight);
|
|
26
|
+
line-height: var(--ams-figure-caption-line-height);
|
|
27
|
+
|
|
28
|
+
@include text-rendering;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ams-figure__caption--inverse-color {
|
|
32
|
+
color: var(--ams-figure-caption-inverse-color);
|
|
33
|
+
}
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@use "../../common/text-rendering" as *;
|
|
7
7
|
|
|
8
8
|
@mixin reset-button {
|
|
9
9
|
border: 0;
|
|
10
10
|
border-radius: 0; // Reset rounded borders on iOS devices
|
|
11
|
-
box-sizing: border-box;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.ams-file-input {
|
|
15
14
|
background-color: var(--ams-file-input-background-color);
|
|
16
15
|
border: var(--ams-file-input-border);
|
|
16
|
+
box-sizing: border-box;
|
|
17
17
|
color: var(--ams-file-input-color);
|
|
18
18
|
cursor: var(--ams-file-input-cursor);
|
|
19
19
|
font-family: var(--ams-file-input-font-family);
|
|
20
20
|
font-size: var(--ams-file-input-font-size);
|
|
21
21
|
font-weight: var(--ams-file-input-font-weight);
|
|
22
|
+
inline-size: 100%;
|
|
22
23
|
line-height: var(--ams-file-input-line-height);
|
|
23
|
-
max-inline-size: calc(100% - var(--ams-file-input-padding-inline) * 2);
|
|
24
24
|
outline-offset: calc(var(--ams-focus-outline-offset) * 2); // Compensate for the dashed border
|
|
25
25
|
padding-block: var(--ams-file-input-padding-block);
|
|
26
26
|
padding-inline: var(--ams-file-input-padding-inline);
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
|
|
40
40
|
background-color: var(--ams-file-input-file-selector-button-background-color);
|
|
41
41
|
box-shadow: var(--ams-file-input-file-selector-button-box-shadow);
|
|
42
|
+
box-sizing: border-box;
|
|
42
43
|
color: var(--ams-file-input-file-selector-button-color);
|
|
43
44
|
cursor: var(--ams-file-input-file-selector-button-cursor);
|
|
44
45
|
font-family: inherit;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use "../../common/text-rendering" as *;
|
|
7
|
+
|
|
8
|
+
@mixin reset-ul {
|
|
9
|
+
list-style: none;
|
|
10
|
+
margin-block: 0;
|
|
11
|
+
padding-inline: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ams-file-list {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--ams-file-list-gap);
|
|
18
|
+
padding-block: var(--ams-file-list-padding-block);
|
|
19
|
+
|
|
20
|
+
@include text-rendering;
|
|
21
|
+
@include reset-ul;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ams-file-list__item {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
font-family: var(--ams-file-list-file-font-family);
|
|
28
|
+
font-size: var(--ams-file-list-file-font-size);
|
|
29
|
+
font-weight: var(--ams-file-list-file-font-weight);
|
|
30
|
+
gap: var(--ams-file-list-file-gap);
|
|
31
|
+
line-height: var(--ams-file-list-file-line-height);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ams-file-list__item-preview {
|
|
35
|
+
display: grid;
|
|
36
|
+
flex: 0 0 var(--ams-file-list-file-preview-width);
|
|
37
|
+
place-items: center;
|
|
38
|
+
|
|
39
|
+
img {
|
|
40
|
+
inline-size: 100%;
|
|
41
|
+
min-block-size: auto;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ams-file-list__item-info {
|
|
46
|
+
flex: 1;
|
|
47
|
+
gap: var(--ams-file-list-file-gap);
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ams-file-input__item-details {
|
|
54
|
+
color: var(--ams-file-list-file-details-color);
|
|
55
|
+
}
|
|
@@ -6,17 +6,17 @@ Provides service information at the bottom of every page.
|
|
|
6
6
|
|
|
7
7
|
## Guidelines
|
|
8
8
|
|
|
9
|
-
- The Footer consists of a
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- The Footer usually consists of two sections: a full-width blue area and a [Page Menu](/docs/components-navigation-page-menu--docs) below it.
|
|
10
|
+
- A Footer containing only a Page Menu can be sufficient for applications.
|
|
11
|
+
- The Footer must be used on all websites for the City of Amsterdam.
|
|
12
|
+
- It must be the same on every page.
|
|
13
13
|
|
|
14
|
-
The
|
|
14
|
+
The top section offers space for various practical links:
|
|
15
15
|
|
|
16
16
|
- The first column focuses on contact information.
|
|
17
17
|
The information is as specific as possible and tailored to the respective website or page (e.g., including a chat option if available).
|
|
18
18
|
- The second column contains links to relevant (online) sites or sources.
|
|
19
19
|
- The third column refers to newsletters, social media, etc.
|
|
20
20
|
|
|
21
|
-
The menu
|
|
21
|
+
The menu in the bottom section is for links to privacy policies, cookie statements, information about the website itself, etc.
|
|
22
22
|
Contact details should not go here.
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "../../common/size" as *;
|
|
7
8
|
|
|
8
9
|
[class|="ams-gap-"] {
|
|
9
10
|
display: grid !important;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
@each $size in map
|
|
13
|
+
@each $size in map.keys($ams-sizes) {
|
|
13
14
|
@if $size != "no" {
|
|
14
15
|
.ams-gap--#{$size} {
|
|
15
16
|
grid-gap: var(--ams-gap-#{$size}) !important;
|
|
@@ -11,13 +11,15 @@ Includes the name of the application if it is not the general website.
|
|
|
11
11
|
- It includes the logo of the City or the organization, the site title (except for the general website), and a menu with links to commonly used pages.
|
|
12
12
|
- The Header is important because it conveys our corporate identity and is the first thing people see.
|
|
13
13
|
Using it consistently helps users recognize and trust the website.
|
|
14
|
-
-
|
|
15
|
-
- The
|
|
14
|
+
- The Header is the same on every page of the application, although full-screen pages may hide it, e.g. a video or a map.
|
|
15
|
+
- The inline menu can contain a maximum of 5 items.
|
|
16
16
|
The last two will often be ‘Search’ and ‘Menu’.
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- The 'Menu' button opens a collapsible menu, which has room for more links.
|
|
18
|
+
- On narrow windows, links can move from the inline menu to the collapsible one.
|
|
19
|
+
- Labels should be short to help the inline menu fit on a single line whenever possible.
|
|
20
|
+
- An icon can be added to the end of a link to make its destination easier to guess.
|
|
19
21
|
|
|
20
22
|
## References
|
|
21
23
|
|
|
22
|
-
- A Header is a [landmark](https://www.w3.org/TR/wai-aria-practices-1.1/#aria_landmark_roles) and can be
|
|
24
|
+
- A Header is a [landmark](https://www.w3.org/TR/wai-aria-practices-1.1/#aria_landmark_roles) and can be used to group navigation elements.
|
|
23
25
|
- [WCAG 3.2.3](https://wcag.com/designers/3-2-3-consistent-navigation/) Consistent Navigation: Navigation menus that appear on multiple pages are consistent.
|
|
@@ -3,84 +3,214 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@use "../../common/breakpoint" as *;
|
|
7
|
+
@use "../../common/text-rendering" as *;
|
|
7
8
|
|
|
8
9
|
.ams-header {
|
|
10
|
+
/*
|
|
11
|
+
* The branding section is created twice: once outside the navigation and once hidden inside it.
|
|
12
|
+
* This keeps all navigation in one nav element and lets the menu wrap around the branding section.
|
|
13
|
+
* Display grid is used to let both branding sections overlap.
|
|
14
|
+
*/
|
|
15
|
+
display: grid;
|
|
16
|
+
padding-block: var(--ams-header-padding-block);
|
|
17
|
+
padding-inline: var(--ams-header-padding-inline);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ams-header__branding {
|
|
9
21
|
align-items: center;
|
|
22
|
+
align-self: start; // To align the branding section to the top of the header when it wraps
|
|
23
|
+
column-gap: var(--ams-header-branding-column-gap);
|
|
10
24
|
display: flex;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
row-gap: 1.5rem;
|
|
25
|
+
grid-area: 1 / 1; // To allow this section to overlap with the second branding section
|
|
26
|
+
}
|
|
14
27
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
28
|
+
.ams-header__branding--hidden {
|
|
29
|
+
opacity: 0%;
|
|
30
|
+
user-select: none; // The hidden branding section should not be selectable
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
.ams-header__logo-link {
|
|
22
|
-
flex: none;
|
|
23
34
|
outline-offset: var(--ams-header-logo-link-outline-offset);
|
|
24
35
|
}
|
|
25
36
|
|
|
26
|
-
.
|
|
27
|
-
|
|
37
|
+
/* TODO Remove after updating Heading line heights in DES-973. */
|
|
38
|
+
.ams-heading.ams-header__brand-name {
|
|
39
|
+
line-height: 1.35;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ams-header__navigation {
|
|
43
|
+
column-gap: var(--ams-header-navigation-column-gap);
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
grid-area: 1 / 1; // To allow this section to overlap with the branding section
|
|
47
|
+
// This section blocks pointer events initially, so the hidden branding section can't be activated.
|
|
48
|
+
// The menu and collapsible menu set it back to auto, to make sure they can be activated.
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
row-gap: var(--ams-header-navigation-row-gap);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@mixin reset-list {
|
|
54
|
+
list-style: none;
|
|
55
|
+
margin-block: 0;
|
|
56
|
+
padding-inline-start: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ams-header__menu {
|
|
60
|
+
align-items: center;
|
|
61
|
+
column-gap: var(--ams-header-menu-column-gap);
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
margin-inline-start: auto;
|
|
66
|
+
pointer-events: auto; // Set pointer events back to auto to allow the menu to be activated
|
|
67
|
+
row-gap: var(--ams-header-menu-row-gap);
|
|
28
68
|
|
|
29
|
-
@
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
@include reset-list;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Do not show menu items below the wide breakpoint...
|
|
73
|
+
.ams-header__menu-item {
|
|
74
|
+
@media screen and (not (min-width: $ams-breakpoint-wide)) {
|
|
75
|
+
display: none;
|
|
32
76
|
}
|
|
77
|
+
}
|
|
33
78
|
|
|
34
|
-
|
|
35
|
-
|
|
79
|
+
// ...unless they're fixed.
|
|
80
|
+
.ams-header__menu-item--fixed {
|
|
81
|
+
display: revert;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@mixin header-menu-action {
|
|
85
|
+
color: var(--ams-header-menu-item-color);
|
|
86
|
+
font-family: var(--ams-header-menu-item-font-family);
|
|
87
|
+
font-size: var(--ams-header-menu-item-font-size);
|
|
88
|
+
font-weight: var(--ams-header-menu-item-font-weight);
|
|
89
|
+
line-height: var(--ams-header-menu-item-line-height);
|
|
90
|
+
outline-offset: var(--ams-header-menu-item-outline-offset);
|
|
91
|
+
padding-block: var(--ams-header-menu-item-padding-block);
|
|
92
|
+
touch-action: manipulation;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
|
|
95
|
+
@include text-rendering;
|
|
96
|
+
|
|
97
|
+
&:hover {
|
|
98
|
+
color: var(--ams-header-menu-item-hover-color);
|
|
36
99
|
}
|
|
37
100
|
}
|
|
38
101
|
|
|
39
|
-
.ams-header__menu {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
text-
|
|
102
|
+
.ams-header__menu-link {
|
|
103
|
+
display: inline-block;
|
|
104
|
+
text-decoration-line: var(--ams-header-menu-link-text-decoration-line);
|
|
105
|
+
text-decoration-thickness: var(--ams-header-menu-link-text-decoration-thickness);
|
|
106
|
+
text-underline-offset: var(--ams-header-menu-link-text-underline-offset);
|
|
107
|
+
|
|
108
|
+
@include header-menu-action;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
text-decoration-line: var(--ams-header-menu-link-hover-text-decoration-line);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
43
114
|
|
|
115
|
+
.ams-header__mega-menu-button-item--hide-on-wide-window {
|
|
44
116
|
@media screen and (min-width: $ams-breakpoint-wide) {
|
|
45
|
-
|
|
46
|
-
padding-inline-start: 0;
|
|
117
|
+
display: none;
|
|
47
118
|
}
|
|
48
119
|
}
|
|
49
120
|
|
|
50
|
-
|
|
51
|
-
|
|
121
|
+
@mixin reset-button {
|
|
122
|
+
background: none;
|
|
123
|
+
border: 0;
|
|
124
|
+
margin-block: 0; // [1]
|
|
125
|
+
margin-inline: 0; // [1]
|
|
126
|
+
padding-inline: 0;
|
|
52
127
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
128
|
+
// [1] Remove the margin in older Safari.
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ams-header__mega-menu-button {
|
|
132
|
+
column-gap: var(--ams-header-menu-item-column-gap);
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-auto-flow: column;
|
|
136
|
+
|
|
137
|
+
@include header-menu-action;
|
|
138
|
+
@include reset-button;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ams-header__mega-menu-button[aria-expanded="true"] {
|
|
142
|
+
font-weight: var(--ams-header-mega-menu-button-label-open-font-weight);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.ams-header__mega-menu-button-label,
|
|
146
|
+
.ams-header__mega-menu-button-hidden-label {
|
|
147
|
+
grid-area: 1 / 1; // To allow the label and the hidden label to overlap
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// This hidden label is used to prevent a layout shift when the mega menu is opened
|
|
151
|
+
// and the button text becomes bold.
|
|
152
|
+
.ams-header__mega-menu-button-hidden-label {
|
|
153
|
+
font-weight: var(--ams-header-mega-menu-button-label-open-font-weight);
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
user-select: none;
|
|
156
|
+
visibility: hidden;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ams-header__menu-icon {
|
|
160
|
+
line {
|
|
161
|
+
stroke: currentColor;
|
|
162
|
+
stroke-width: 3px;
|
|
163
|
+
transform-origin: center;
|
|
164
|
+
transition:
|
|
165
|
+
translate 0.1s ease-in-out,
|
|
166
|
+
rotate 0.2s ease-in-out,
|
|
167
|
+
opacity 0.1s ease-in-out;
|
|
168
|
+
|
|
169
|
+
@media (prefers-reduced-motion) {
|
|
170
|
+
transition: none;
|
|
64
171
|
}
|
|
65
172
|
}
|
|
173
|
+
|
|
174
|
+
.ams-header__menu-icon-top {
|
|
175
|
+
translate: 0 -7px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ams-header__menu-icon-bottom {
|
|
179
|
+
translate: 0 7px;
|
|
180
|
+
}
|
|
66
181
|
}
|
|
67
182
|
|
|
68
|
-
|
|
69
|
-
.ams-header__menu-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
183
|
+
.ams-header__menu-icon--open {
|
|
184
|
+
.ams-header__menu-icon-top {
|
|
185
|
+
rotate: 45deg;
|
|
186
|
+
translate: 0;
|
|
187
|
+
}
|
|
188
|
+
.ams-header__menu-icon-middle {
|
|
189
|
+
opacity: 0%;
|
|
190
|
+
}
|
|
191
|
+
.ams-header__menu-icon-bottom {
|
|
192
|
+
rotate: -45deg;
|
|
193
|
+
translate: 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ams-header__mega-menu {
|
|
198
|
+
inline-size: 100%;
|
|
199
|
+
pointer-events: auto; // Set pointer events back to auto to allow the mega menu to be activated
|
|
200
|
+
|
|
201
|
+
// Remove inline padding from Grids that are used in the mega menu.
|
|
202
|
+
// The grid inline padding is set on the header element.
|
|
203
|
+
& .ams-grid {
|
|
204
|
+
padding-inline: 0;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.ams-header__mega-menu--closed.ams-header__mega-menu--closed {
|
|
209
|
+
display: none;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.ams-header__grid-cell-narrow-window-only {
|
|
213
|
+
@media screen and (min-width: $ams-breakpoint-wide) {
|
|
214
|
+
display: none;
|
|
215
|
+
}
|
|
86
216
|
}
|