material-inspired-component-library 8.1.0 → 9.0.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 (284) hide show
  1. package/README.md +106 -18
  2. package/components/README.md +1 -1
  3. package/components/accordion/README.md +6 -6
  4. package/components/alert/README.md +10 -10
  5. package/components/alert/index.scss +27 -52
  6. package/components/appbar/README.md +19 -6
  7. package/components/appbar/index.scss +40 -44
  8. package/components/badge/README.md +12 -10
  9. package/components/badge/index.scss +21 -25
  10. package/components/bottomsheet/README.md +26 -1
  11. package/components/bottomsheet/index.scss +58 -44
  12. package/components/button/README.md +70 -10
  13. package/components/button/_shared.scss +210 -0
  14. package/components/button/index.scss +75 -389
  15. package/components/card/README.md +97 -85
  16. package/components/card/index.scss +46 -65
  17. package/components/checkbox/README.md +25 -14
  18. package/{tools/shapes/check.mjs → components/checkbox/_label.scss} +37 -42
  19. package/components/checkbox/index.scss +66 -66
  20. package/components/chip/README.md +186 -0
  21. package/components/chip/index.scss +285 -0
  22. package/components/datepicker/README.md +79 -0
  23. package/components/datepicker/index.scss +346 -315
  24. package/components/dialog/README.md +20 -10
  25. package/components/dialog/index.scss +55 -66
  26. package/components/divider/README.md +16 -15
  27. package/components/divider/index.scss +9 -25
  28. package/components/iconbutton/README.md +63 -12
  29. package/components/iconbutton/index.scss +142 -303
  30. package/components/list/README.md +89 -156
  31. package/components/list/index.scss +34 -36
  32. package/components/menu/README.md +81 -155
  33. package/components/menu/index.scss +52 -58
  34. package/components/navigationbar/README.md +108 -0
  35. package/components/navigationbar/index.scss +185 -0
  36. package/components/navigationrail/README.md +62 -37
  37. package/components/navigationrail/_navitem.scss +96 -0
  38. package/components/navigationrail/index.scss +78 -132
  39. package/components/progressindicator/README.md +83 -47
  40. package/components/progressindicator/index.scss +622 -172
  41. package/components/radio/README.md +11 -9
  42. package/components/radio/index.scss +36 -33
  43. package/components/select/README.md +12 -7
  44. package/components/select/index.scss +26 -34
  45. package/components/shapes/README.md +3 -3
  46. package/components/shapes/index.scss +0 -1
  47. package/components/sidesheet/README.md +21 -9
  48. package/components/sidesheet/index.scss +38 -46
  49. package/components/slider/README.md +21 -0
  50. package/components/slider/index.scss +108 -139
  51. package/components/snackbar/README.md +32 -35
  52. package/components/snackbar/index.scss +10 -22
  53. package/components/stepper/README.md +14 -7
  54. package/components/stepper/index.scss +58 -39
  55. package/components/switch/README.md +22 -15
  56. package/components/switch/index.scss +68 -60
  57. package/components/textfield/README.md +48 -5
  58. package/components/textfield/index.scss +192 -248
  59. package/components/timepicker/README.md +53 -23
  60. package/components/timepicker/index.scss +110 -128
  61. package/dist/alert.css +1 -1
  62. package/dist/alert.js +1 -1
  63. package/dist/appbar.css +1 -1
  64. package/dist/appbar.js +1 -1
  65. package/dist/badge.css +1 -1
  66. package/dist/badge.js +1 -1
  67. package/dist/base.css +1 -0
  68. package/dist/base.js +1 -0
  69. package/dist/bottomsheet.css +1 -1
  70. package/dist/bottomsheet.js +1 -1
  71. package/dist/button.css +1 -1
  72. package/dist/button.js +1 -1
  73. package/dist/card.css +1 -1
  74. package/dist/card.js +1 -1
  75. package/dist/checkbox.css +1 -1
  76. package/dist/checkbox.js +1 -1
  77. package/dist/chip.css +1 -0
  78. package/dist/chip.js +1 -0
  79. package/dist/components/button/index.d.ts +1 -1
  80. package/dist/components/iconbutton/index.d.ts +2 -7
  81. package/dist/components/slider/index.d.ts +1 -1
  82. package/dist/components/textfield/index.d.ts +2 -2
  83. package/dist/datepicker.css +1 -1
  84. package/dist/datepicker.js +1 -1
  85. package/dist/dialog.css +1 -1
  86. package/dist/dialog.js +1 -1
  87. package/dist/divider.css +1 -1
  88. package/dist/divider.js +1 -1
  89. package/dist/field.css +1 -0
  90. package/dist/field.js +1 -0
  91. package/dist/foundations/form/index.js +1 -1
  92. package/dist/foundations/runtime.d.ts +15 -0
  93. package/dist/foundations/runtime.js +1 -0
  94. package/dist/iconbutton.css +1 -1
  95. package/dist/iconbutton.js +1 -1
  96. package/dist/layout.css +1 -1
  97. package/dist/layout.js +1 -1
  98. package/dist/list.css +1 -1
  99. package/dist/list.js +1 -1
  100. package/dist/menu.css +1 -1
  101. package/dist/menu.js +1 -1
  102. package/dist/micl.css +1 -1
  103. package/dist/micl.d.ts +14 -5
  104. package/dist/micl.js +1 -1
  105. package/dist/navigationbar.css +1 -0
  106. package/dist/navigationbar.js +1 -0
  107. package/dist/navigationrail.css +1 -1
  108. package/dist/navigationrail.js +1 -1
  109. package/dist/progressindicator.css +1 -1
  110. package/dist/progressindicator.js +1 -1
  111. package/dist/radio.css +1 -1
  112. package/dist/radio.js +1 -1
  113. package/dist/scrollbar.js +1 -1
  114. package/dist/select.css +1 -1
  115. package/dist/select.js +1 -1
  116. package/dist/shapes.css +1 -1
  117. package/dist/shapes.js +1 -1
  118. package/dist/sidesheet.css +1 -1
  119. package/dist/sidesheet.js +1 -1
  120. package/dist/slider.css +1 -1
  121. package/dist/slider.js +1 -1
  122. package/dist/snackbar.css +1 -1
  123. package/dist/snackbar.js +1 -1
  124. package/dist/stepper.css +1 -1
  125. package/dist/stepper.js +1 -1
  126. package/dist/switch.css +1 -1
  127. package/dist/switch.js +1 -1
  128. package/dist/textfield.css +1 -1
  129. package/dist/textfield.js +1 -1
  130. package/dist/timepicker.css +1 -1
  131. package/dist/timepicker.js +1 -1
  132. package/foundations/_index.scss +35 -0
  133. package/foundations/{index.scss → base/index.scss} +21 -56
  134. package/foundations/field/index.scss +37 -0
  135. package/foundations/layout/index.scss +64 -65
  136. package/package.json +23 -9
  137. package/styles/statelayer.scss +20 -5
  138. package/styles.scss +5 -2
  139. package/.claude/settings.local.json +0 -14
  140. package/.editorconfig +0 -12
  141. package/.gitattributes +0 -9
  142. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  143. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  144. package/CLAUDE.md +0 -53
  145. package/CODE_OF_CONDUCT.md +0 -128
  146. package/components/bottomsheet/index.ts +0 -153
  147. package/components/button/index.ts +0 -79
  148. package/components/checkbox/index.ts +0 -148
  149. package/components/datepicker/index.ts +0 -693
  150. package/components/iconbutton/index.ts +0 -77
  151. package/components/list/index.ts +0 -138
  152. package/components/menu/index.ts +0 -145
  153. package/components/navigationrail/index.ts +0 -87
  154. package/components/progressindicator/index.ts +0 -77
  155. package/components/slider/index.ts +0 -149
  156. package/components/snackbar/index.ts +0 -118
  157. package/components/stepper/index.ts +0 -248
  158. package/components/textfield/index.ts +0 -188
  159. package/components/timepicker/index.ts +0 -413
  160. package/dist/components/progressindicator/index.d.ts +0 -6
  161. package/dist/foundations.css +0 -1
  162. package/dist/foundations.js +0 -1
  163. package/docs/accordion.html +0 -344
  164. package/docs/alert.html +0 -177
  165. package/docs/bottomsheet.html +0 -240
  166. package/docs/button.html +0 -290
  167. package/docs/card-awards.webp +0 -0
  168. package/docs/card-cabinet.webp +0 -0
  169. package/docs/card-city.webp +0 -0
  170. package/docs/card-fingerprint.webp +0 -0
  171. package/docs/card-holiday.webp +0 -0
  172. package/docs/card-names.webp +0 -0
  173. package/docs/card.html +0 -159
  174. package/docs/checkbox.html +0 -147
  175. package/docs/datepicker.html +0 -274
  176. package/docs/dialog.html +0 -195
  177. package/docs/divider.html +0 -139
  178. package/docs/docs.css +0 -26
  179. package/docs/docs.js +0 -139
  180. package/docs/iconbutton.html +0 -329
  181. package/docs/index.html +0 -431
  182. package/docs/list.html +0 -310
  183. package/docs/menu.html +0 -574
  184. package/docs/micl.css +0 -1
  185. package/docs/micl.js +0 -1
  186. package/docs/navigationrail.html +0 -138
  187. package/docs/progressindicator.html +0 -288
  188. package/docs/radio.html +0 -123
  189. package/docs/select.html +0 -337
  190. package/docs/shapes.css +0 -1
  191. package/docs/shapes.html +0 -159
  192. package/docs/shapes.js +0 -1
  193. package/docs/sidesheet.html +0 -149
  194. package/docs/slider.html +0 -141
  195. package/docs/snackbar.html +0 -102
  196. package/docs/stepper.html +0 -319
  197. package/docs/switch.html +0 -196
  198. package/docs/textfield.html +0 -208
  199. package/docs/themes/airblue/dark-hc.css +0 -51
  200. package/docs/themes/airblue/dark-mc.css +0 -51
  201. package/docs/themes/airblue/dark.css +0 -51
  202. package/docs/themes/airblue/light-hc.css +0 -51
  203. package/docs/themes/airblue/light-mc.css +0 -51
  204. package/docs/themes/airblue/light.css +0 -51
  205. package/docs/themes/airblue/theme.css +0 -306
  206. package/docs/themes/barnred/dark-hc.css +0 -51
  207. package/docs/themes/barnred/dark-mc.css +0 -51
  208. package/docs/themes/barnred/dark.css +0 -51
  209. package/docs/themes/barnred/light-hc.css +0 -51
  210. package/docs/themes/barnred/light-mc.css +0 -51
  211. package/docs/themes/barnred/light.css +0 -51
  212. package/docs/themes/barnred/theme.css +0 -306
  213. package/docs/themes/citrine/dark-hc.css +0 -51
  214. package/docs/themes/citrine/dark-mc.css +0 -51
  215. package/docs/themes/citrine/dark.css +0 -51
  216. package/docs/themes/citrine/light-hc.css +0 -51
  217. package/docs/themes/citrine/light-mc.css +0 -51
  218. package/docs/themes/citrine/light.css +0 -51
  219. package/docs/themes/citrine/theme.css +0 -306
  220. package/docs/themes/gray/dark-hc.css +0 -51
  221. package/docs/themes/gray/dark-mc.css +0 -51
  222. package/docs/themes/gray/dark.css +0 -51
  223. package/docs/themes/gray/light-hc.css +0 -51
  224. package/docs/themes/gray/light-mc.css +0 -51
  225. package/docs/themes/gray/light.css +0 -51
  226. package/docs/themes/gray/theme.css +0 -306
  227. package/docs/themes/greenery/dark-hc.css +0 -51
  228. package/docs/themes/greenery/dark-mc.css +0 -51
  229. package/docs/themes/greenery/dark.css +0 -51
  230. package/docs/themes/greenery/light-hc.css +0 -51
  231. package/docs/themes/greenery/light-mc.css +0 -51
  232. package/docs/themes/greenery/light.css +0 -51
  233. package/docs/themes/greenery/theme.css +0 -306
  234. package/docs/themes/hermana/dark-hc.css +0 -51
  235. package/docs/themes/hermana/dark-mc.css +0 -51
  236. package/docs/themes/hermana/dark.css +0 -51
  237. package/docs/themes/hermana/light-hc.css +0 -51
  238. package/docs/themes/hermana/light-mc.css +0 -51
  239. package/docs/themes/hermana/light.css +0 -51
  240. package/docs/themes/hermana/theme.css +0 -306
  241. package/docs/themes/illuminating/dark-hc.css +0 -51
  242. package/docs/themes/illuminating/dark-mc.css +0 -51
  243. package/docs/themes/illuminating/dark.css +0 -51
  244. package/docs/themes/illuminating/light-hc.css +0 -51
  245. package/docs/themes/illuminating/light-mc.css +0 -51
  246. package/docs/themes/illuminating/light.css +0 -51
  247. package/docs/themes/illuminating/theme.css +0 -306
  248. package/docs/themes/magenta/dark-hc.css +0 -51
  249. package/docs/themes/magenta/dark-mc.css +0 -51
  250. package/docs/themes/magenta/dark.css +0 -51
  251. package/docs/themes/magenta/light-hc.css +0 -51
  252. package/docs/themes/magenta/light-mc.css +0 -51
  253. package/docs/themes/magenta/light.css +0 -51
  254. package/docs/themes/magenta/theme.css +0 -306
  255. package/docs/themes/mocha/dark-hc.css +0 -51
  256. package/docs/themes/mocha/dark-mc.css +0 -51
  257. package/docs/themes/mocha/dark.css +0 -51
  258. package/docs/themes/mocha/light-hc.css +0 -51
  259. package/docs/themes/mocha/light-mc.css +0 -51
  260. package/docs/themes/mocha/light.css +0 -51
  261. package/docs/themes/mocha/theme.css +0 -306
  262. package/docs/themes/olivegreen/dark-hc.css +0 -51
  263. package/docs/themes/olivegreen/dark-mc.css +0 -51
  264. package/docs/themes/olivegreen/dark.css +0 -51
  265. package/docs/themes/olivegreen/light-hc.css +0 -51
  266. package/docs/themes/olivegreen/light-mc.css +0 -51
  267. package/docs/themes/olivegreen/light.css +0 -51
  268. package/docs/themes/olivegreen/theme.css +0 -306
  269. package/docs/themes/peri/dark-hc.css +0 -51
  270. package/docs/themes/peri/dark-mc.css +0 -51
  271. package/docs/themes/peri/dark.css +0 -51
  272. package/docs/themes/peri/light-hc.css +0 -51
  273. package/docs/themes/peri/light-mc.css +0 -51
  274. package/docs/themes/peri/light.css +0 -51
  275. package/docs/themes/peri/theme.css +0 -306
  276. package/docs/timepicker.html +0 -160
  277. package/foundations/form/index.ts +0 -174
  278. package/foundations/layout/README.md +0 -127
  279. package/intl.d.ts +0 -9
  280. package/micl.ts +0 -221
  281. package/styles/README.md +0 -196
  282. package/tools/shapes/generate.mjs +0 -828
  283. package/tsconfig.json +0 -116
  284. package/webpack.config.js +0 -104
@@ -41,6 +41,7 @@ This component requires JavaScript for functionality:
41
41
  ```JavaScript
42
42
  import micl from "material-inspired-component-library/dist/micl";
43
43
  ```
44
+ When loading individual JavaScript files, also load `dist/list` — it provides the keyboard navigation of the menu items.
44
45
 
45
46
  This will initialize any Menu component, including those that will be added to the DOM later on.
46
47
 
@@ -176,161 +177,86 @@ Menu items can be grouped by including a [Divider component](../divider/README.m
176
177
 
177
178
  You may include an `<li>` with the `micl-menu__section` class to give the menu item group a descriptive title.
178
179
 
179
- ## Customizations
180
- You can customize the appearance of the Menu 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 menus.
181
-
182
- | Variable name | Default Value | Description |
183
- | ------------------------ | ------------- | ------------------------------------ |
184
- | --md-comp-menu-width-max | 320px | The maximum width allowed for a menu |
185
- | --md-comp-menu-width-min | 112px | The minimum allowed width for a menu |
186
-
187
- The Menu component supports the following CSS variables, as defined in the [Material Design 3 Expressive Menu Specification](https://m3.material.io/components/menus/specs):
188
-
189
- | Variable name |
190
- | ------------- |
191
- | --md-comp-menu-container-elevation |
192
- | --md-comp-menu-container-shape |
193
- | --md-comp-menu-active-container-shape |
194
- | --md-comp-menu-inactive-container-shape |
195
- | --md-comp-menu-gap |
196
- | --md-comp-menu-group-padding |
197
- | --md-comp-menu-group-shape |
198
- | --md-comp-menu-item-height |
199
- | --md-comp-menu-item-bottom-space |
200
- | --md-comp-menu-item-leading-space |
201
- | --md-comp-menu-item-top-space |
202
- | --md-comp-menu-item-trailing-space |
203
- | --md-comp-menu-item-focus-indicator-color |
204
- | --md-comp-menu-item-focus-indicator-offset |
205
- | --md-comp-menu-item-focus-indicator-thickness |
206
- | --md-comp-menu-item-leading-icon-size |
207
- | --md-comp-menu-item-trailing-icon-size |
208
- | --md-comp-menu-item-shape |
209
- | --md-comp-menu-item-shape-single |
210
- | --md-comp-menu-item-selected-shape |
211
- | |
212
- | --md-comp-menu-section-label-bottom-space |
213
- | --md-comp-menu-section-label-top-space |
214
- | |
215
- | --md-comp-menu-standard-container-color |
216
- | --md-comp-menu-standard-menu-item-container-color |
217
- | --md-comp-menu-standard-menu-item-focused-label-text-color |
218
- | --md-comp-menu-standard-menu-item-focused-leading-icon-color |
219
- | --md-comp-menu-standard-menu-item-focused-state-layer-color |
220
- | --md-comp-menu-standard-menu-item-focused-state-layer-opacity |
221
- | --md-comp-menu-standard-menu-item-focused-supporting-text-color |
222
- | --md-comp-menu-standard-menu-item-focused-trailing-icon-color |
223
- | --md-comp-menu-standard-menu-item-focused-trailing-supporting-text-color |
224
- | --md-comp-menu-standard-menu-item-hovered-label-text-color |
225
- | --md-comp-menu-standard-menu-item-hovered-leading-icon-color |
226
- | --md-comp-menu-standard-menu-item-hovered-state-layer-color |
227
- | --md-comp-menu-standard-menu-item-hovered-state-layer-opacity |
228
- | --md-comp-menu-standard-menu-item-hovered-supporting-text-color |
229
- | --md-comp-menu-standard-menu-item-hovered-trailing-icon-color |
230
- | --md-comp-menu-standard-menu-item-hovered-trailing-supporting-text-color |
231
- | --md-comp-menu-standard-menu-item-pressed-label-text-color |
232
- | --md-comp-menu-standard-menu-item-pressed-leading-icon-color |
233
- | --md-comp-menu-standard-menu-item-pressed-state-layer-color |
234
- | --md-comp-menu-standard-menu-item-pressed-state-layer-opacity |
235
- | --md-comp-menu-standard-menu-item-pressed-supporting-text-color |
236
- | --md-comp-menu-standard-menu-item-pressed-trailing-icon-color |
237
- | --md-comp-menu-standard-menu-item-pressed-trailing-supporting-text-color |
238
- | --md-comp-menu-standard-menu-item-label-text-color |
239
- | --md-comp-menu-standard-menu-item-leading-icon-color |
240
- | --md-comp-menu-standard-menu-item-supporting-text-color |
241
- | --md-comp-menu-standard-menu-item-trailing-icon-color |
242
- | --md-comp-menu-standard-menu-item-trailing-supporting-text-color |
243
- | --md-comp-menu-standard-section-label-text-color |
244
- | |
245
- | --md-comp-menu-vibrant-container-color |
246
- | --md-comp-menu-vibrant-menu-item-container-color |
247
- | --md-comp-menu-vibrant-menu-item-focused-label-text-color |
248
- | --md-comp-menu-vibrant-menu-item-focused-leading-icon-color |
249
- | --md-comp-menu-vibrant-menu-item-focused-state-layer-color |
250
- | --md-comp-menu-vibrant-menu-item-focused-state-layer-opacity |
251
- | --md-comp-menu-vibrant-menu-item-focused-supporting-text-color |
252
- | --md-comp-menu-vibrant-menu-item-focused-trailing-icon-color |
253
- | --md-comp-menu-vibrant-menu-item-focused-trailing-supporting-text-color |
254
- | --md-comp-menu-vibrant-menu-item-hovered-label-text-color |
255
- | --md-comp-menu-vibrant-menu-item-hovered-leading-icon-color |
256
- | --md-comp-menu-vibrant-menu-item-hovered-state-layer-color |
257
- | --md-comp-menu-vibrant-menu-item-hovered-state-layer-opacity |
258
- | --md-comp-menu-vibrant-menu-item-hovered-supporting-text-color |
259
- | --md-comp-menu-vibrant-menu-item-hovered-trailing-icon-color |
260
- | --md-comp-menu-vibrant-menu-item-hovered-trailing-supporting-text-color |
261
- | --md-comp-menu-vibrant-menu-item-pressed-label-text-color |
262
- | --md-comp-menu-vibrant-menu-item-pressed-leading-icon-color |
263
- | --md-comp-menu-vibrant-menu-item-pressed-state-layer-color |
264
- | --md-comp-menu-vibrant-menu-item-pressed-state-layer-opacity |
265
- | --md-comp-menu-vibrant-menu-item-pressed-supporting-text-color |
266
- | --md-comp-menu-vibrant-menu-item-pressed-trailing-icon-color |
267
- | --md-comp-menu-vibrant-menu-item-pressed-trailing-supporting-text-color |
268
- | --md-comp-menu-vibrant-menu-item-label-text-color |
269
- | --md-comp-menu-vibrant-menu-item-leading-icon-color |
270
- | --md-comp-menu-vibrant-menu-item-supporting-text-color |
271
- | --md-comp-menu-vibrant-menu-item-trailing-icon-color |
272
- | --md-comp-menu-vibrant-menu-item-trailing-supporting-text-color |
273
- | --md-comp-menu-vibrant-section-label-text-color |
274
- | |
275
- | --md-comp-menu-standard-menu-item-selected-container-color |
276
- | --md-comp-menu-standard-menu-item-selected-label-text-color |
277
- | --md-comp-menu-standard-menu-item-selected-leading-icon-color |
278
- | --md-comp-menu-standard-menu-item-selected-supporting-text-color |
279
- | --md-comp-menu-standard-menu-item-selected-trailing-icon-color |
280
- | --md-comp-menu-standard-menu-item-selected-trailing-supporting-text-color |
281
- | |
282
- | --md-comp-menu-standard-menu-item-selected-disabled-container-color |
283
- | --md-comp-menu-standard-menu-item-selected-disabled-container-opacity |
284
- | --md-comp-menu-standard-menu-item-selected-disabled-label-text-color |
285
- | --md-comp-menu-standard-menu-item-selected-disabled-label-text-opacity |
286
- | --md-comp-menu-standard-menu-item-selected-disabled-leading-icon-color |
287
- | --md-comp-menu-standard-menu-item-selected-disabled-leading-icon-opacity |
288
- | --md-comp-menu-standard-menu-item-selected-disabled-trailing-icon-color |
289
- | --md-comp-menu-standard-menu-item-selected-disabled-trailing-icon-opacity |
290
- | --md-comp-menu-standard-menu-item-selected-disabled-trailing-supporting-text-color |
291
- | --md-comp-menu-standard-menu-item-selected-focused-label-text-color |
292
- | --md-comp-menu-standard-menu-item-selected-focused-leading-icon-color |
293
- | --md-comp-menu-standard-menu-item-selected-focused-state-layer-color |
294
- | --md-comp-menu-standard-menu-item-selected-focused-state-layer-opacity |
295
- | --md-comp-menu-standard-menu-item-selected-focused-supporting-text-color |
296
- | --md-comp-menu-standard-menu-item-selected-focused-trailing-icon-color |
297
- | --md-comp-menu-standard-menu-item-selected-focused-trailing-supporting-text-color |
298
- | --md-comp-menu-standard-menu-item-selected-hovered-label-text-color |
299
- | --md-comp-menu-standard-menu-item-selected-hovered-leading-icon-color |
300
- | --md-comp-menu-standard-menu-item-selected-hovered-state-layer-color |
301
- | --md-comp-menu-standard-menu-item-selected-hovered-state-layer-opacity |
302
- | --md-comp-menu-standard-menu-item-selected-hovered-supporting-text-color |
303
- | --md-comp-menu-standard-menu-item-selected-hovered-trailing-icon-color |
304
- | --md-comp-menu-standard-menu-item-selected-hovered-trailing-supporting-text-color |
305
- | --md-comp-menu-standard-menu-item-selected-pressed-label-text-color |
306
- | --md-comp-menu-standard-menu-item-selected-pressed-leading-icon-color |
307
- | --md-comp-menu-standard-menu-item-selected-pressed-state-layer-color |
308
- | --md-comp-menu-standard-menu-item-selected-pressed-state-layer-opacity |
309
- | --md-comp-menu-standard-menu-item-selected-pressed-supporting-text-color |
310
- | --md-comp-menu-standard-menu-item-selected-pressed-trailing-icon-color |
311
- | --md-comp-menu-standard-menu-item-selected-pressed-trailing-supporting-text-color |
312
- | |
313
- | --md-comp-menu-vibrant-menu-item-selected-container-color |
314
- | --md-comp-menu-vibrant-menu-item-selected-label-text-color |
315
- | --md-comp-menu-vibrant-menu-item-selected-leading-icon-color |
316
- | --md-comp-menu-vibrant-menu-item-selected-supporting-text-color |
317
- | --md-comp-menu-vibrant-menu-item-selected-trailing-icon-color |
318
- | --md-comp-menu-vibrant-menu-item-selected-trailing-supporting-text-color |
319
- | |
320
- | --md-comp-menu-vibrant-menu-item-selected-disabled-label-text-opacity |
321
- | --md-comp-menu-vibrant-menu-item-selected-disabled-leading-icon-opacity |
322
- | --md-comp-menu-vibrant-menu-item-selected-disabled-supporting-text-opacity |
323
- | --md-comp-menu-vibrant-menu-item-selected-disabled-trailing-icon-opacity |
324
- | --md-comp-menu-vibrant-menu-item-selected-disabled-trailing-supporting-text-opacity |
325
- | --md-comp-menu-vibrant-menu-item-selected-focused-state-layer-color |
326
- | --md-comp-menu-vibrant-menu-item-selected-focused-state-layer-opacity |
327
- | --md-comp-menu-vibrant-menu-item-selected-focused-label-text-color |
328
- | --md-comp-menu-vibrant-menu-item-selected-hovered-state-layer-color |
329
- | --md-comp-menu-vibrant-menu-item-selected-hovered-state-layer-opacity |
330
- | --md-comp-menu-vibrant-menu-item-selected-hovered-label-text-color |
331
- | --md-comp-menu-vibrant-menu-item-selected-pressed-state-layer-color |
332
- | --md-comp-menu-vibrant-menu-item-selected-pressed-state-layer-opacity |
333
- | --md-comp-menu-vibrant-menu-item-selected-pressed-label-text-color |
180
+ ## Theming
181
+ Each menu can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention, as defined in the [Material Design 3 Expressive Menu Specification](https://m3.material.io/components/menus/specs). Set them on any appropriate parent element to affect its child menus.
182
+
183
+ ### Container
184
+
185
+ | Custom property | Meaning | Default |
186
+ |---|---|---|
187
+ | `--md-comp-menu-width-min` | The minimum width of a menu | `112px` |
188
+ | `--md-comp-menu-width-max` | The maximum width of a menu | `320px` |
189
+ | `--md-comp-menu-container-elevation` | The shadow (elevation) of the menu surface | `--md-sys-elevation-level2` |
190
+ | `--md-comp-menu-container-shape` | The corner rounding of the menu surface | `--md-sys-shape-corner-large` |
191
+ | `--md-comp-menu-active-container-shape` | The corner rounding while the menu is the frontmost menu | `--md-comp-menu-container-shape` |
192
+ | `--md-comp-menu-inactive-container-shape` | The corner rounding while one of its submenus is open | `--md-sys-shape-corner-small` |
193
+ | `--md-comp-menu-standard-container-color` | The background color of a standard menu | `--md-sys-color-surface-container-low` |
194
+ | `--md-comp-menu-vibrant-container-color` | The background color of a vibrant menu | `--md-sys-color-tertiary-container` |
195
+
196
+ ### Item groups and section labels
197
+
198
+ | Custom property | Meaning | Default |
199
+ |---|---|---|
200
+ | `--md-comp-menu-gap` | The gap between the item groups (the lists) of a menu | `2px` |
201
+ | `--md-comp-menu-group-padding` | The vertical padding inside an item group | `4px` |
202
+ | `--md-comp-menu-group-shape` | The corner rounding of the edges where two item groups meet | `--md-sys-shape-corner-small` |
203
+ | `--md-comp-menu-section-label-top-space` | The padding above a section label | `8px` |
204
+ | `--md-comp-menu-section-label-bottom-space` | The padding below a section label | `8px` |
205
+ | `--md-comp-menu-standard-section-label-text-color` | The text color of a section label in a standard menu | `--md-sys-color-on-surface-variant` |
206
+ | `--md-comp-menu-vibrant-section-label-text-color` | The text color of a section label in a vibrant menu | `--md-sys-color-on-tertiary-container` |
207
+
208
+ ### Item layout
209
+
210
+ | Custom property | Meaning | Default |
211
+ |---|---|---|
212
+ | `--md-comp-menu-item-height` | The height of a menu item | `44px` |
213
+ | `--md-comp-menu-item-top-space` | The padding above the item content | `8px` |
214
+ | `--md-comp-menu-item-bottom-space` | The padding below the item content | `8px` |
215
+ | `--md-comp-menu-item-leading-space` | The padding before the item content | `16px` |
216
+ | `--md-comp-menu-item-trailing-space` | The padding after the item content | `16px` |
217
+ | `--md-comp-menu-item-leading-icon-size` | The size of a leading icon | `20px` |
218
+ | `--md-comp-menu-item-trailing-icon-size` | The size of a trailing icon | `20px` |
219
+ | `--md-comp-menu-item-shape` | The corner rounding of a menu item | `--md-sys-shape-corner-small` |
220
+ | `--md-comp-menu-item-selected-shape` | The corner rounding of a selected menu item | `--md-sys-shape-corner-large` |
221
+ | `--md-comp-menu-item-focus-indicator-color` | The color of the keyboard focus indicator | `--md-sys-color-secondary` |
222
+ | `--md-comp-menu-item-focus-indicator-thickness` | The thickness of the keyboard focus indicator | `3px` |
223
+ | `--md-comp-menu-item-focus-indicator-offset` | The offset of the keyboard focus indicator | `-3px` |
224
+
225
+ ### Item colors
226
+ The colors of menu items follow a naming pattern that combines the menu variant, the item's selection and interaction state, and the colored part:
227
+
228
+ ```
229
+ --md-comp-menu-<variant>-menu-item[-selected][-<state>]-<part>-color
230
+ ```
231
+
232
+ - `<variant>` is `standard` or `vibrant`.
233
+ - `selected` targets items that are checked or contain a checked checkbox or switch.
234
+ - `<state>` is one of `hovered`, `focused`, `pressed` or `disabled`; omit it for the resting state.
235
+ - `<part>` is one of `container`, `label-text`, `leading-icon`, `supporting-text`, `trailing-icon`, `trailing-supporting-text` or `state-layer`.
236
+
237
+ Every `state-layer` color has an `-opacity` companion (defaults: hovered 8%, focused 10%, pressed 10%), and so does every color of a `disabled` state (default: --md-sys-state-disabled-state-layer-opacity, 38%). The `container` part exists for the resting, `selected` and `selected-disabled` combinations only. For example, `--md-comp-menu-standard-menu-item-selected-hovered-label-text-color` is the label color of a hovered selected item in a standard menu.
238
+
239
+ Inside a menu these tokens take precedence over the item color tokens of the [List component](../list/README.md). The defaults per part:
240
+
241
+ **Standard menu**
242
+
243
+ | Part | Resting | Hovered, focused, pressed | Selected (all states) | Disabled |
244
+ |---|---|---|---|---|
245
+ | container | `--md-sys-color-surface-container-low` | | `--md-sys-color-tertiary-container` | selected colors at `38%` |
246
+ | label-text | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-surface` at `38%` |
247
+ | leading-icon, trailing-icon | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-surface` at `38%` |
248
+ | supporting-text, trailing-supporting-text | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-surface-variant` | `--md-sys-color-on-tertiary-container | --md-sys-color-on-surface` at `38%` |
249
+ | state-layer | | --md-sys-color-on-surface | `--md-sys-color-on-tertiary-container` | |
250
+
251
+ **Vibrant menu**
252
+
253
+ | Part | Resting | Hovered, focused, pressed | Selected (all states) | Disabled |
254
+ |---|---|---|---|---|
255
+ | container | `--md-sys-color-tertiary-container` | | `--md-sys-color-tertiary` | selected colors at `38%` |
256
+ | label-text | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
257
+ | leading-icon, trailing-icon | `--md-sys-color-on-tertiary-container` | `--md-sys-color-tertiary` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
258
+ | supporting-text, trailing-supporting-text | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | `--md-sys-color-on-tertiary-container` at `38%` |
259
+ | state-layer | | `--md-sys-color-on-tertiary-container` | `--md-sys-color-on-tertiary` | |
334
260
 
335
261
  **Example: Changing the maximum width**
336
262
 
@@ -19,7 +19,6 @@
19
19
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
  // SOFTWARE.
21
21
 
22
- @use '../../foundations';
23
22
  @use '../../styles/elevation';
24
23
  @use '../../styles/motion';
25
24
  @use '../../styles/shape';
@@ -43,23 +42,17 @@
43
42
  @include typography.scale('label-small');
44
43
  @include typography.scale('body-small');
45
44
 
46
- :root {
47
- --md-comp-menu-width-max: 320px;
48
- --md-comp-menu-width-min: 112px;
49
- }
50
-
51
45
  $menu-padding-block: 4px;
52
46
  $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-three)';
53
47
 
54
- @mixin menu-color-set(
55
- $variant,
56
- $container,
57
- $on-container,
58
- $on-container-strong,
59
- $on-icon-active,
60
- $selected-container,
61
- $on-selected
62
- ) {
48
+ @mixin menu-color-set($variant) {
49
+ $container: var(--_menu-item-bg);
50
+ $on-container: var(--_menu-on);
51
+ $on-container-strong: var(--_menu-on-strong);
52
+ $on-icon-active: var(--_menu-icon-active);
53
+ $selected-container: var(--_menu-selected-bg);
54
+ $on-selected: var(--_menu-on-selected);
55
+
63
56
  --md-comp-list-item-container-color: var(--md-comp-menu-#{$variant}-menu-item-container-color, #{$container});
64
57
  --md-comp-list-item-label-text-color: var(--md-comp-menu-#{$variant}-menu-item-label-text-color, #{$on-container});
65
58
  --md-comp-list-item-leading-icon-color: var(--md-comp-menu-#{$variant}-menu-item-leading-icon-color, #{$on-container});
@@ -68,15 +61,15 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
68
61
  --md-comp-list-item-trailing-supporting-text-color: var(--md-comp-menu-#{$variant}-menu-item-trailing-supporting-text-color, #{$on-container});
69
62
 
70
63
  --md-comp-list-item-disabled-label-text-color: var(--md-comp-menu-#{$variant}-menu-item-disabled-label-text-color, #{$on-container-strong});
71
- --md-comp-list-item-disabled-label-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-label-text-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
64
+ --md-comp-list-item-disabled-label-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-label-text-opacity, var(--_menu-do));
72
65
  --md-comp-list-item-disabled-leading-icon-color: var(--md-comp-menu-#{$variant}-menu-item-disabled-leading-icon-color, #{$on-container-strong});
73
- --md-comp-list-item-disabled-leading-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-leading-icon-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
66
+ --md-comp-list-item-disabled-leading-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-leading-icon-opacity, var(--_menu-do));
74
67
  --md-comp-list-item-disabled-supporting-text-color: var(--md-comp-menu-#{$variant}-menu-item-disabled-supporting-text-color, #{$on-container-strong});
75
- --md-comp-list-item-disabled-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-supporting-text-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
68
+ --md-comp-list-item-disabled-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-supporting-text-opacity, var(--_menu-do));
76
69
  --md-comp-list-item-disabled-trailing-icon-color: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-icon-color, #{$on-container-strong});
77
- --md-comp-list-item-disabled-trailing-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-icon-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
70
+ --md-comp-list-item-disabled-trailing-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-icon-opacity, var(--_menu-do));
78
71
  --md-comp-list-item-disabled-trailing-supporting-text-color: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-supporting-text-color, #{$on-container-strong});
79
- --md-comp-list-item-disabled-trailing-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-supporting-text-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
72
+ --md-comp-list-item-disabled-trailing-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-disabled-trailing-supporting-text-opacity, var(--_menu-do));
80
73
 
81
74
  --md-comp-list-item-focus-label-text-color: var(--md-comp-menu-#{$variant}-menu-item-focused-label-text-color, #{$on-container-strong});
82
75
  --md-comp-list-item-focus-leading-icon-color: var(--md-comp-menu-#{$variant}-menu-item-focused-leading-icon-color, #{$on-icon-active});
@@ -110,15 +103,15 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
110
103
  --md-comp-list-item-selected-trailing-supporting-text-color: var(--md-comp-menu-#{$variant}-menu-item-selected-trailing-supporting-text-color, #{$on-selected});
111
104
 
112
105
  --md-comp-list-item-selected-disabled-container-color: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-container-color, #{$selected-container});
113
- --md-comp-list-item-selected-disabled-container-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-container-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
106
+ --md-comp-list-item-selected-disabled-container-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-container-opacity, var(--_menu-do));
114
107
  --md-comp-list-item-selected-disabled-label-text-color: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-label-text-color, #{$on-selected});
115
- --md-comp-list-item-selected-disabled-label-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-label-text-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
108
+ --md-comp-list-item-selected-disabled-label-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-label-text-opacity, var(--_menu-do));
116
109
  --md-comp-list-item-selected-disabled-leading-icon-color: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-leading-icon-color, #{$on-selected});
117
- --md-comp-list-item-selected-disabled-leading-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-leading-icon-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
110
+ --md-comp-list-item-selected-disabled-leading-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-leading-icon-opacity, var(--_menu-do));
118
111
  --md-comp-list-item-selected-disabled-trailing-icon-color: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-icon-color, #{$on-selected});
119
- --md-comp-list-item-selected-disabled-trailing-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-icon-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
112
+ --md-comp-list-item-selected-disabled-trailing-icon-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-icon-opacity, var(--_menu-do));
120
113
  --md-comp-list-item-selected-disabled-trailing-supporting-text-color: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-supporting-text-color, #{$on-selected});
121
- --md-comp-list-item-selected-disabled-trailing-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-supporting-text-opacity, var(--md-sys-state-disabled-state-layer-opacity, 38%));
114
+ --md-comp-list-item-selected-disabled-trailing-supporting-text-opacity: var(--md-comp-menu-#{$variant}-menu-item-selected-disabled-trailing-supporting-text-opacity, var(--_menu-do));
122
115
 
123
116
  --md-comp-list-item-selected-focus-label-text-color: var(--md-comp-menu-#{$variant}-menu-item-selected-focused-label-text-color, #{$on-selected});
124
117
  --md-comp-list-item-selected-focus-leading-icon-color: var(--md-comp-menu-#{$variant}-menu-item-selected-focused-leading-icon-color, #{$on-selected});
@@ -173,15 +166,15 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
173
166
  --md-comp-list-item-focus-indicator-offset: var(--md-comp-menu-item-focus-indicator-offset, var(--md-sys-state-focus-indicator-inner-offset, -3px));
174
167
  --md-comp-list-item-focus-indicator-thickness: var(--md-comp-menu-item-focus-indicator-thickness, var(--md-sys-state-focus-indicator-thickness, 3px));
175
168
 
176
- @include menu-color-set(
177
- 'standard',
178
- var(--md-sys-color-surface-container-low),
179
- var(--md-sys-color-on-surface-variant),
180
- var(--md-sys-color-on-surface),
181
- var(--md-sys-color-on-surface-variant),
182
- var(--md-sys-color-tertiary-container),
183
- var(--md-sys-color-on-tertiary-container)
184
- );
169
+ --_menu-item-bg: var(--md-sys-color-surface-container-low);
170
+ --_menu-on: var(--md-sys-color-on-surface-variant);
171
+ --_menu-on-strong: var(--md-sys-color-on-surface);
172
+ --_menu-icon-active: var(--md-sys-color-on-surface-variant);
173
+ --_menu-selected-bg: var(--md-sys-color-tertiary-container);
174
+ --_menu-on-selected: var(--md-sys-color-on-tertiary-container);
175
+ --_menu-do: var(--md-sys-state-disabled-state-layer-opacity, 38%);
176
+
177
+ @include menu-color-set('standard');
185
178
 
186
179
  .micl-menu__section {
187
180
  @include typography.label-small;
@@ -206,7 +199,6 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
206
199
  }
207
200
 
208
201
  .micl-menu[popover] {
209
- display: flex;
210
202
  flex-direction: column;
211
203
  position: absolute;
212
204
  inset: unset;
@@ -221,24 +213,27 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
221
213
  border: none;
222
214
  outline: none;
223
215
  background-color: transparent;
216
+ --micl-duration: var(--md-comp-menu-motion-spatial-duration-reverse);
217
+ --micl-easing: linear;
218
+ --_group-shape: var(--md-comp-menu-group-shape, var(--md-sys-shape-corner-small, 8px));
219
+
224
220
  opacity: 0;
225
221
  overflow: visible;
226
222
  transform: scaleY(0);
227
223
  transform-origin: center top;
228
224
  transition:
229
- opacity var(--md-comp-menu-motion-spatial-duration-reverse) linear,
230
- transform var(--md-comp-menu-motion-spatial-duration-reverse) var(--md-comp-menu-motion-spatial),
231
- overlay var(--md-comp-menu-motion-spatial-duration-reverse) linear allow-discrete,
232
- display var(--md-comp-menu-motion-spatial-duration-reverse) linear allow-discrete;
225
+ opacity var(--micl-duration) var(--micl-easing),
226
+ transform var(--micl-duration) var(--md-comp-menu-motion-spatial),
227
+ overlay var(--micl-duration) linear allow-discrete,
228
+ display var(--micl-duration) linear allow-discrete;
233
229
 
234
230
  &:popover-open {
231
+ --micl-duration: var(--md-comp-menu-motion-spatial-duration);
232
+ --micl-easing: #{motion.$md-sys-motion-easing-emphasized-decelerate};
233
+
234
+ display: flex;
235
235
  opacity: 1;
236
236
  transform: scaleY(1);
237
- transition:
238
- opacity var(--md-comp-menu-motion-spatial-duration) motion.$md-sys-motion-easing-emphasized-decelerate,
239
- transform var(--md-comp-menu-motion-spatial-duration) var(--md-comp-menu-motion-spatial),
240
- overlay var(--md-comp-menu-motion-spatial-duration) linear allow-discrete,
241
- display var(--md-comp-menu-motion-spatial-duration) linear allow-discrete;
242
237
 
243
238
  @starting-style {
244
239
  opacity: 0;
@@ -268,12 +263,12 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
268
263
  transition: border-radius var(--md-comp-menu-motion-effects-duration-reverse) linear;
269
264
 
270
265
  &+ .micl-list {
271
- border-start-start-radius: var(--md-comp-menu-group-shape, var(--md-sys-shape-corner-small, 8px));
272
- border-start-end-radius: var(--md-comp-menu-group-shape, var(--md-sys-shape-corner-small, 8px));
266
+ border-start-start-radius: var(--_group-shape);
267
+ border-start-end-radius: var(--_group-shape);
273
268
  }
274
269
  &:has(+ .micl-list) {
275
- border-end-start-radius: var(--md-comp-menu-group-shape, var(--md-sys-shape-corner-small, 8px));
276
- border-end-end-radius: var(--md-comp-menu-group-shape, var(--md-sys-shape-corner-small, 8px));
270
+ border-end-start-radius: var(--_group-shape);
271
+ border-end-end-radius: var(--_group-shape);
277
272
  }
278
273
 
279
274
  #{$item-classes} > .micl-menu[popover] {
@@ -296,20 +291,19 @@ $item-classes: ':is(.micl-list-item-one, .micl-list-item-two, .micl-list-item-th
296
291
  }
297
292
 
298
293
  &.micl-menu--vibrant > .micl-list {
299
- @include menu-color-set(
300
- 'vibrant',
301
- var(--md-sys-color-tertiary-container),
302
- var(--md-sys-color-on-tertiary-container),
303
- var(--md-sys-color-on-tertiary-container),
304
- var(--md-sys-color-tertiary),
305
- var(--md-sys-color-tertiary),
306
- var(--md-sys-color-on-tertiary)
307
- );
294
+ --_menu-item-bg: var(--md-sys-color-tertiary-container);
295
+ --_menu-on: var(--md-sys-color-on-tertiary-container);
296
+ --_menu-on-strong: var(--md-sys-color-on-tertiary-container);
297
+ --_menu-icon-active: var(--md-sys-color-tertiary);
298
+ --_menu-selected-bg: var(--md-sys-color-tertiary);
299
+ --_menu-on-selected: var(--md-sys-color-on-tertiary);
300
+
301
+ @include menu-color-set('vibrant');
308
302
 
309
303
  background-color: var(--md-comp-menu-vibrant-container-color, var(--md-sys-color-tertiary-container));
310
304
  }
311
305
  }
312
306
 
313
- [dir=rtl] .micl-menu[popover] > .micl-list button[popovertarget] .micl-list-item__icon {
307
+ .micl-menu[popover] > .micl-list button[popovertarget] .micl-list-item__icon:dir(rtl) {
314
308
  transform: rotate(180deg);
315
309
  }
@@ -0,0 +1,108 @@
1
+ # Navigation bar
2
+ This component implements the [Material Design 3 Expressive Navigation bar](https://m3.material.io/components/navigation-bar/overview) design. A navigation bar lets people switch between UI views on smaller devices, anchored to the bottom of the screen.
3
+
4
+ ## Basic Usage
5
+
6
+ ### HTML
7
+ To create a navigation bar, use a `<nav>` element with the `micl-navigationbar` class. Inside, use anchor elements `<a>` to create the selectable navigation items. The markup mirrors the Navigation rail component.
8
+
9
+ ```HTML
10
+ <nav id="mynavigationbar" class="micl-navigationbar">
11
+ <div class="micl-navigationbar__content" role="menu">
12
+ <a href="#" class="micl-navigationbar__item" role="menuitem" aria-current="page">
13
+ <span class="micl-navigationbar__icon material-symbols-outlined" aria-hidden="true">inbox</span>
14
+ <span class="micl-navigationbar__text">Inbox</span>
15
+ </a>
16
+ <a href="#" class="micl-navigationbar__item" role="menuitem">
17
+ <span class="micl-navigationbar__icon material-symbols-outlined" aria-hidden="true">outbox</span>
18
+ <span class="micl-navigationbar__text">Outbox</span>
19
+ </a>
20
+ </div>
21
+ </nav>
22
+ ```
23
+
24
+ Use three to five items. The navigation bar is fixed to the bottom of the screen (respecting any safe-area inset), and the component automatically reserves matching space at the bottom of the page so that the content is not obscured.
25
+
26
+ > [!WARNING]
27
+ > The navigation bar component adds a `padding-block-end` CSS rule to the `<body>` element to reserve space for the bar. It matches the height of the displayed variant (including any safe-area inset) and is removed while an adaptive navigation bar is displayed as a navigation rail. Overriding this rule may cause page content to be obscured by the bar.
28
+
29
+ ### CSS
30
+ Import the navigation bar styles into your project:
31
+
32
+ ```CSS
33
+ @use "material-inspired-component-library/dist/navigationbar";
34
+ ```
35
+
36
+ Or import all MICL styles:
37
+ ```CSS
38
+ @use "material-inspired-component-library/styles";
39
+ ```
40
+
41
+ ### JavaScript
42
+ No custom JavaScript is required for the core functionality of this component.
43
+
44
+ ### Live Demo
45
+ A live example of the [Navigation bar component](https://henkpb.github.io/micl/navigationbar.html) is available to interact with.
46
+
47
+ ## Variants
48
+
49
+ ### Tall navigation bar
50
+ The **tall** navigation bar is 80px high instead of 64px, with the items vertically centered.
51
+
52
+ ```HTML
53
+ <nav class="micl-navigationbar micl-navigationbar--tall">
54
+ ...
55
+ </nav>
56
+ ```
57
+
58
+ ### Horizontal items
59
+ On wider compact devices (for example phones in landscape), the items can show the icon and label side by side in a single 40px-high pill.
60
+
61
+ ```HTML
62
+ <nav class="micl-navigationbar micl-navigationbar--horizontal">
63
+ ...
64
+ </nav>
65
+ ```
66
+
67
+ ### Adaptive navigation
68
+ An **adaptive** navigation bar acts as a navigation bar on narrow screens and is displayed as a permanently visible, collapsed [Navigation rail](../navigationrail/README.md) on wide screens. Add one of the following modifier classes:
69
+
70
+ | Class | Navigation bar below | Navigation rail from |
71
+ | ----- | -------------------- | -------------------- |
72
+ | `micl-navigationbar--bar-to-medium` | `600px` | `600px` |
73
+ | `micl-navigationbar--bar-to-expanded` | `840px` | `840px` |
74
+
75
+ ```HTML
76
+ <nav class="micl-navigationbar micl-navigationbar--bar-to-medium">
77
+ ...
78
+ </nav>
79
+ ```
80
+
81
+ Place the `<nav>` element before the main content, where a standard navigation rail would go, so that it occupies its usual position when the wide-screen layout applies. On wide screens the component is themed by the `--md-comp-nav-rail-*` custom properties of the Navigation rail component. Do not combine the adaptive classes with the `micl-navigationbar--tall` or `micl-navigationbar--horizontal` variants.
82
+
83
+ ## Theming
84
+ Each navigation bar can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention.
85
+
86
+ | Custom property | Meaning | Default |
87
+ |---|---|---|
88
+ | `--md-comp-nav-bar-container-color` | The background color of the navigation bar | `--md-sys-color-surface-container` |
89
+ | `--md-comp-nav-bar-container-elevation` | The shadow (elevation) of the navigation bar | `--md-sys-elevation-level2` |
90
+ | `--md-comp-nav-bar-container-height` | The height of the navigation bar (excluding any safe-area inset) | `64px` |
91
+ | `--md-comp-nav-bar-tall-container-height` | The height of the tall navigation bar | `80px` |
92
+ | `--md-comp-nav-bar-container-shape` | The corner rounding of the navigation bar | `0px` |
93
+ | `--md-comp-nav-bar-item-icon-size` | The size of the item icons | `--md-sys-icon-size` |
94
+ | `--md-comp-nav-bar-item-active-indicator-shape` | The corner rounding of an item's active indicator | half the indicator height |
95
+ | `--md-comp-nav-bar-item-active-indicator-icon-label-space` | The space between the icon and the label | `4px` |
96
+ | `--md-comp-nav-bar-item-vertical-active-indicator-width` | The width of an item's active indicator | `56px` |
97
+ | `--md-comp-nav-bar-item-vertical-active-indicator-height` | The height of an item's active indicator | `32px` |
98
+ | `--md-comp-nav-bar-item-horizontal-active-indicator-height` | The height of an item's active indicator with horizontal items | `40px` |
99
+ | `--md-comp-nav-bar-item-horizontal-active-indicator-leading-space` | The space between the start edge of a horizontal item's active indicator and the icon | `16px` |
100
+ | `--md-comp-nav-bar-item-horizontal-active-indicator-trailing-space` | The space between the label and the end edge of a horizontal item's active indicator | `16px` |
101
+
102
+ **Example: Changing the background color of the navigation bar**
103
+
104
+ ```HTML
105
+ <nav class="micl-navigationbar" style="--md-comp-nav-bar-container-color:var(--md-sys-color-surface)">
106
+ ...
107
+ </nav>
108
+ ```