@amsterdam/design-system-css 0.8.0 → 0.10.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/accordion/accordion.css +1 -1
  3. package/dist/accordion/accordion.css.map +1 -1
  4. package/dist/avatar/avatar.css +1 -1
  5. package/dist/avatar/avatar.css.map +1 -1
  6. package/dist/badge/badge.css +1 -1
  7. package/dist/badge/badge.css.map +1 -1
  8. package/dist/breadcrumb/breadcrumb.css +1 -1
  9. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  10. package/dist/button/button.css +1 -1
  11. package/dist/button/button.css.map +1 -1
  12. package/dist/card/card.css +1 -1
  13. package/dist/card/card.css.map +1 -1
  14. package/dist/checkbox/checkbox.css +1 -1
  15. package/dist/checkbox/checkbox.css.map +1 -1
  16. package/dist/date-input/date-input.css +1 -1
  17. package/dist/date-input/date-input.css.map +1 -1
  18. package/dist/dialog/dialog.css +1 -1
  19. package/dist/dialog/dialog.css.map +1 -1
  20. package/dist/error-message/error-message.css +1 -0
  21. package/dist/error-message/error-message.css.map +1 -0
  22. package/dist/field/field.css +1 -0
  23. package/dist/field/field.css.map +1 -0
  24. package/dist/field-set/field-set.css +1 -0
  25. package/dist/field-set/field-set.css.map +1 -0
  26. package/dist/file-input/file-input.css +1 -0
  27. package/dist/file-input/file-input.css.map +1 -0
  28. package/dist/header/header.css +1 -1
  29. package/dist/header/header.css.map +1 -1
  30. package/dist/icon/icon.css +1 -1
  31. package/dist/icon/icon.css.map +1 -1
  32. package/dist/image/image.css +1 -1
  33. package/dist/image/image.css.map +1 -1
  34. package/dist/index.css +1 -1
  35. package/dist/index.css.map +1 -1
  36. package/dist/link-list/link-list.css +1 -1
  37. package/dist/link-list/link-list.css.map +1 -1
  38. package/dist/logo/logo.css +1 -1
  39. package/dist/logo/logo.css.map +1 -1
  40. package/dist/ordered-list/ordered-list.css +1 -1
  41. package/dist/ordered-list/ordered-list.css.map +1 -1
  42. package/dist/pagination/pagination.css +1 -1
  43. package/dist/pagination/pagination.css.map +1 -1
  44. package/dist/paragraph/paragraph.css +1 -1
  45. package/dist/paragraph/paragraph.css.map +1 -1
  46. package/dist/radio/radio.css +1 -1
  47. package/dist/radio/radio.css.map +1 -1
  48. package/dist/screen/screen.css +1 -1
  49. package/dist/screen/screen.css.map +1 -1
  50. package/dist/search-field/search-field.css +1 -1
  51. package/dist/search-field/search-field.css.map +1 -1
  52. package/dist/select/select.css +1 -1
  53. package/dist/select/select.css.map +1 -1
  54. package/dist/switch/switch.css +1 -1
  55. package/dist/switch/switch.css.map +1 -1
  56. package/dist/table/table.css +1 -1
  57. package/dist/table/table.css.map +1 -1
  58. package/dist/table-of-contents/table-of-contents.css +1 -0
  59. package/dist/table-of-contents/table-of-contents.css.map +1 -0
  60. package/dist/tabs/tabs.css +1 -1
  61. package/dist/tabs/tabs.css.map +1 -1
  62. package/dist/text-area/text-area.css +1 -1
  63. package/dist/text-area/text-area.css.map +1 -1
  64. package/dist/text-input/text-input.css +1 -1
  65. package/dist/text-input/text-input.css.map +1 -1
  66. package/dist/time-input/time-input.css +1 -1
  67. package/dist/time-input/time-input.css.map +1 -1
  68. package/dist/unordered-list/unordered-list.css +1 -1
  69. package/dist/unordered-list/unordered-list.css.map +1 -1
  70. package/dist/visually-hidden/visually-hidden.css +1 -1
  71. package/dist/visually-hidden/visually-hidden.css.map +1 -1
  72. package/documentation/coding-conventions.md +10 -4
  73. package/package.json +6 -3
  74. package/src/common/hide-input.scss +1 -1
  75. package/src/components/accordion/accordion.scss +2 -1
  76. package/src/components/alert/README.md +1 -1
  77. package/src/components/aspect-ratio/README.md +3 -3
  78. package/src/components/avatar/avatar.scss +32 -7
  79. package/src/components/badge/badge.scss +35 -5
  80. package/src/components/breadcrumb/breadcrumb.scss +9 -9
  81. package/src/components/button/button.scss +1 -0
  82. package/src/components/card/card.scss +1 -1
  83. package/src/components/checkbox/checkbox.scss +4 -4
  84. package/src/components/date-input/date-input.scss +6 -7
  85. package/src/components/dialog/README.md +7 -0
  86. package/src/components/dialog/dialog.scss +7 -7
  87. package/src/components/error-message/README.md +11 -0
  88. package/src/components/error-message/error-message.scss +22 -0
  89. package/src/components/field/README.md +9 -0
  90. package/src/components/field/field.scss +16 -0
  91. package/src/components/field-set/README.md +17 -0
  92. package/src/components/field-set/field-set.scss +52 -0
  93. package/src/components/file-input/README.md +9 -0
  94. package/src/components/file-input/file-input.scss +69 -0
  95. package/src/components/footer/README.md +11 -6
  96. package/src/components/form-error-list/README.md +35 -0
  97. package/src/components/header/README.md +13 -4
  98. package/src/components/header/header.scss +7 -7
  99. package/src/components/icon/README.md +4 -0
  100. package/src/components/icon/icon.scss +12 -12
  101. package/src/components/image/image.scss +3 -3
  102. package/src/components/index.scss +5 -1
  103. package/src/components/link-list/link-list.scss +2 -2
  104. package/src/components/logo/logo.scss +1 -1
  105. package/src/components/ordered-list/ordered-list.scss +5 -0
  106. package/src/components/pagination/README.md +1 -0
  107. package/src/components/pagination/pagination.scss +2 -2
  108. package/src/components/paragraph/paragraph.scss +2 -2
  109. package/src/components/radio/radio.scss +4 -4
  110. package/src/components/screen/screen.scss +3 -3
  111. package/src/components/search-field/search-field.scss +16 -6
  112. package/src/components/select/select.scss +8 -6
  113. package/src/components/switch/switch.scss +12 -9
  114. package/src/components/table/table.scss +1 -1
  115. package/src/components/table-of-contents/README.md +6 -0
  116. package/src/components/table-of-contents/table-of-contents.scss +50 -0
  117. package/src/components/tabs/tabs.scss +1 -1
  118. package/src/components/text-area/text-area.scss +9 -5
  119. package/src/components/text-input/README.md +2 -2
  120. package/src/components/text-input/text-input.scss +6 -2
  121. package/src/components/time-input/time-input.scss +7 -8
  122. package/src/components/unordered-list/unordered-list.scss +5 -0
  123. package/src/components/visually-hidden/visually-hidden.scss +2 -2
  124. package/dist/fieldset/fieldset.css +0 -1
  125. package/dist/fieldset/fieldset.css.map +0 -1
  126. package/src/components/fieldset/README.md +0 -18
  127. package/src/components/fieldset/fieldset.scss +0 -35
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ @import "../../common/text-rendering";
7
+
8
+ @mixin reset-button {
9
+ border: 0;
10
+ border-radius: 0; // Reset rounded borders on iOS devices
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ .ams-file-input {
15
+ background-color: var(--ams-file-input-background-color);
16
+ border: var(--ams-file-input-border);
17
+ color: var(--ams-file-input-color);
18
+ cursor: var(--ams-file-input-cursor);
19
+ font-family: var(--ams-file-input-font-family);
20
+ font-size: var(--ams-file-input-font-size);
21
+ font-weight: var(--ams-file-input-font-weight);
22
+ line-height: var(--ams-file-input-line-height);
23
+ max-inline-size: calc(100% - var(--ams-file-input-padding-inline) * 2);
24
+ outline-offset: 0.25rem; // Double the default focus outline offset to compensate for the dashed border
25
+ padding-block: var(--ams-file-input-padding-block);
26
+ padding-inline: var(--ams-file-input-padding-inline);
27
+ touch-action: manipulation;
28
+
29
+ @include text-rendering;
30
+ }
31
+
32
+ .ams-file-input:disabled {
33
+ color: var(--ams-file-input-disabled-color);
34
+ cursor: var(--ams-file-input-disabled-cursor);
35
+ }
36
+
37
+ .ams-file-input::file-selector-button {
38
+ -webkit-appearance: none; // Reset appearance for Safari < 15.4
39
+ appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
40
+ background-color: var(--ams-file-input-file-selector-button-background-color);
41
+ box-shadow: var(--ams-file-input-file-selector-button-box-shadow);
42
+ color: var(--ams-file-input-file-selector-button-color);
43
+ cursor: var(--ams-file-input-file-selector-button-cursor);
44
+ font-family: inherit;
45
+ font-size: inherit; // iOS specific fix
46
+ font-weight: inherit;
47
+ margin-inline-end: var(--ams-file-input-file-selector-button-margin-inline-end);
48
+ padding-block: var(--ams-file-input-file-selector-button-padding-block);
49
+ padding-inline: var(--ams-file-input-file-selector-button-padding-inline);
50
+
51
+ @media screen and (-ms-high-contrast: active), screen and (forced-colors: active) {
52
+ border: var(
53
+ --ams-file-input-file-selector-button-forced-color-mode-border
54
+ ); // add border because forced colors changes box-shadow to none
55
+ }
56
+
57
+ @include reset-button;
58
+ }
59
+
60
+ .ams-file-input:disabled::file-selector-button {
61
+ box-shadow: var(--ams-file-input-file-selector-button-disabled-box-shadow);
62
+ color: var(--ams-file-input-disabled-color);
63
+ cursor: var(--ams-file-input-file-selector-button-disabled-cursor);
64
+ }
65
+
66
+ .ams-file-input:not(:disabled):hover::file-selector-button {
67
+ box-shadow: var(--ams-file-input-file-selector-button-hover-box-shadow);
68
+ color: var(--ams-file-input-file-selector-button-hover-color);
69
+ }
@@ -2,16 +2,21 @@
2
2
 
3
3
  # Footer
4
4
 
5
- The footer is the closing section on every web page.
6
- Its content provides service information.
7
- A part is prescribed, and a part is filled based on the website’s objectives.
5
+ Provides service information at the bottom of every page.
8
6
 
9
7
  ## Guidelines
10
8
 
11
- - The footer is mandatory, and there is one on every page.
9
+ The Footer consists of a dark blue [Spotlight](/docs/components-containers-spotlight--docs) and a [Page Menu](?path=/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.
13
+
14
+ The Spotlight offers space for various practical links:
15
+
12
16
  - The first column focuses on contact information.
13
17
  The information is as specific as possible and tailored to the respective website or page (e.g., including a chat option if available).
14
18
  - The second column contains links to relevant (online) sites or sources.
15
19
  - The third column refers to newsletters, social media, etc.
16
- - The last part of the footer is intended for links to privacy policies, cookie statements, explanations about the website, etc.
17
- It is not intended for links to contact information, for example.
20
+
21
+ The menu at the very bottom is intended for links to privacy policies, cookie statements, information about the website itself, etc.
22
+ Contact details should not go here.
@@ -0,0 +1,35 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Form Error List
4
+
5
+ Use this component at the top of a page to summarise any errors a user has made.
6
+ When a user makes an error, you must show both a Form Error List and an Error Message above each answer that contains an error.
7
+
8
+ ## Guidelines
9
+
10
+ - Always show a Form Error List when there is a validation error, even if there’s only one.
11
+ - You must link the errors in the Form Error List to the answer they relate to (see below).
12
+
13
+ ## Linking from the Form Error List to each answer
14
+
15
+ For questions that require a user to answer using a single field, like a file upload, select, textarea, text input or character count, link to the `id` of that field.
16
+
17
+ When a user has to enter their answer into multiple fields, such as day, month and year fields, link to the `id` of the first field that contains an error.
18
+ If you do not know which field contains an error, link to the `id` of the first field.
19
+
20
+ For questions that require a user to select one or more options from a list using Radios or Checkboxes, link to the `id` of the first Radio or Checkbox.
21
+
22
+ ## Where to put the Form Error List
23
+
24
+ Put the Form Error List directly above the first question on the page. Place it outside of the `<form>`-tag, [to make sure screen readers do not skip it](https://nldesignsystem.nl/richtlijnen/formulieren/meerdere-stappen/#plaats-de-informatie-over-waar-de-gebruiker-is-in-de-stappen-boven-het-formulier).
25
+
26
+ ## Relevant WCAG requirements
27
+
28
+ Pay extra attention to these parts:
29
+
30
+ - [WCAG requirement 1.3.1](https://www.w3.org/TR/WCAG21/#info-and-relationships): the heading level of the Form Error List depends on where in the page it is placed, this may differ per page.
31
+
32
+ ## References
33
+
34
+ - [Show an error summary above the form - NL Design System](https://www.nldesignsystem.nl/richtlijnen/formulieren/foutmeldingen#zet-een-samenvatting-van-de-foutmeldingen-boven-het-formulier)
35
+ - [Error Summary component - Gov.uk](https://design-system.service.gov.uk/components/error-summary/)
@@ -2,13 +2,22 @@
2
2
 
3
3
  # Header
4
4
 
5
- Arranges the City’s logo, the title of the website, and a page menu.
5
+ Displays the City’s logo at the top of every page, and optionally a navigation menu.
6
+ Includes the name of the application if it is not the general website.
6
7
 
7
8
  ## Guidelines
8
9
 
9
- - Use the Header when the site is hosted on amsterdam.nl or one of its subdomains.
10
- - The page menu can contain a maximum of 5 items, including menu and search.
11
- - When you have a long subsite title, use no or as few page menu items as possible.
10
+ The Header must be used on all websites and applications for the City of Amsterdam.
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
+
13
+ The Header is important because it conveys our corporate identity and is the first thing people see.
14
+ Using it consistently helps users recognize and trust the website.
15
+ It is the same on every page of the application.
16
+
17
+ The page menu can contain a maximum of 5 items.
18
+ The last two will often be ‘Search’ and ‘Menu’.
19
+ Labels should be short to ensure the menu fits on one line, even on medium-wide screens.
20
+ An icon can be added to the end of a link to make its function easier to find.
12
21
 
13
22
  ## References
14
23
 
@@ -47,31 +47,31 @@
47
47
  }
48
48
  }
49
49
 
50
- .ams-header__title {
50
+ .ams-header__app-name {
51
51
  flex: 1 1 100%;
52
52
 
53
53
  @media screen and (min-width: $ams-breakpoint-wide) {
54
- min-width: 0;
54
+ min-inline-size: 0;
55
55
  order: 2;
56
56
 
57
- .ams-header__title-heading {
57
+ .ams-header__app-name-heading {
58
58
  display: block;
59
+ inline-size: 100%;
59
60
  line-height: 1;
60
61
  overflow: hidden;
61
62
  text-overflow: ellipsis;
62
63
  white-space: nowrap;
63
- width: 100%;
64
64
  }
65
65
  }
66
66
  }
67
67
 
68
- // Temporary, will move to megamenu (and/or iconButton)
68
+ // Temporary will move to Mega Menu and/or Icon Button
69
69
  .ams-header__menu-button {
70
70
  background-color: transparent;
71
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
72
  background-position: center right;
73
73
  background-repeat: no-repeat;
74
- background-size: 19px 19px;
74
+ background-size: 1.1875rem 1.1875rem;
75
75
  border: 0;
76
76
  color: var(--ams-page-menu-item-color);
77
77
  font-family: var(--ams-page-menu-item-font-family);
@@ -79,7 +79,7 @@
79
79
  font-weight: var(--ams-page-menu-item-font-weight);
80
80
  line-height: var(--ams-page-menu-item-line-height);
81
81
  margin-block: 0;
82
- padding-inline: 0 30px;
82
+ padding-inline: 0 1.875rem;
83
83
  text-align: center;
84
84
  touch-action: manipulation;
85
85
  }
@@ -29,3 +29,7 @@ Icons are aligned to the left of the text by default and vertically centred to t
29
29
  Icons use the same text levels as all typographic components to determine their size.
30
30
  This ensures easy alignment between icons and text.
31
31
  [Refer to the typography documentation for more information](/docs/docs-design-guidelines-typography--docs).
32
+
33
+ ## Overview
34
+
35
+ [You can find an overview of the available icons here](/docs/docs-assets-icons--docs).
@@ -18,37 +18,37 @@
18
18
  }
19
19
 
20
20
  .ams-icon--size-3 {
21
- height: calc(var(--ams-icon-size-3-font-size) * var(--ams-icon-size-3-line-height));
21
+ block-size: calc(var(--ams-icon-size-3-font-size) * var(--ams-icon-size-3-line-height));
22
22
  }
23
23
 
24
24
  .ams-icon--size-3 svg {
25
- height: var(--ams-icon-size-3-font-size);
26
- width: var(--ams-icon-size-3-font-size);
25
+ block-size: var(--ams-icon-size-3-font-size);
26
+ inline-size: var(--ams-icon-size-3-font-size);
27
27
  }
28
28
 
29
29
  .ams-icon--size-4 {
30
- height: calc(var(--ams-icon-size-4-font-size) * var(--ams-icon-size-4-line-height));
30
+ block-size: calc(var(--ams-icon-size-4-font-size) * var(--ams-icon-size-4-line-height));
31
31
  }
32
32
 
33
33
  .ams-icon--size-4 svg {
34
- height: var(--ams-icon-size-4-font-size);
35
- width: var(--ams-icon-size-4-font-size);
34
+ block-size: var(--ams-icon-size-4-font-size);
35
+ inline-size: var(--ams-icon-size-4-font-size);
36
36
  }
37
37
 
38
38
  .ams-icon--size-5 {
39
- height: calc(var(--ams-icon-size-5-font-size) * var(--ams-icon-size-5-line-height));
39
+ block-size: calc(var(--ams-icon-size-5-font-size) * var(--ams-icon-size-5-line-height));
40
40
  }
41
41
 
42
42
  .ams-icon--size-5 svg {
43
- height: var(--ams-icon-size-5-font-size);
44
- width: var(--ams-icon-size-5-font-size);
43
+ block-size: var(--ams-icon-size-5-font-size);
44
+ inline-size: var(--ams-icon-size-5-font-size);
45
45
  }
46
46
 
47
47
  .ams-icon--size-6 {
48
- height: calc(var(--ams-icon-size-6-font-size) * var(--ams-icon-size-6-line-height));
48
+ block-size: calc(var(--ams-icon-size-6-font-size) * var(--ams-icon-size-6-line-height));
49
49
  }
50
50
 
51
51
  .ams-icon--size-6 svg {
52
- height: var(--ams-icon-size-6-font-size);
53
- width: var(--ams-icon-size-6-font-size);
52
+ block-size: var(--ams-icon-size-6-font-size);
53
+ inline-size: var(--ams-icon-size-6-font-size);
54
54
  }
@@ -4,9 +4,9 @@
4
4
  */
5
5
 
6
6
  .ams-image {
7
+ block-size: auto; /* [1] */
7
8
  font-style: italic; /* [3] */
8
- height: auto; /* [1] */
9
- max-width: 100%; /* [1] */
9
+ max-inline-size: 100%; /* [1] */
10
10
  vertical-align: middle; /* [2] */
11
11
 
12
12
  &--cover {
@@ -14,7 +14,7 @@
14
14
  }
15
15
  }
16
16
 
17
- // [1] Allow for fluid image sizing while maintaining aspect ratio governed by width/height attributes
17
+ // [1] Allow for fluid image sizing while maintaining aspect ratio governed by inline/block size attributes
18
18
  // [2] Remove ‘phantom’ white space
19
19
  // [3] Italicise alt text to visually offset it from surrounding copy
20
20
  // Source: https://x.com/csswizardry/status/1717841334462005661
@@ -4,6 +4,10 @@
4
4
  */
5
5
 
6
6
  /* Append here */
7
+ @import "./table-of-contents/table-of-contents";
8
+ @import "./error-message/error-message";
9
+ @import "./file-input/file-input";
10
+ @import "./field/field";
7
11
  @import "./select/select";
8
12
  @import "./time-input/time-input";
9
13
  @import "./date-input/date-input";
@@ -18,7 +22,7 @@
18
22
  @import "./column/column";
19
23
  @import "./margin/margin";
20
24
  @import "./gap/gap";
21
- @import "./fieldset/fieldset";
25
+ @import "./field-set/field-set";
22
26
  @import "./link-list/link-list";
23
27
  @import "./badge/badge";
24
28
  @import "./table/table";
@@ -26,10 +26,10 @@
26
26
  color: var(--ams-link-list-link-color);
27
27
  display: inline-flex;
28
28
  font-family: var(--ams-link-list-link-font-family);
29
- font-size: var(--ams-link-list-link-medium-font-size);
29
+ font-size: var(--ams-link-list-link-font-size);
30
30
  font-weight: var(--ams-link-list-link-font-weight);
31
31
  gap: var(--ams-link-list-link-gap);
32
- line-height: var(--ams-link-list-link-medium-line-height);
32
+ line-height: var(--ams-link-list-link-line-height);
33
33
  outline-offset: var(--ams-link-list-link-outline-offset);
34
34
  text-decoration-line: var(--ams-link-list-link-text-decoration-line);
35
35
  text-decoration-thickness: var(--ams-link-list-link-text-decoration-thickness);
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  .ams-logo {
7
+ block-size: var(--ams-logo-block-size);
7
8
  display: block;
8
- height: var(--ams-logo-height);
9
9
  }
10
10
 
11
11
  .ams-logo__emblem {
@@ -42,6 +42,11 @@
42
42
  color: var(--ams-ordered-list-inverse-color);
43
43
  }
44
44
 
45
+ .ams-ordered-list--small:not(.ams-ordered-list--no-markers) {
46
+ font-size: var(--ams-ordered-list-small-font-size);
47
+ line-height: var(--ams-ordered-list-small-line-height);
48
+ }
49
+
45
50
  /** A nested list has a different marker and less indentation for correct alignment. */
46
51
  :is(.ams-ordered-list, .ams-unordered-list) .ams-ordered-list {
47
52
  list-style-type: var(--ams-ordered-list-ordered-list-list-style-type);
@@ -15,6 +15,7 @@ Pagination indicates the current page and allows users to navigate to other page
15
15
  - Redirect users to the first page if they enter a URL with a page number that doesn’t exist.
16
16
  - Pagination can be combined with a counter at the top of the page indicating “Page # of ##.”
17
17
  - Start a page with an overview list at the top after changing the page.
18
+ - Make sure that the visible and accessible labels for the ‘previous’ and ‘next’ buttons convey the same meaning at all times – e.g. don’t update one and forget the other.
18
19
 
19
20
  ## Relevant WCAG Rules
20
21
 
@@ -56,8 +56,8 @@
56
56
 
57
57
  // Override for icon size
58
58
  span.ams-icon svg {
59
- height: 1rem;
60
- width: 1rem;
59
+ block-size: 1rem;
60
+ inline-size: 1rem;
61
61
  }
62
62
 
63
63
  @include text-rendering;
@@ -13,9 +13,9 @@
13
13
  .ams-paragraph {
14
14
  color: var(--ams-paragraph-color);
15
15
  font-family: var(--ams-paragraph-font-family);
16
- font-size: var(--ams-paragraph-medium-font-size);
16
+ font-size: var(--ams-paragraph-font-size);
17
17
  font-weight: var(--ams-paragraph-font-weight);
18
- line-height: var(--ams-paragraph-medium-line-height);
18
+ line-height: var(--ams-paragraph-line-height);
19
19
 
20
20
  @include text-rendering;
21
21
  @include reset;
@@ -14,23 +14,23 @@
14
14
 
15
15
  .ams-radio__circle {
16
16
  align-items: center;
17
+ block-size: calc(var(--ams-radio-font-size) * var(--ams-radio-line-height));
17
18
  display: flex;
18
19
  flex-shrink: 0;
19
- height: calc(var(--ams-radio-font-size) * var(--ams-radio-line-height));
20
- width: 1.5rem;
20
+ inline-size: 1.5rem;
21
21
 
22
22
  &::after {
23
23
  background-position: center;
24
24
  background-repeat: no-repeat;
25
25
  background-size: 1rem;
26
+ block-size: 1.5rem;
26
27
  border-color: var(--ams-radio-circle-border-color);
27
28
  border-radius: 100%;
28
29
  border-style: solid;
29
30
  border-width: var(--ams-radio-circle-border-width);
30
31
  box-sizing: border-box;
31
32
  content: "";
32
- height: 1.5rem;
33
- width: 100%;
33
+ inline-size: 100%;
34
34
  }
35
35
  }
36
36
 
@@ -15,13 +15,13 @@
15
15
  }
16
16
 
17
17
  .ams-screen--full-height {
18
- min-height: 100vh;
18
+ min-block-size: 100vh;
19
19
  }
20
20
 
21
21
  .ams-screen--wide {
22
- max-width: var(--ams-screen-wide-max-width);
22
+ max-inline-size: var(--ams-screen-wide-max-inline-size);
23
23
  }
24
24
 
25
25
  .ams-screen--x-wide {
26
- max-width: var(--ams-screen-x-wide-max-width);
26
+ max-inline-size: var(--ams-screen-x-wide-max-inline-size);
27
27
  }
@@ -11,9 +11,8 @@
11
11
  }
12
12
 
13
13
  @mixin reset-input {
14
- // Reset native appearance, this causes issues on iOS and Android devices
15
- -webkit-appearance: none;
16
- appearance: none;
14
+ -webkit-appearance: none; // Reset appearance for Safari < 15.4
15
+ appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
17
16
  border: 0;
18
17
  border-radius: 0; // Reset rounded borders on iOS devices
19
18
  box-sizing: border-box;
@@ -27,12 +26,12 @@
27
26
  font-family: var(--ams-search-field-input-font-family);
28
27
  font-size: var(--ams-search-field-input-font-size);
29
28
  font-weight: var(--ams-search-field-input-font-weight);
29
+ inline-size: 100%;
30
30
  line-height: var(--ams-search-field-input-line-height);
31
31
  outline-offset: var(--ams-search-field-input-outline-offset);
32
32
  padding-block: var(--ams-search-field-input-padding-block);
33
33
  padding-inline: var(--ams-search-field-input-padding-inline);
34
34
  touch-action: manipulation;
35
- width: 100%;
36
35
 
37
36
  @include text-rendering;
38
37
  @include reset-input;
@@ -46,17 +45,28 @@
46
45
  }
47
46
  }
48
47
 
48
+ .ams-search-field__input:invalid,
49
+ .ams-search-field__input[aria-invalid="true"] {
50
+ box-shadow: var(--ams-search-field-input-invalid-box-shadow);
51
+
52
+ &:hover {
53
+ // TODO: this should be the (currently non-existent) dark red hover color
54
+ box-shadow: var(--ams-search-field-input-invalid-hover-box-shadow);
55
+ }
56
+ }
57
+
49
58
  .ams-search-field__input::placeholder {
50
59
  color: var(--ams-search-field-input-placeholder-color);
60
+ opacity: 100%; // This resets the lower opacity set by Firefox
51
61
  }
52
62
 
53
63
  .ams-search-field__input::-webkit-search-cancel-button {
54
64
  appearance: none;
55
65
  background-image: var(--ams-search-field-input-cancel-button-background-image);
66
+ block-size: var(--ams-search-field-input-cancel-button-block-size);
56
67
  cursor: pointer;
57
- height: var(--ams-search-field-input-cancel-button-height);
68
+ inline-size: var(--ams-search-field-input-cancel-button-inline-size);
58
69
  margin-inline-start: 0.5rem;
59
- width: var(--ams-search-field-input-cancel-button-width);
60
70
  }
61
71
 
62
72
  @mixin reset-button {
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  @mixin reset {
7
- appearance: none;
7
+ appearance: none; // Reset native appearance to hide default chevron
8
8
  border: 0;
9
9
  border-radius: 0; // Reset rounded borders for Safari on MacOS
10
10
  }
@@ -16,8 +16,8 @@
16
16
  font-family: var(--ams-select-font-family);
17
17
  font-size: var(--ams-select-font-size);
18
18
  font-weight: var(--ams-select-font-weight);
19
+ inline-size: 100%;
19
20
  line-height: var(--ams-select-line-height);
20
- max-inline-size: 100%;
21
21
  outline-offset: var(--ams-select-outline-offset);
22
22
  padding-block: var(--ams-select-padding-block);
23
23
  padding-inline: var(--ams-select-padding-inline);
@@ -37,12 +37,9 @@
37
37
  @include reset;
38
38
  }
39
39
 
40
+ .ams-select:invalid,
40
41
  .ams-select[aria-invalid="true"] {
41
42
  box-shadow: var(--ams-select-invalid-box-shadow);
42
-
43
- &:hover {
44
- box-shadow: var(--ams-select-invalid-hover-box-shadow);
45
- }
46
43
  }
47
44
 
48
45
  .ams-select:disabled {
@@ -55,6 +52,11 @@
55
52
  }
56
53
  }
57
54
 
55
+ .ams-select:invalid:hover,
56
+ .ams-select[aria-invalid="true"]:hover {
57
+ box-shadow: var(--ams-select-invalid-hover-box-shadow);
58
+ }
59
+
58
60
  .ams-select__option:disabled {
59
61
  color: var(--ams-select-option-disabled-color);
60
62
  }
@@ -16,29 +16,31 @@
16
16
  }
17
17
 
18
18
  .ams-switch__label {
19
+ --ams-switch-track-padding: 0.0625rem;
20
+
19
21
  background-color: var(--ams-switch-background-color);
20
- border-radius: calc(var(--ams-switch-thumb-width) * 2);
22
+ border-radius: calc(var(--ams-switch-thumb-inline-size) * 2);
21
23
  cursor: pointer;
22
24
  display: inline-block;
25
+ inline-size: var(--ams-switch-inline-size);
23
26
  outline-offset: var(--ams-switch-outline-offset);
24
- padding-block: 1px;
25
- padding-inline: 1px;
27
+ padding-block: var(--ams-switch-track-padding);
28
+ padding-inline: var(--ams-switch-track-padding);
26
29
  transition: background-color 0.2s ease-in-out;
27
- width: var(--ams-switch-width);
28
30
 
29
31
  @include reset;
30
32
  }
31
33
 
32
34
  .ams-switch__label::before {
33
35
  background-color: var(--ams-switch-thumb-background-color);
36
+ block-size: var(--ams-switch-thumb-block-size);
34
37
  border-radius: 50%;
35
38
  content: "";
36
39
  display: block;
37
- height: var(--ams-switch-thumb-height);
40
+ inline-size: var(--ams-switch-thumb-inline-size);
38
41
  transition-duration: 0.1s;
39
42
  transition-property: box-shadow, transform;
40
43
  transition-timing-function: ease-in-out;
41
- width: var(--ams-switch-thumb-width);
42
44
  }
43
45
 
44
46
  .ams-switch__input:checked + .ams-switch__label {
@@ -51,10 +53,11 @@
51
53
  }
52
54
 
53
55
  .ams-switch__input:checked + .ams-switch__label::before {
54
- // The 2px is to account for the 1px padding-inline on the label
55
- transform: translate(calc(var(--ams-switch-width) - var(--ams-switch-thumb-width) - 2px));
56
+ transform: translate(
57
+ calc(var(--ams-switch-inline-size) - var(--ams-switch-thumb-inline-size) - 2 * var(--ams-switch-track-padding))
58
+ );
56
59
  }
57
60
 
58
61
  .ams-switch:hover .ams-switch__input:enabled + .ams-switch__label::before {
59
- box-shadow: 0 0 0 2px var(--ams-switch-thumb-hover-color);
62
+ box-shadow: var(--ams-switch-thumb-hover-box-shadow);
60
63
  }
@@ -24,7 +24,7 @@
24
24
 
25
25
  .ams-table__cell,
26
26
  .ams-table__header-cell {
27
- border-bottom: var(--ams-table-cell-border-bottom);
27
+ border-block-end: var(--ams-table-cell-border-block-end);
28
28
  padding-block: var(--ams-table-cell-padding-block);
29
29
  padding-inline: var(--ams-table-cell-padding-inline);
30
30
  text-align: start;
@@ -0,0 +1,6 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Table of Contents
4
+
5
+ A list of links corresponding to the content sections on the page.
6
+ It helps users to easily navigate to different sections on the same page.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ @import "../../common/text-rendering";
7
+
8
+ @mixin reset {
9
+ box-sizing: border-box;
10
+ margin-block: 0;
11
+ padding-inline: 0;
12
+ }
13
+
14
+ .ams-table-of-contents {
15
+ display: flex;
16
+ flex-direction: column;
17
+ font-family: var(--ams-table-of-contents-font-family);
18
+ font-size: var(--ams-table-of-contents-font-size);
19
+ font-weight: var(--ams-table-of-contents-font-weight);
20
+ gap: var(--ams-table-of-contents-gap);
21
+ line-height: var(--ams-table-of-contents-line-height);
22
+ }
23
+
24
+ .ams-table-of-contents__list {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--ams-table-of-contents-list-gap);
28
+ list-style: none;
29
+
30
+ @include text-rendering;
31
+ @include reset;
32
+
33
+ .ams-table-of-contents__list {
34
+ padding-block-start: var(--ams-table-of-contents-list-list-padding-block-start);
35
+ padding-inline-start: var(--ams-table-of-contents-list-list-padding-inline-start);
36
+ }
37
+ }
38
+
39
+ .ams-table-of-contents__link {
40
+ color: var(--ams-table-of-contents-link-color);
41
+ outline-offset: var(--ams-table-of-contents-link-outline-offset);
42
+ text-decoration-line: var(--ams-table-of-contents-link-text-decoration-line);
43
+ text-decoration-thickness: var(--ams-table-of-contents-link-text-decoration-thickness);
44
+ text-underline-offset: var(--ams-table-of-contents-link-text-underline-offset);
45
+
46
+ &:hover {
47
+ color: var(--ams-table-of-contents-link-hover-color);
48
+ text-decoration-line: var(--ams-table-of-contents-link-hover-text-decoration-line);
49
+ }
50
+ }
@@ -12,7 +12,7 @@
12
12
 
13
13
  .ams-tabs__list {
14
14
  background-color: var(--ams-tabs-list-background-color);
15
- border-bottom: var(--ams-tabs-list-border-bottom);
15
+ border-block-end: var(--ams-tabs-list-border-block-end);
16
16
  display: flex;
17
17
  overflow-x: auto;
18
18
  }