material-inspired-component-library 3.0.0 → 3.0.2

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 (67) hide show
  1. package/README.md +2 -2
  2. package/components/appbar/index.scss +2 -2
  3. package/components/badge/index.scss +22 -7
  4. package/components/button/index.scss +2 -2
  5. package/components/card/README.md +9 -5
  6. package/components/card/index.scss +49 -22
  7. package/components/checkbox/README.md +9 -0
  8. package/components/dialog/index.scss +3 -3
  9. package/components/divider/README.md +3 -3
  10. package/components/divider/index.scss +20 -29
  11. package/components/iconbutton/index.scss +2 -2
  12. package/components/list/README.md +4 -4
  13. package/components/list/index.scss +5 -5
  14. package/components/navigationrail/index.scss +5 -3
  15. package/components/radio/README.md +13 -4
  16. package/components/radio/index.scss +6 -4
  17. package/components/select/README.md +28 -6
  18. package/components/select/index.scss +60 -11
  19. package/components/slider/index.scss +4 -4
  20. package/components/stepper/index.scss +85 -0
  21. package/components/stepper/index.ts +163 -0
  22. package/components/switch/README.md +26 -4
  23. package/components/switch/index.scss +24 -23
  24. package/components/textfield/index.scss +4 -9
  25. package/components/textfield/index.ts +71 -30
  26. package/dist/appbar.css +1 -1
  27. package/dist/badge.css +1 -1
  28. package/dist/bottomsheet.css +1 -1
  29. package/dist/button.css +1 -1
  30. package/dist/card.css +1 -1
  31. package/dist/components/stepper/index.d.ts +5 -0
  32. package/dist/components/textfield/index.d.ts +3 -2
  33. package/dist/dialog.css +1 -1
  34. package/dist/divider.css +1 -1
  35. package/dist/iconbutton.css +1 -1
  36. package/dist/layout.css +1 -0
  37. package/dist/layout.js +1 -0
  38. package/dist/list.css +1 -1
  39. package/dist/menu.css +1 -1
  40. package/dist/micl.css +1 -1
  41. package/dist/micl.js +1 -1
  42. package/dist/navigationrail.css +1 -1
  43. package/dist/radio.css +1 -1
  44. package/dist/select.css +1 -1
  45. package/dist/sidesheet.css +1 -1
  46. package/dist/slider.css +1 -1
  47. package/dist/stepper.css +1 -0
  48. package/dist/stepper.js +1 -0
  49. package/dist/switch.css +1 -1
  50. package/dist/textfield.css +1 -1
  51. package/docs/card.html +25 -7
  52. package/docs/checkbox.html +12 -16
  53. package/docs/divider.html +7 -1
  54. package/docs/index.html +14 -15
  55. package/docs/list.html +6 -6
  56. package/docs/micl.css +1 -1
  57. package/docs/micl.js +1 -1
  58. package/docs/navigationrail.html +2 -3
  59. package/docs/radio.html +13 -17
  60. package/docs/select.html +46 -6
  61. package/docs/switch.html +41 -26
  62. package/layout/index.scss +37 -29
  63. package/micl.ts +23 -27
  64. package/package.json +5 -1
  65. package/styles/shapes.scss +0 -2
  66. package/styles.scss +1 -0
  67. package/webpack.config.js +1 -1
package/README.md CHANGED
@@ -76,7 +76,7 @@ Copy the main `micl.js` file to your distribution folder and include it in your
76
76
  ```
77
77
  This will initialize all MICL components, including those that will be added to the DOM later on.
78
78
 
79
- ## Foundations
79
+ ## Foundations 🪟
80
80
  A separate CSS file, based on the [Material Design Layout Foundation](https://m3.material.io/foundations/layout/understanding-layout/overview), provides styles for an adaptive layout. It includes styles for the **window frame**, **body region** and **panes** that adjust to the available screen space, ensuring your layout follows Material Design's responsive guidelines.
81
81
 
82
82
  - [x] [Layout](layout/README.md)
@@ -103,7 +103,7 @@ The library currently consists of the following components:
103
103
  - [x] [Switch](components/switch/README.md)
104
104
  - [x] [Text field](components/textfield/README.md)
105
105
 
106
- ## Change Log
106
+ ## Change Log ↪️
107
107
 
108
108
  ### 3.0.0 (24.09.2025)
109
109
  **Features**
@@ -66,7 +66,7 @@
66
66
  }
67
67
  .micl-appbar__leading-icon {
68
68
  grid-area: appbar-leading;
69
- margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (24px / 2) - var(--md-sys-appbar-padding-inline));
69
+ margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-layout-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
70
70
  color: var(--md-sys-color-on-surface);
71
71
  }
72
72
  .micl-appbar__headline {
@@ -103,7 +103,7 @@
103
103
  }
104
104
  .micl-appbar__trailing-icon {
105
105
  grid-area: appbar-trailing;
106
- margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (24px / 2) - var(--md-sys-appbar-padding-inline));
106
+ margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-layout-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
107
107
  color: var(--md-sys-color-on-surface-variant);
108
108
  }
109
109
  &.micl-appbar--medium {
@@ -25,16 +25,16 @@
25
25
  --md-sys-badge-small-size: 6px;
26
26
  --md-sys-badge-large-size: 16px;
27
27
  --md-sys-badge-large-padding: 4px;
28
- }
29
-
30
- .micl-badge {
31
28
  --md-sys-badge-inline-offset: 0px;
32
29
  --md-sys-badge-block-offset: 0px;
30
+ }
33
31
 
32
+ .micl-badge {
34
33
  box-sizing: border-box;
35
34
  position: fixed;
36
- inset: unset;
35
+ inset: 0;
37
36
  margin: 0;
37
+ overflow-x: hidden;
38
38
  background-color: var(--md-sys-color-error);
39
39
  color: var(--md-sys-color-on-error);
40
40
 
@@ -42,7 +42,7 @@
42
42
  inline-size: var(--md-sys-badge-small-size);
43
43
  block-size: var(--md-sys-badge-small-size);
44
44
  inset-block-start: calc(anchor(start) + var(--md-sys-badge-block-offset));
45
- inset-inline-start: calc(anchor(end) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
45
+ inset-inline-start: calc(anchor(end) - var(--md-sys-badge-small-size) + var(--md-sys-badge-inline-offset));
46
46
  padding: 0;
47
47
  border-radius: calc(var(--md-sys-badge-small-size) / 2);
48
48
  }
@@ -53,9 +53,24 @@
53
53
  max-inline-size: 34px;
54
54
  min-inline-size: var(--md-sys-badge-large-size);
55
55
  block-size: var(--md-sys-badge-large-size);
56
- inset-block-start: calc(anchor(start) - 2px + var(--md-sys-badge-block-offset));
57
- inset-inline-start: calc(anchor(end) - 12px - var(--md-sys-badge-inline-offset));
56
+ inset-block-start: calc(anchor(start) - (var(--md-sys-badge-large-size) - 14px) + var(--md-sys-badge-block-offset));
57
+ inset-inline-start: calc(anchor(end) - 12px + var(--md-sys-badge-inline-offset));
58
58
  padding-inline: var(--md-sys-badge-large-padding);
59
59
  border-radius: calc(var(--md-sys-badge-large-size) / 2);
60
60
  }
61
61
  }
62
+
63
+ @supports not (top: anchor(bottom)) {
64
+ .micl-badge {
65
+ position: absolute;
66
+ inset: 0 !important;
67
+ margin-block: calc(12px + var(--md-sys-badge-block-offset)) auto;
68
+
69
+ &.micl-badge--small {
70
+ margin-inline-start: calc(var(--md-sys-layout-icon-size) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
71
+ }
72
+ &:not(.micl-badge--small) {
73
+ margin-inline-start: calc(12px - var(--md-sys-badge-inline-offset));
74
+ }
75
+ }
76
+ }
@@ -221,8 +221,8 @@ button.micl-button-outlined-m {
221
221
  }
222
222
  }
223
223
  .micl-button__icon {
224
- font-size: 24px;
225
- width: 24px;
224
+ font-size: var(--md-sys-layout-icon-size, 24px);
225
+ width: var(--md-sys-layout-icon-size, 24px);
226
226
  }
227
227
  }
228
228
 
@@ -1,5 +1,5 @@
1
1
  # Card
2
- This component implements the the [Material Design 3 Expressive Card](https://m3.material.io/components/cards/overview) design.
2
+ This component implements the the [Material Design 3 Expressive Card](https://m3.material.io/components/cards/overview) design. Cards display content and actions about a single subject.
3
3
 
4
4
  ## Basic Usage
5
5
 
@@ -40,7 +40,6 @@ Cards come in **three distinct styles**:
40
40
  - `micl-card-outlined`: A card with a clear border, often used for less prominent content or to indicate interactivity.
41
41
 
42
42
  ### Card Content Structure
43
-
44
43
  While the card container is the only required element, the Card component provides several optional utility classes to help structure your card's content:
45
44
  ```HTML
46
45
  <div class="micl-card-outlined" tabindex="0">
@@ -64,7 +63,7 @@ While the card container is the only required element, the Card component provid
64
63
  - `micl-card__headline-m` (medium) - *Used in the example above*
65
64
  - `micl-card__headline-l` (large)
66
65
 
67
- - `micl-card__image`: Applies styling to an `<img>` element used as the primary image for the card.
66
+ - `micl-card__image`: Applies styling to an `<img>` element or an element with a `background-image` style used as the primary image for the card.
68
67
 
69
68
  - `micl-card__subhead`: For secondary headings, displayed with a smaller font than the main headline.
70
69
 
@@ -93,18 +92,23 @@ Cards can also serve as containers for expandable detail areas using the `<detai
93
92
  </details>
94
93
  ```
95
94
 
95
+ ### Compact Cards
96
+ Add the `micl-card--compact` to the main `<div>` element (or, the `<summary>` element for expandable cards) to create a compact version of the card header.
97
+
96
98
  ### States
97
99
  - **Disabled Cards**: To visually indicate a disabled card (e.g., non-interactive), add the `micl-card--disabled` class to the card container.
98
100
 
99
101
  - **Dragging State**: When implementing drag-and-drop functionality for cards, apply the `micl-card--dragging` class to the card container to provide visual feedback during the drag operation.
100
102
 
101
103
  ## Customizations
102
- You can customize the appearance of the Card component by overriding its global CSS variables. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child dividers.
104
+ You can customize the appearance of the Card component by overriding its global CSS variables. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child cards.
103
105
 
104
106
  | Variable name | Default Value | Description |
105
107
  | ------------- | ----- | ----------- |
106
108
  | --md-sys-card-margin | 8px | Sets the spacing between adjacent cards both horizontally and vertically |
107
109
  | --md-sys-card-padding-inline | 16px | Defines the amount of space between the left and right edges of a card and its content |
110
+ | --md-sys-card-content-padding-block | 16px | The amount of vertical padding reserved for the content area |
111
+ | --md-sys-card-outlined-border-width | 1px | The width of the border of **outlined** cards |
108
112
 
109
113
  **Example: Changing the card margins**
110
114
 
@@ -120,6 +124,6 @@ You can customize the appearance of the Card component by overriding its global
120
124
  ```
121
125
 
122
126
  ## Compatibility
123
- This component uses the `color-mix` CSS functional notation, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix#browser_compatibility) for details.
127
+ This component utilizes relative RGB color values, which may not be fully supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
124
128
 
125
129
  The Card component uses the `interpolate-size` CSS property to smoothly open and close the detail area of a Details disclosure element, which might not be supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/interpolate-size#browser_compatibility) for details.
@@ -28,6 +28,8 @@
28
28
  :root {
29
29
  --md-sys-card-margin: 8px;
30
30
  --md-sys-card-padding-inline: 16px;
31
+ --md-sys-card-content-padding-block: 16px;
32
+ --md-sys-card-outlined-border-width: 1px;
31
33
  }
32
34
 
33
35
  .micl-card-elevated,
@@ -36,9 +38,12 @@
36
38
  --md-sys-card-motion-spatial: #{motion.$md-sys-motion-expressive-default-spatial};
37
39
  --md-sys-card-motion-duration: #{motion.$md-sys-motion-expressive-default-spatial-duration};
38
40
 
39
- height: fit-content;
41
+ display: block;
42
+ block-size: fit-content;
40
43
  margin: 0;
44
+ padding-block-end: var(--md-sys-card-content-padding-block);
41
45
  border-radius: var(--md-sys-shape-corner-medium);
46
+ outline: none;
42
47
  overflow: hidden;
43
48
  interpolate-size: allow-keywords;
44
49
 
@@ -66,7 +71,6 @@
66
71
 
67
72
  outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
68
73
  outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
69
- box-shadow: var(--md-sys-elevation-level1);
70
74
  }
71
75
  &:active {
72
76
  --statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
@@ -89,21 +93,23 @@
89
93
  outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
90
94
  }
91
95
  &::details-content {
92
- height: 0;
96
+ block-size: 0;
93
97
  overflow: hidden;
94
98
  transition:
95
- height var(--md-sys-card-motion-duration) var(--md-sys-card-motion-spatial),
99
+ block-size var(--md-sys-card-motion-duration) var(--md-sys-card-motion-spatial),
96
100
  content-visibility var(--md-sys-card-motion-duration) linear allow-discrete;
97
101
  }
98
102
  &[open]::details-content {
99
- height: auto;
103
+ block-size: auto;
100
104
  }
101
105
  &> summary {
102
- padding-block-end: 8px;
103
106
  outline: none;
104
107
  list-style: none;
105
108
  cursor: pointer
106
109
  }
110
+ &:not([open]):has(> summary.micl-card--compact) {
111
+ padding-block-end: 0;
112
+ }
107
113
  }
108
114
 
109
115
  .micl-card-elevated {
@@ -114,9 +120,6 @@
114
120
  &:hover {
115
121
  box-shadow: var(--md-sys-elevation-level2);
116
122
  }
117
- &:active {
118
- box-shadow: var(--md-sys-elevation-level1);
119
- }
120
123
  &.micl-card--dragging {
121
124
  box-shadow: var(--md-sys-elevation-level4);
122
125
  }
@@ -125,29 +128,18 @@
125
128
  .micl-card-filled {
126
129
  background-color: var(--md-sys-color-surface-container-highest);
127
130
  box-shadow: var(--md-sys-elevation-level0);
128
-
129
- &[tabindex='0']:not(.micl-card--disabled) {
130
- &:focus-visible {
131
- box-shadow: var(--md-sys-elevation-level0);
132
- }
133
- &:active {
134
- box-shadow: var(--md-sys-elevation-level0);
135
- }
136
- }
137
131
  }
138
132
  .micl-card-outlined {
139
133
  background-color: var(--md-sys-color-surface);
140
134
  box-shadow: var(--md-sys-elevation-level0);
141
- border: 1px solid var(--md-sys-color-outline-variant);
135
+ border: var(--md-sys-card-outlined-border-width) solid var(--md-sys-color-outline-variant);
142
136
 
143
137
  &[tabindex='0']:not(.micl-card--disabled) {
144
138
  &:focus-visible {
145
139
  border-color: var(--md-sys-color-on-surface);
146
- box-shadow: var(--md-sys-elevation-level0);
147
140
  }
148
141
  &:active {
149
142
  border-color: var(--md-sys-color-outline-variant);
150
- box-shadow: var(--md-sys-elevation-level0);
151
143
  }
152
144
  }
153
145
  }
@@ -167,10 +159,44 @@
167
159
  border-color: rgb(from var(--md-sys-color-outline) r g b / 12%);
168
160
  }
169
161
  }
162
+ .micl-card--compact {
163
+ display: grid;
164
+ grid-template-areas:
165
+ "card-media card-headline"
166
+ "card-media card-subhead"
167
+ "card-media card-supporting"
168
+ "card-content card-content";
169
+ grid-template-columns: 20% 1fr;
170
+
171
+ .micl-card__image {
172
+ grid-area: card-media;
173
+ block-size: 100%;
174
+ object-fit: cover;
175
+ background-size: cover;
176
+ }
177
+ .micl-card__headline-s,
178
+ .micl-card__headline-m,
179
+ .micl-card__headline-l {
180
+ grid-area: card-headline;
181
+ }
182
+ .micl-card__subhead {
183
+ grid-area: card-subhead;
184
+ }
185
+ .micl-card__supporting-text {
186
+ grid-area: card-supporting;
187
+ }
188
+ .micl-card__content {
189
+ grid-area: card-content;
190
+ }
191
+ }
170
192
 
171
193
  .micl-card__image {
172
- width: 100%;
194
+ display: block;
195
+ inline-size: 100%;
173
196
  border-radius: var(--md-sys-shape-corner-medium);
197
+ background-position: center;
198
+ background-repeat: no-repeat;
199
+ background-size: contain;
174
200
  }
175
201
 
176
202
  .micl-card__headline-s,
@@ -260,6 +286,7 @@
260
286
 
261
287
  .micl-card__content {
262
288
  box-sizing: border-box;
289
+ padding-block: var(--md-sys-card-content-padding-block) 0;
263
290
  padding-inline: var(--md-sys-card-padding-inline);
264
291
  background-color: inherit;
265
292
  overflow: hidden;
@@ -56,5 +56,14 @@ You can customize the appearance of the Checkbox component by overriding its glo
56
56
  </div>
57
57
  ```
58
58
 
59
+ To vertically align a checkbox with its label, wrap both in an element that has the `micl-flex--vcenter` class.
60
+
61
+ ```HTML
62
+ <div class="micl-flex--vcenter">
63
+ <input type="checkbox" id="mycheckbox" class="micl-checkbox">
64
+ <label for="mycheckbox">Checkbox</label>
65
+ </div>
66
+ ```
67
+
59
68
  ## Compatibility
60
69
  This component utilizes relative RGB color values, which may not be fully supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
@@ -161,9 +161,9 @@ dialog.micl-dialog-fullscreen {
161
161
  color: var(--md-sys-color-on-surface);
162
162
  }
163
163
  .micl-dialog__icon {
164
- width: 24px;
165
- height: 24px;
166
- font-size: 24px;
164
+ width: var(--md-sys-layout-icon-size, 24px);
165
+ height: var(--md-sys-layout-icon-size, 24px);
166
+ font-size: var(--md-sys-layout-icon-size, 24px);
167
167
  color: var(--md-sys-color-secondary);
168
168
  }
169
169
  button {
@@ -1,5 +1,5 @@
1
1
  # Divider
2
- This component implements the the [Material Design 3 Expressive Divider](https://m3.material.io/components/divider/overview) design.
2
+ This component implements the the [Material Design 3 Expressive Divider](https://m3.material.io/components/divider/overview) design. Dividers are thin lines that separate content into distinct sections.
3
3
 
4
4
  ## Basic Usage
5
5
 
@@ -30,8 +30,8 @@ The Divider component offers five CSS classes for different divider styles:
30
30
  | --------- | ----------- |
31
31
  | micl-divider | A standard, full-width divider |
32
32
  | micl-divider-inset | Indented equally on both the left and right sides |
33
- | micl-divider-inset--start | Indented only on the left (start) side |
34
- | micl-divider-inset--end | Indented only on the right (end) side |
33
+ | micl-divider-inset-start | Indented only on the left (start) side |
34
+ | micl-divider-inset-end | Indented only on the right (end) side |
35
35
  | micl-divider-vertical | A vertical divider |
36
36
 
37
37
  ## Customizations
@@ -25,50 +25,41 @@
25
25
  --md-sys-divider-space: 4px;
26
26
  }
27
27
  body {
28
- --md-sys-divider-color: var(--md-sys-color-outline-variant);
28
+ --md-sys-divider-color: var(--md-sys-color-outline-variant, gray);
29
29
  }
30
30
 
31
- .micl-divider {
32
- width: 100%;
33
- height: 0;
34
- margin-block: var(--md-sys-divider-space);
31
+ .micl-divider,
32
+ .micl-divider-inset,
33
+ .micl-divider-inset-start,
34
+ .micl-divider-inset-end {
35
+ inline-size: 100%;
36
+ block-size: 0;
37
+ margin-block: calc(var(--md-sys-divider-space, 4px) - 1px) var(--md-sys-divider-space, 4px);
35
38
  margin-inline: 0;
36
39
  border: 0;
37
- border-block-start: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
40
+ border-block-start: var(--md-sys-divider-thickness, 1px) solid var(--md-sys-divider-color, gray);
38
41
  }
39
42
 
40
43
  .micl-divider-inset {
41
- width: calc(100% - 2 * var(--md-sys-divider-inset-margin));
42
- height: 0;
43
- margin-block: var(--md-sys-divider-space);
44
+ inline-size: calc(100% - 2 * var(--md-sys-divider-inset-margin, 16px));
44
45
  margin-inline: var(--md-sys-divider-inset-margin);
45
- border: 0;
46
- border-block-start: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
47
46
  }
48
47
 
49
- .micl-divider-inset--start {
50
- width: calc(100% - var(--md-sys-divider-inset-margin));
51
- height: 0;
52
- margin-block: var(--md-sys-divider-space);
53
- margin-inline: var(--md-sys-divider-inset-margin) 0;
54
- border: 0;
55
- border-block-start: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
48
+ .micl-divider-inset-start {
49
+ inline-size: calc(100% - var(--md-sys-divider-inset-margin, 16px));
50
+ margin-inline-start: var(--md-sys-divider-inset-margin, 16px);
56
51
  }
57
52
 
58
- .micl-divider-inset--end {
59
- width: calc(100% - var(--md-sys-divider-inset-margin));
60
- height: 0;
61
- margin-block: var(--md-sys-divider-space);
62
- margin-inline: 0 var(--md-sys-divider-inset-margin);
63
- border: 0;
64
- border-block-start: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
53
+ .micl-divider-inset-end {
54
+ inline-size: calc(100% - var(--md-sys-divider-inset-margin, 16px));
55
+ margin-inline-end: var(--md-sys-divider-inset-margin, 16px);
65
56
  }
66
57
 
67
58
  .micl-divider-vertical {
68
- min-height: 100%;
69
- width: 0;
59
+ min-block-size: 100%;
60
+ inline-size: 0;
70
61
  margin-block: 0;
71
- margin-inline: calc(2 * var(--md-sys-divider-space));
62
+ margin-inline: calc(2 * var(--md-sys-divider-space, 4px));
72
63
  border: 0;
73
- border-inline-start: var(--md-sys-divider-thickness) solid var(--md-sys-divider-color);
64
+ border-inline-start: var(--md-sys-divider-thickness, 1px) solid var(--md-sys-divider-color, gray);
74
65
  }
@@ -151,7 +151,7 @@ button.micl-iconbutton-outlined-s {
151
151
  inline-size: var(--micl-width);
152
152
  min-inline-size: var(--micl-width);
153
153
  block-size: var(--micl-height);
154
- font-size: 24px;
154
+ font-size: var(--md-sys-layout-icon-size, 24px);
155
155
 
156
156
  &::before {
157
157
  content: "";
@@ -202,7 +202,7 @@ button.micl-iconbutton-outlined-m {
202
202
  inline-size: var(--micl-width);
203
203
  min-inline-size: var(--micl-width);
204
204
  block-size: var(--micl-height);
205
- font-size: 24px;
205
+ font-size: var(--md-sys-layout-icon-size, 24px);
206
206
 
207
207
  &.micl-button--toggle.micl-button--selected {
208
208
  border-radius: var(--md-sys-shape-corner-large);
@@ -156,19 +156,19 @@ To enable selection of list items, integrate a checkbox or switch component with
156
156
  <li class="micl-list-item-two" tabindex="0">
157
157
  <label>
158
158
  <span class="micl-list-item__text">
159
- <span class="micl-list-item__headline">Blue car</span>
159
+ <span id="hd1" class="micl-list-item__headline">Blue car</span>
160
160
  <span class="micl-list-item__supporting-text">A blue car with four wheels.</span>
161
161
  </label>
162
- <input type="checkbox" id="mycheckbox" class="micl-checkbox" value="cb1" tabindex="-1">
162
+ <input type="checkbox" id="mycheckbox" class="micl-checkbox" value="cb1" tabindex="-1" aria-labelledby="hd1">
163
163
  </span>
164
164
  </li>
165
165
  <li class="micl-list-item-two" tabindex="0">
166
166
  <label>
167
167
  <span class="micl-list-item__text">
168
- <span class="micl-list-item__headline">Red car</span>
168
+ <span id="hd2" class="micl-list-item__headline">Red car</span>
169
169
  <span class="micl-list-item__supporting-text">A red car with tinted windows.</span>
170
170
  </label>
171
- <input type="checkbox" id="checkbox2" class="micl-switch" value="cb2" tabindex="-1">
171
+ <input type="checkbox" id="checkbox2" class="micl-switch" value="cb2" tabindex="-1" aria-labelledby="hd2">
172
172
  </label>
173
173
  </li>
174
174
  </ul>
@@ -104,7 +104,7 @@
104
104
  column-gap: var(--md-sys-list-item-space);
105
105
  padding-inline: var(--md-sys-list-item-space);
106
106
  border: none;
107
- border-radius: var(--md-sys-shape-corner-none);
107
+ border-radius: var(--md-sys-shape-corner-none, 0px);
108
108
  background-color: var(--md-sys-list-item-container-color);
109
109
  background-image:
110
110
  radial-gradient(circle at var(--micl-x, center) var(--micl-y, center), transparent 0%, rgb(from var(--statelayer-color) r g b / var(--statelayer-opacity)) 10%, transparent 10%),
@@ -308,8 +308,8 @@
308
308
  }
309
309
 
310
310
  .micl-list-item__icon {
311
- min-width: 24px;
312
- font-size: 24px;
311
+ min-width: var(--md-sys-layout-icon-size, 24px);
312
+ font-size: var(--md-sys-layout-icon-size, 24px);
313
313
  font-variation-settings: 'FILL' 0;
314
314
  color: var(--md-sys-color-on-surface-variant);
315
315
  transition: font-variation-settings var(--md-sys-list-motion-duration) linear;
@@ -330,7 +330,7 @@
330
330
  display: inline-block;
331
331
  height: 56px;
332
332
  min-width: 56px;
333
- border-radius: var(--md-sys-shape-corner-none);
333
+ border-radius: var(--md-sys-shape-corner-none, 0px);
334
334
  background-position: center;
335
335
  background-repeat: no-repeat;
336
336
  background-size: cover;
@@ -339,7 +339,7 @@
339
339
  display: inline-block;
340
340
  height: 64px;
341
341
  min-width: calc(64px * var(--md-sys-list-item-thumbnail-aspect-ratio));
342
- border-radius: var(--md-sys-shape-corner-none);
342
+ border-radius: var(--md-sys-shape-corner-none, 0px);
343
343
  background-position: center;
344
344
  background-repeat: no-repeat;
345
345
  background-size: contain;
@@ -43,6 +43,8 @@
43
43
  --md-sys-navigationrail-motion-duration-reverse: #{motion.$md-sys-motion-expressive-default-spatial-duration};
44
44
  --md-sys-navigationrail-morph-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
45
45
  --md-sys-navigationrail-morph-duration-reverse: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
46
+ --md-sys-badge-inline-offset: -16px;
47
+ --md-sys-badge-block-offset: 4px;
46
48
 
47
49
  box-sizing: border-box;
48
50
  display: flex;
@@ -91,6 +93,7 @@
91
93
 
92
94
  box-sizing: border-box;
93
95
  display: flex;
96
+ position: relative;
94
97
  flex-direction: column;
95
98
  align-items: center;
96
99
  block-size: var(--md-sys-navigationrail-item-height);
@@ -115,8 +118,8 @@
115
118
  &> .micl-navigationrail__icon {
116
119
  --micl-ripple: 1;
117
120
 
118
- font-size: 24px;
119
- inline-size: 24px;
121
+ font-size: var(--md-sys-layout-icon-size, 24px);
122
+ inline-size: var(--md-sys-layout-icon-size, 24px);
120
123
  margin: 0;
121
124
  padding-block: 4px;
122
125
  padding-inline: 16px;
@@ -173,7 +176,6 @@ nav.micl-navigationrail:has(> .micl-navigationrail__headline .micl-button--toggl
173
176
  row-gap: 0px;
174
177
 
175
178
  &> label.micl-navigationrail__item {
176
- position: relative;
177
179
  flex-direction: row;
178
180
  inline-size: fit-content;
179
181
 
@@ -1,5 +1,5 @@
1
1
  # Radio button
2
- This component implements the the [Material Design 3 Expressive Radio button](https://m3.material.io/components/radio-button/overview) design.
2
+ This component implements the the [Material Design 3 Expressive Radio button](https://m3.material.io/components/radio-button/overview) design. A radio button allows a user to select only one option from a group of mutually exclusive choices.
3
3
 
4
4
  ## Basic Usage
5
5
 
@@ -29,7 +29,7 @@ A radio button can be disabled by adding the `disabled` attribute to the `<input
29
29
 
30
30
  The Radio Button component respects the `dir` global attribute, automatically adjusting its layout for right-to-left (RTL) languages when `dir="rtl"` is applied to an ancestor element.
31
31
 
32
- By default, the component applies a specific color and `cursor: pointer` to `<label>` elements immediately preceding or following an `<input type="radio">` with the `micl-radio` class. You are encouraged to customize these CSS settings to match your design system.
32
+ The component applies `cursor: pointer` and the color role **on surface** to the `<label>` element immediately preceding or following an `<input type="radio">` with the `micl-radio` class. You are encouraged to customize these CSS settings to match your design system.
33
33
 
34
34
  ## Customizations
35
35
  You can customize the appearance of the Radio Button component by overriding its global CSS variables. These variables are declared on the `:root` pseudo-class and can be changed on any appropriate parent element to affect its child radio buttons.
@@ -44,8 +44,17 @@ You can customize the appearance of the Radio Button component by overriding its
44
44
 
45
45
  ```HTML
46
46
  <div style="--md-sys-radio-container-size:28px">
47
- <input type="radio" id="myradio" class="micl-radio">
48
- <label for="myradio">Large radio button</label>
47
+ <input type="radio" id="myradio" class="micl-radio">
48
+ <label for="myradio">Large radio button</label>
49
+ </div>
50
+ ```
51
+
52
+ To vertically align a radio button with its label, wrap both in an element that has the `micl-flex--vcenter` class.
53
+
54
+ ```HTML
55
+ <div class="micl-flex--vcenter">
56
+ <input type="radio" id="myradio" class="micl-radio">
57
+ <label for="myradio">Large radio button</label>
49
58
  </div>
50
59
  ```
51
60
 
@@ -37,8 +37,10 @@ input[type=radio].micl-radio {
37
37
  appearance: none;
38
38
  box-sizing: border-box;
39
39
  position: relative;
40
- width: var(--md-sys-target-size);
41
- height: var(--md-sys-target-size);
40
+ inline-size: var(--md-sys-target-size);
41
+ min-inline-size: var(--md-sys-target-size);
42
+ block-size: var(--md-sys-target-size);
43
+ min-block-size: var(--md-sys-target-size);
42
44
  margin: 0;
43
45
  border: calc((var(--md-sys-target-size) - var(--md-sys-radio-state-layer-size)) / 2) solid transparent;
44
46
  background-clip: content-box;
@@ -50,8 +52,8 @@ input[type=radio].micl-radio {
50
52
  content: "";
51
53
  box-sizing: border-box;
52
54
  position: absolute;
53
- width: var(--md-sys-radio-container-size);
54
- height: var(--md-sys-radio-container-size);
55
+ inline-size: var(--md-sys-radio-container-size);
56
+ block-size: var(--md-sys-radio-container-size);
55
57
  inset: 0;
56
58
  margin: auto;
57
59
  padding: calc((var(--md-sys-radio-container-size) / 2) - var(--md-sys-radio-border-width));