@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.
Files changed (148) hide show
  1. package/CHANGELOG.md +39 -2
  2. package/README.md +1 -1
  3. package/dist/alert/alert.css +1 -1
  4. package/dist/alert/alert.css.map +1 -1
  5. package/dist/aspect-ratio/aspect-ratio.css +1 -1
  6. package/dist/aspect-ratio/aspect-ratio.css.map +1 -1
  7. package/dist/blockquote/blockquote.css +1 -1
  8. package/dist/blockquote/blockquote.css.map +1 -1
  9. package/dist/breadcrumb/breadcrumb.css +1 -1
  10. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  11. package/dist/breakout/breakout.css.map +1 -1
  12. package/dist/date-input/date-input.css +1 -1
  13. package/dist/date-input/date-input.css.map +1 -1
  14. package/dist/description-list/description-list.css +1 -1
  15. package/dist/description-list/description-list.css.map +1 -1
  16. package/dist/dialog/dialog.css +1 -1
  17. package/dist/dialog/dialog.css.map +1 -1
  18. package/dist/error-message/error-message.css +1 -1
  19. package/dist/error-message/error-message.css.map +1 -1
  20. package/dist/figure/figure.css +1 -0
  21. package/dist/figure/figure.css.map +1 -0
  22. package/dist/file-input/file-input.css +1 -1
  23. package/dist/file-input/file-input.css.map +1 -1
  24. package/dist/file-list/file-list.css +1 -0
  25. package/dist/file-list/file-list.css.map +1 -0
  26. package/dist/footer/footer.css +1 -0
  27. package/dist/footer/footer.css.map +1 -0
  28. package/dist/gap/gap.css.map +1 -1
  29. package/dist/grid/grid.css.map +1 -1
  30. package/dist/header/header.css +1 -1
  31. package/dist/header/header.css.map +1 -1
  32. package/dist/heading/heading.css +1 -1
  33. package/dist/heading/heading.css.map +1 -1
  34. package/dist/icon/icon.css +1 -1
  35. package/dist/icon/icon.css.map +1 -1
  36. package/dist/image/image.css +1 -1
  37. package/dist/image/image.css.map +1 -1
  38. package/dist/index.css +1 -1
  39. package/dist/index.css.map +1 -1
  40. package/dist/link-list/link-list.css +1 -1
  41. package/dist/link-list/link-list.css.map +1 -1
  42. package/dist/logo/logo.css +1 -1
  43. package/dist/logo/logo.css.map +1 -1
  44. package/dist/margin/margin.css.map +1 -1
  45. package/dist/ordered-list/ordered-list.css +1 -1
  46. package/dist/ordered-list/ordered-list.css.map +1 -1
  47. package/dist/overlap/overlap.css +1 -1
  48. package/dist/overlap/overlap.css.map +1 -1
  49. package/dist/page-heading/page-heading.css +1 -1
  50. package/dist/page-heading/page-heading.css.map +1 -1
  51. package/dist/page-menu/page-menu.css +1 -1
  52. package/dist/page-menu/page-menu.css.map +1 -1
  53. package/dist/pagination/pagination.css +1 -1
  54. package/dist/pagination/pagination.css.map +1 -1
  55. package/dist/paragraph/paragraph.css +1 -1
  56. package/dist/paragraph/paragraph.css.map +1 -1
  57. package/dist/password-input/password-input.css +1 -1
  58. package/dist/password-input/password-input.css.map +1 -1
  59. package/dist/radio/radio.css +1 -1
  60. package/dist/radio/radio.css.map +1 -1
  61. package/dist/screen/screen.css +1 -1
  62. package/dist/screen/screen.css.map +1 -1
  63. package/dist/search-field/search-field.css +1 -1
  64. package/dist/search-field/search-field.css.map +1 -1
  65. package/dist/spotlight/spotlight.css +1 -1
  66. package/dist/spotlight/spotlight.css.map +1 -1
  67. package/dist/switch/switch.css +1 -1
  68. package/dist/switch/switch.css.map +1 -1
  69. package/dist/table-of-contents/table-of-contents.css +1 -1
  70. package/dist/table-of-contents/table-of-contents.css.map +1 -1
  71. package/dist/tabs/tabs.css +1 -1
  72. package/dist/tabs/tabs.css.map +1 -1
  73. package/dist/text-area/text-area.css +1 -1
  74. package/dist/text-area/text-area.css.map +1 -1
  75. package/dist/text-input/text-input.css +1 -1
  76. package/dist/text-input/text-input.css.map +1 -1
  77. package/dist/time-input/time-input.css +1 -1
  78. package/dist/time-input/time-input.css.map +1 -1
  79. package/dist/top-task-link/top-task-link.css +1 -1
  80. package/dist/top-task-link/top-task-link.css.map +1 -1
  81. package/dist/unordered-list/unordered-list.css +1 -1
  82. package/dist/unordered-list/unordered-list.css.map +1 -1
  83. package/documentation/coding-conventions.md +5 -1
  84. package/package.json +4 -4
  85. package/src/components/accordion/accordion.scss +1 -1
  86. package/src/components/alert/alert.scss +1 -0
  87. package/src/components/aspect-ratio/README.md +15 -11
  88. package/src/components/aspect-ratio/aspect-ratio.scss +5 -26
  89. package/src/components/blockquote/blockquote.scss +5 -5
  90. package/src/components/breadcrumb/breadcrumb.scss +4 -4
  91. package/src/components/breakout/breakout.scss +3 -3
  92. package/src/components/button/button.scss +1 -1
  93. package/src/components/character-count/character-count.scss +1 -1
  94. package/src/components/checkbox/checkbox.scss +3 -3
  95. package/src/components/column/column.scss +1 -1
  96. package/src/components/date-input/date-input.scss +4 -4
  97. package/src/components/description-list/description-list.scss +34 -12
  98. package/src/components/dialog/dialog.scss +1 -1
  99. package/src/components/error-message/error-message.scss +6 -4
  100. package/src/components/field-set/field-set.scss +4 -4
  101. package/src/components/figure/README.md +5 -0
  102. package/src/components/figure/figure.scss +33 -0
  103. package/src/components/file-input/file-input.scss +4 -3
  104. package/src/components/file-list/README.md +5 -0
  105. package/src/components/file-list/file-list.scss +55 -0
  106. package/src/components/footer/README.md +6 -6
  107. package/src/components/footer/footer.scss +8 -0
  108. package/src/components/gap/gap.scss +3 -2
  109. package/src/components/grid/_mixins.scss +2 -0
  110. package/src/components/grid/grid.scss +2 -2
  111. package/src/components/header/README.md +7 -5
  112. package/src/components/header/header.scss +183 -53
  113. package/src/components/heading/heading.scss +5 -5
  114. package/src/components/icon/icon.scss +4 -0
  115. package/src/components/icon-button/icon-button.scss +2 -2
  116. package/src/components/image/README.md +27 -5
  117. package/src/components/image/image.scss +4 -4
  118. package/src/components/image-slider/image-slider.scss +1 -1
  119. package/src/components/index.scss +66 -63
  120. package/src/components/label/label.scss +2 -2
  121. package/src/components/link/link.scss +1 -1
  122. package/src/components/link-list/link-list.scss +5 -5
  123. package/src/components/logo/README.md +1 -1
  124. package/src/components/logo/logo.scss +1 -0
  125. package/src/components/margin/margin.scss +3 -2
  126. package/src/components/ordered-list/ordered-list.scss +4 -4
  127. package/src/components/overlap/overlap.scss +2 -1
  128. package/src/components/page-heading/page-heading.scss +5 -5
  129. package/src/components/page-menu/page-menu.scss +6 -9
  130. package/src/components/pagination/pagination.scss +4 -4
  131. package/src/components/paragraph/paragraph.scss +4 -4
  132. package/src/components/password-input/password-input.scss +4 -4
  133. package/src/components/radio/radio.scss +28 -6
  134. package/src/components/row/row.scss +1 -1
  135. package/src/components/screen/screen.scss +1 -6
  136. package/src/components/search-field/search-field.scss +2 -28
  137. package/src/components/select/select.scss +2 -2
  138. package/src/components/skip-link/README.md +11 -13
  139. package/src/components/spotlight/README.md +2 -0
  140. package/src/components/spotlight/spotlight.scss +4 -4
  141. package/src/components/switch/switch.scss +3 -8
  142. package/src/components/table-of-contents/table-of-contents.scss +4 -4
  143. package/src/components/tabs/tabs.scss +24 -5
  144. package/src/components/text-area/text-area.scss +4 -4
  145. package/src/components/text-input/text-input.scss +4 -4
  146. package/src/components/time-input/time-input.scss +4 -4
  147. package/src/components/top-task-link/top-task-link.scss +4 -9
  148. package/src/components/unordered-list/unordered-list.scss +4 -4
@@ -3,15 +3,19 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
- @import "../../common/breakpoint";
7
- @import "../../common/text-rendering";
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
- @mixin reset-description {
58
- margin-inline: 0;
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-description;
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
- @import "../../common/text-rendering";
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
- @import "../../common/hyphenation";
7
- @import "../../common/text-rendering";
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,5 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Figure
4
+
5
+ Groups media content with a caption that describes it.
@@ -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
- @import "../../common/text-rendering";
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,5 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # File List
4
+
5
+ An overview of files, showing their name, type, size, and a preview.
@@ -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 dark blue [Spotlight](/docs/components-containers-spotlight--docs) and a [Page Menu](/docs/components-navigation-page-menu--docs).
10
- It must be used on all websites for the City of Amsterdam.
11
- - For applications, only the Page Menu can be sufficient.
12
- - The Footer is the same on every page of the application.
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 Spotlight offers space for various practical links:
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 at the very bottom is intended for links to privacy policies, cookie statements, information about the website itself, etc.
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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ .ams-footer__top {
7
+ background-color: var(--ams-footer-top-background-color);
8
+ }
@@ -3,13 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
- @import "../../common/size";
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-keys($ams-sizes) {
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;
@@ -1,3 +1,5 @@
1
+ @use "../../common/breakpoint" as *;
2
+
1
3
  /**
2
4
  * @license EUPL-1.2+
3
5
  * Copyright Gemeente Amsterdam
@@ -3,8 +3,8 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
- @import "../../common/breakpoint";
7
- @import "mixins";
6
+ @use "../../common/breakpoint" as *;
7
+ @use "mixins" as *;
8
8
 
9
9
  $ams-grid-column-count: 12;
10
10
 
@@ -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
- - It is the same on every page of the application.
15
- - The page menu can contain a maximum of 5 items.
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
- - Labels should be short to ensure the menu fits on one line, even on medium-wide screens.
18
- - An icon can be added to the end of a link to make its function easier to find.
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 use to group navigation elements.
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
- @import "../../common/breakpoint";
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
- flex-wrap: wrap;
12
- padding-block: var(--ams-header-padding-block);
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
- @media screen and (min-width: $ams-breakpoint-wide) {
16
- column-gap: var(--ams-header-column-gap);
17
- flex-wrap: nowrap;
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
- .ams-header__links {
27
- display: none;
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
- @media screen and (min-width: $ams-breakpoint-medium) {
30
- display: block;
31
- flex: 10 0 auto;
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
- @media screen and (min-width: $ams-breakpoint-wide) {
35
- order: 3;
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
- flex: 1;
41
- padding-inline-start: var(--ams-page-menu-column-gap); // TODO Don’t use tokens of another component
42
- text-align: end;
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
- order: 4;
46
- padding-inline-start: 0;
117
+ display: none;
47
118
  }
48
119
  }
49
120
 
50
- .ams-header__app-name {
51
- flex: 1 1 100%;
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
- @media screen and (min-width: $ams-breakpoint-wide) {
54
- min-inline-size: 0;
55
- order: 2;
56
-
57
- .ams-header__app-name-heading {
58
- display: block;
59
- inline-size: 100%;
60
- line-height: 1;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- white-space: nowrap;
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
- // Temporary – will move to Mega Menu and/or Icon Button
69
- .ams-header__menu-button {
70
- background-color: transparent;
71
- background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23004699' fill-rule='evenodd' d='M0 3.238h32V7.81H0V3.238zm0 10.476h32v4.572H0v-4.572zM0 24.19h32v4.572H0V24.19z'/></svg>");
72
- background-position: center right;
73
- background-repeat: no-repeat;
74
- background-size: 1.1875rem 1.1875rem;
75
- border: 0;
76
- color: var(--ams-page-menu-item-color);
77
- font-family: var(--ams-page-menu-item-font-family);
78
- font-size: var(--ams-page-menu-item-font-size);
79
- font-weight: var(--ams-page-menu-item-font-weight);
80
- line-height: var(--ams-page-menu-item-line-height);
81
- margin-block: 0;
82
- margin-inline: 0;
83
- padding-inline: 0 1.875rem;
84
- text-align: center;
85
- touch-action: manipulation;
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
  }