material 3.7.2 → 3.8.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 (313) hide show
  1. package/NOTICE +223 -0
  2. package/README.md +5 -3
  3. package/dist/components/extended-fab/types.d.ts +3 -0
  4. package/dist/components/fab/types.d.ts +3 -0
  5. package/dist/components/slider/features/controller.js +24 -8
  6. package/dist/elements/css/card.css +1 -1
  7. package/dist/elements/css/card.js +1 -1
  8. package/dist/elements/css/dialog.css +1 -1
  9. package/dist/elements/css/dialog.js +1 -1
  10. package/dist/elements/css/menu.css +1 -1
  11. package/dist/elements/css/menu.js +1 -1
  12. package/dist/elements/css/select.css +1 -1
  13. package/dist/elements/css/select.js +1 -1
  14. package/dist/elements/css/slider.css +1 -1
  15. package/dist/elements/css/slider.js +1 -1
  16. package/dist/elements/css/tabs.css +1 -1
  17. package/dist/elements/css/tabs.js +1 -1
  18. package/dist/elements/css/timepicker.css +1 -1
  19. package/dist/elements/css/timepicker.js +1 -1
  20. package/dist/elements/extended-fab.d.ts +1 -0
  21. package/dist/elements/fab.d.ts +1 -0
  22. package/dist/elements/preupgrade/badge.css +1 -1
  23. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  24. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  25. package/dist/elements/preupgrade/button-group.css +1 -1
  26. package/dist/elements/preupgrade/button.css +1 -1
  27. package/dist/elements/preupgrade/card.css +1 -1
  28. package/dist/elements/preupgrade/carousel.css +1 -1
  29. package/dist/elements/preupgrade/checkbox.css +1 -1
  30. package/dist/elements/preupgrade/chips.css +1 -1
  31. package/dist/elements/preupgrade/datepicker.css +1 -1
  32. package/dist/elements/preupgrade/dialog.css +1 -1
  33. package/dist/elements/preupgrade/divider.css +1 -1
  34. package/dist/elements/preupgrade/drawer.css +1 -1
  35. package/dist/elements/preupgrade/extended-fab.css +1 -1
  36. package/dist/elements/preupgrade/fab-menu.css +1 -1
  37. package/dist/elements/preupgrade/fab.css +1 -1
  38. package/dist/elements/preupgrade/icon-button.css +1 -1
  39. package/dist/elements/preupgrade/list.css +1 -1
  40. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  41. package/dist/elements/preupgrade/menu.css +1 -1
  42. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  43. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  44. package/dist/elements/preupgrade/progress.css +1 -1
  45. package/dist/elements/preupgrade/radios.css +1 -1
  46. package/dist/elements/preupgrade/search.css +1 -1
  47. package/dist/elements/preupgrade/select.css +1 -1
  48. package/dist/elements/preupgrade/side-sheet.css +1 -1
  49. package/dist/elements/preupgrade/slider.css +1 -1
  50. package/dist/elements/preupgrade/snackbar.css +1 -1
  51. package/dist/elements/preupgrade/split-button.css +1 -1
  52. package/dist/elements/preupgrade/switch.css +1 -1
  53. package/dist/elements/preupgrade/tabs.css +1 -1
  54. package/dist/elements/preupgrade/text-field.css +1 -1
  55. package/dist/elements/preupgrade/timepicker.css +1 -1
  56. package/dist/elements/preupgrade/toolbar.css +1 -1
  57. package/dist/elements/preupgrade/tooltip.css +1 -1
  58. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  59. package/dist/elements/preupgrade.css +1 -1
  60. package/dist/styles/badge.css +1 -1
  61. package/dist/styles/base-lite.css +2 -2
  62. package/dist/styles/base.css +2 -2
  63. package/dist/styles/bottom-app-bar.css +1 -1
  64. package/dist/styles/bottom-sheet.css +1 -1
  65. package/dist/styles/button-group.css +1 -1
  66. package/dist/styles/button.css +1 -1
  67. package/dist/styles/card.css +2 -2
  68. package/dist/styles/carousel.css +1 -1
  69. package/dist/styles/checkbox.css +1 -1
  70. package/dist/styles/chips.css +1 -1
  71. package/dist/styles/contrast.css +2 -2
  72. package/dist/styles/datepicker.css +1 -1
  73. package/dist/styles/dialog.css +2 -2
  74. package/dist/styles/divider.css +1 -1
  75. package/dist/styles/drawer.css +1 -1
  76. package/dist/styles/extended-fab.css +1 -1
  77. package/dist/styles/fab-menu.css +1 -1
  78. package/dist/styles/fab.css +1 -1
  79. package/dist/styles/icon-button.css +1 -1
  80. package/dist/styles/list.css +1 -1
  81. package/dist/styles/loading-indicator.css +1 -1
  82. package/dist/styles/menu.css +2 -2
  83. package/dist/styles/navigation-bar.css +1 -1
  84. package/dist/styles/navigation-rail.css +1 -1
  85. package/dist/styles/progress.css +1 -1
  86. package/dist/styles/radios.css +1 -1
  87. package/dist/styles/search.css +1 -1
  88. package/dist/styles/select.css +2 -2
  89. package/dist/styles/side-sheet.css +1 -1
  90. package/dist/styles/slider.css +2 -2
  91. package/dist/styles/snackbar.css +1 -1
  92. package/dist/styles/split-button.css +1 -1
  93. package/dist/styles/switch.css +1 -1
  94. package/dist/styles/tabs.css +2 -2
  95. package/dist/styles/text-field.css +1 -1
  96. package/dist/styles/timepicker.css +2 -2
  97. package/dist/styles/toolbar.css +1 -1
  98. package/dist/styles/tooltip.css +1 -1
  99. package/dist/styles/top-app-bar.css +1 -1
  100. package/dist/styles/typography.css +1 -1
  101. package/dist/styles/utilities.css +1 -1
  102. package/dist/styles.css +2 -2
  103. package/dist/theme/image.d.ts +2 -0
  104. package/dist/theme/image.js +5 -0
  105. package/dist/theme/index.d.ts +23 -0
  106. package/dist/theme/index.js +32 -0
  107. package/dist/theme/roles.js +68 -0
  108. package/dist/theme/variants.d.ts +9 -0
  109. package/dist/theme/variants.js +17 -0
  110. package/dist/theme/vendor/contrast/contrast.js +72 -0
  111. package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
  112. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +63 -0
  113. package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
  114. package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
  115. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +24 -0
  116. package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
  117. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +87 -0
  118. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
  119. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +124 -0
  120. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
  121. package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
  122. package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
  123. package/dist/theme/vendor/hct/cam16.js +249 -0
  124. package/dist/theme/vendor/hct/hct.d.ts +23 -0
  125. package/dist/theme/vendor/hct/hct.js +86 -0
  126. package/dist/theme/vendor/hct/hct_solver.js +390 -0
  127. package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
  128. package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
  129. package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
  130. package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
  131. package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
  132. package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
  133. package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
  134. package/dist/theme/vendor/scheme/scheme_content.js +30 -0
  135. package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
  136. package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
  137. package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
  138. package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
  139. package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
  140. package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
  141. package/dist/theme/vendor/score/score.js +100 -0
  142. package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
  143. package/dist/theme/vendor/utils/color_utils.js +173 -0
  144. package/dist/theme/vendor/utils/image_utils.js +72 -0
  145. package/dist/theme/vendor/utils/math_utils.js +75 -0
  146. package/dist/theme/vendor/utils/string_utils.js +61 -0
  147. package/dist/themes/autumn-contrast.css +2 -2
  148. package/dist/themes/autumn.css +2 -2
  149. package/dist/themes/baseline-contrast.css +2 -2
  150. package/dist/themes/baseline.css +2 -2
  151. package/dist/themes/brownbeige-contrast.css +2 -2
  152. package/dist/themes/brownbeige.css +2 -2
  153. package/dist/themes/content-contrast.css +2 -2
  154. package/dist/themes/content.css +2 -2
  155. package/dist/themes/desert-contrast.css +2 -2
  156. package/dist/themes/desert.css +2 -2
  157. package/dist/themes/expressive-contrast.css +2 -2
  158. package/dist/themes/expressive.css +2 -2
  159. package/dist/themes/fidelity-contrast.css +2 -2
  160. package/dist/themes/fidelity.css +2 -2
  161. package/dist/themes/forest-contrast.css +2 -2
  162. package/dist/themes/forest.css +2 -2
  163. package/dist/themes/fruit-salad-contrast.css +2 -2
  164. package/dist/themes/fruit-salad.css +2 -2
  165. package/dist/themes/highcontrast-contrast.css +2 -2
  166. package/dist/themes/highcontrast.css +2 -2
  167. package/dist/themes/monochrome-contrast.css +2 -2
  168. package/dist/themes/monochrome.css +2 -2
  169. package/dist/themes/neutral-contrast.css +2 -2
  170. package/dist/themes/neutral.css +2 -2
  171. package/dist/themes/ocean-contrast.css +2 -2
  172. package/dist/themes/ocean.css +2 -2
  173. package/dist/themes/rainbow-contrast.css +2 -2
  174. package/dist/themes/rainbow.css +2 -2
  175. package/dist/themes/sageivory-contrast.css +2 -2
  176. package/dist/themes/sageivory.css +2 -2
  177. package/dist/themes/spring-contrast.css +2 -2
  178. package/dist/themes/spring.css +2 -2
  179. package/dist/themes/summer-contrast.css +2 -2
  180. package/dist/themes/summer.css +2 -2
  181. package/dist/themes/sunset-contrast.css +2 -2
  182. package/dist/themes/sunset.css +2 -2
  183. package/dist/themes/tealcaramel-contrast.css +2 -2
  184. package/dist/themes/tealcaramel.css +2 -2
  185. package/dist/themes/vibrant-contrast.css +2 -2
  186. package/dist/themes/vibrant.css +2 -2
  187. package/package.json +15 -1
  188. package/src/styles/abstract/_base.scss +0 -1
  189. package/src/styles/abstract/_direction.scss +121 -152
  190. package/src/styles/abstract/_emit.scss +7 -16
  191. package/src/styles/abstract/_floating-placement.scss +9 -10
  192. package/src/styles/abstract/_functions.scss +64 -79
  193. package/src/styles/abstract/_mixins.scss +355 -459
  194. package/src/styles/abstract/_theme.scss +122 -136
  195. package/src/styles/abstract/_variables.scss +320 -390
  196. package/src/styles/abstract/chips/_assist.scss +2 -3
  197. package/src/styles/abstract/chips/_filter.scss +2 -3
  198. package/src/styles/abstract/chips/_input.scss +2 -3
  199. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  200. package/src/styles/base/_body-theme.scss +10 -15
  201. package/src/styles/base/_document.scss +10 -33
  202. package/src/styles/base/_reset.scss +20 -40
  203. package/src/styles/base/_tokens.scss +6 -21
  204. package/src/styles/base/_typescale-tokens.scss +12 -16
  205. package/src/styles/base/_typography.scss +28 -37
  206. package/src/styles/components/_badge.scss +171 -193
  207. package/src/styles/components/_bottom-app-bar.scss +72 -90
  208. package/src/styles/components/_bottom-sheet.scss +188 -232
  209. package/src/styles/components/_button-group.scss +140 -189
  210. package/src/styles/components/_button.scss +382 -478
  211. package/src/styles/components/_card.scss +349 -473
  212. package/src/styles/components/_carousel.scss +134 -156
  213. package/src/styles/components/_checkbox.scss +208 -249
  214. package/src/styles/components/_chips.scss +239 -304
  215. package/src/styles/components/_datepicker.scss +172 -222
  216. package/src/styles/components/_dialog.scss +428 -553
  217. package/src/styles/components/_divider.scss +37 -46
  218. package/src/styles/components/_drawer.scss +571 -678
  219. package/src/styles/components/_extended-fab.scss +263 -294
  220. package/src/styles/components/_fab-menu.scss +225 -267
  221. package/src/styles/components/_fab.scss +197 -218
  222. package/src/styles/components/_icon-button.scss +483 -588
  223. package/src/styles/components/_list.scss +115 -144
  224. package/src/styles/components/_loading-indicator.scss +23 -29
  225. package/src/styles/components/_menu.scss +543 -699
  226. package/src/styles/components/_navigation-bar.scss +189 -234
  227. package/src/styles/components/_navigation-rail.scss +256 -312
  228. package/src/styles/components/_progress.scss +60 -85
  229. package/src/styles/components/_radios.scss +170 -207
  230. package/src/styles/components/_search.scss +369 -455
  231. package/src/styles/components/_select.scss +78 -185
  232. package/src/styles/components/_side-sheet.scss +234 -292
  233. package/src/styles/components/_slider.scss +289 -367
  234. package/src/styles/components/_snackbar.scss +149 -198
  235. package/src/styles/components/_split-button.scss +139 -228
  236. package/src/styles/components/_switch.scss +282 -349
  237. package/src/styles/components/_tabs.scss +350 -547
  238. package/src/styles/components/_text-field.scss +788 -980
  239. package/src/styles/components/_timepicker.scss +435 -506
  240. package/src/styles/components/_toolbar.scss +178 -242
  241. package/src/styles/components/_tooltip.scss +152 -197
  242. package/src/styles/components/_top-app-bar.scss +206 -230
  243. package/src/styles/elements/_badge.scss +42 -61
  244. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  245. package/src/styles/elements/_bottom-sheet.scss +0 -3
  246. package/src/styles/elements/_button-group.scss +80 -80
  247. package/src/styles/elements/_button.scss +72 -88
  248. package/src/styles/elements/_card.scss +48 -57
  249. package/src/styles/elements/_carousel.scss +2 -5
  250. package/src/styles/elements/_checkbox.scss +32 -43
  251. package/src/styles/elements/_chips.scss +18 -22
  252. package/src/styles/elements/_config.scss +11 -26
  253. package/src/styles/elements/_datepicker.scss +17 -22
  254. package/src/styles/elements/_dialog.scss +0 -3
  255. package/src/styles/elements/_divider.scss +11 -13
  256. package/src/styles/elements/_drawer.scss +9 -14
  257. package/src/styles/elements/_extended-fab.scss +36 -40
  258. package/src/styles/elements/_fab-menu.scss +21 -25
  259. package/src/styles/elements/_fab.scss +17 -20
  260. package/src/styles/elements/_field.scss +93 -114
  261. package/src/styles/elements/_icon-button.scss +34 -38
  262. package/src/styles/elements/_index.scss +0 -4
  263. package/src/styles/elements/_list.scss +19 -26
  264. package/src/styles/elements/_loading-indicator.scss +6 -9
  265. package/src/styles/elements/_menu.scss +0 -3
  266. package/src/styles/elements/_navigation-bar.scss +5 -9
  267. package/src/styles/elements/_navigation-rail.scss +10 -15
  268. package/src/styles/elements/_progress.scss +15 -18
  269. package/src/styles/elements/_radios.scss +24 -49
  270. package/src/styles/elements/_search.scss +19 -24
  271. package/src/styles/elements/_select.scss +4 -9
  272. package/src/styles/elements/_side-sheet.scss +0 -3
  273. package/src/styles/elements/_slider.scss +15 -35
  274. package/src/styles/elements/_snackbar.scss +0 -3
  275. package/src/styles/elements/_split-button.scss +33 -39
  276. package/src/styles/elements/_switch.scss +50 -90
  277. package/src/styles/elements/_tabs.scss +9 -13
  278. package/src/styles/elements/_text-field.scss +150 -178
  279. package/src/styles/elements/_timepicker.scss +0 -3
  280. package/src/styles/elements/_toolbar.scss +30 -35
  281. package/src/styles/elements/_tooltip.scss +0 -3
  282. package/src/styles/elements/_top-app-bar.scss +38 -45
  283. package/src/styles/main.scss +0 -15
  284. package/src/styles/themes/_autumn.scss +258 -258
  285. package/src/styles/themes/_base-theme.scss +112 -134
  286. package/src/styles/themes/_baseline.scss +291 -314
  287. package/src/styles/themes/_brownbeige.scss +270 -250
  288. package/src/styles/themes/_content.scss +268 -248
  289. package/src/styles/themes/_desert.scss +270 -250
  290. package/src/styles/themes/_expressive.scss +270 -250
  291. package/src/styles/themes/_fidelity.scss +268 -248
  292. package/src/styles/themes/_forest.scss +260 -259
  293. package/src/styles/themes/_fruit-salad.scss +270 -250
  294. package/src/styles/themes/_highcontrast.scss +183 -172
  295. package/src/styles/themes/_index.scss +0 -1
  296. package/src/styles/themes/_monochrome.scss +254 -234
  297. package/src/styles/themes/_neutral.scss +270 -250
  298. package/src/styles/themes/_ocean.scss +260 -259
  299. package/src/styles/themes/_rainbow.scss +270 -250
  300. package/src/styles/themes/_sageivory.scss +270 -250
  301. package/src/styles/themes/_spring.scss +256 -255
  302. package/src/styles/themes/_summer.scss +270 -250
  303. package/src/styles/themes/_sunset.scss +260 -259
  304. package/src/styles/themes/_tealcaramel.scss +270 -250
  305. package/src/styles/themes/_vibrant.scss +270 -250
  306. package/src/styles/utilities/_colors.scss +44 -50
  307. package/src/styles/utilities/_flexbox.scss +48 -59
  308. package/src/styles/utilities/_layout.scss +516 -591
  309. package/src/styles/utilities/_ripple.scss +61 -70
  310. package/src/styles/utilities/_spacing.scss +120 -127
  311. package/src/styles/utilities/_typography.scss +45 -58
  312. package/src/styles/utilities/_visibility.scss +61 -76
  313. package/dist/package.json +0 -488
@@ -1,55 +1,51 @@
1
- // src/styles/elements/_icon-button.scss
2
- // <m-icon-button> before upgrade: the container, round, at its size and width.
3
1
  @use 'sass:list';
4
2
  @use 'sass:map';
5
3
  @use '../abstract/theme' as t;
6
4
  @use 'config' as c;
7
5
 
8
- // As $sizes and $widths in components/_icon-button.scss: container height,
9
- // then the narrow, default and wide widths.
10
6
  $sizes: (
11
- 'xs': (32px, 28px, 32px, 40px),
12
- 's': (40px, 32px, 40px, 52px),
13
- 'm': (56px, 48px, 56px, 72px),
14
- 'l': (96px, 64px, 96px, 128px),
15
- 'xl': (136px, 104px, 136px, 184px)
7
+ 'xs': (32px, 28px, 32px, 40px),
8
+ 's': (40px, 32px, 40px, 52px),
9
+ 'm': (56px, 48px, 56px, 72px),
10
+ 'l': (96px, 64px, 96px, 128px),
11
+ 'xl': (136px, 104px, 136px, 184px)
16
12
  );
17
13
 
18
14
  @mixin size($size, $width) {
19
- $values: map.get($sizes, $size);
20
- height: list.nth($values, 1);
21
- width: list.nth($values, map.get(('narrow': 2, 'default': 3, 'wide': 4), $width));
22
- border-radius: list.nth($values, 1) * 0.5;
15
+ $values: map.get($sizes, $size);
16
+ height: list.nth($values, 1);
17
+ width: list.nth($values, map.get(('narrow': 2, 'default': 3, 'wide': 4), $width));
18
+ border-radius: list.nth($values, 1) * 0.5;
23
19
  }
24
20
 
25
21
  @include c.host('icon-button') {
26
- display: inline-block;
27
- vertical-align: middle;
28
- box-sizing: border-box;
29
- overflow: hidden;
30
- color: transparent;
31
- @include size('s', 'default');
22
+ display: inline-block;
23
+ vertical-align: middle;
24
+ box-sizing: border-box;
25
+ overflow: hidden;
26
+ color: transparent;
27
+ @include size('s', 'default');
32
28
 
33
- @each $size in map.keys($sizes) {
34
- @each $width in ('default', 'narrow', 'wide') {
35
- $selector: if($size == 's', '', "[size='#{$size}']") + if($width == 'default', '', "[width='#{$width}']");
36
- @if $selector != '' {
37
- &#{$selector} {
38
- @include size($size, $width);
39
- }
40
- }
41
- }
42
- }
29
+ @each $size in map.keys($sizes) {
30
+ @each $width in ('default', 'narrow', 'wide') {
31
+ $selector: if($size == 's', '', "[size='#{$size}']") + if($width == 'default', '', "[width='#{$width}']");
32
+ @if $selector != '' {
33
+ &#{$selector} {
34
+ @include size($size, $width);
35
+ }
36
+ }
37
+ }
38
+ }
43
39
 
44
- &[variant='filled'] {
45
- background-color: t.color('primary');
46
- }
40
+ &[variant='filled'] {
41
+ background-color: t.color('primary');
42
+ }
47
43
 
48
- &[variant='tonal'] {
49
- background-color: t.color('secondary-container');
50
- }
44
+ &[variant='tonal'] {
45
+ background-color: t.color('secondary-container');
46
+ }
51
47
 
52
- &[variant='outlined'] {
53
- border: 1px solid t.color('outline-variant');
54
- }
48
+ &[variant='outlined'] {
49
+ border: 1px solid t.color('outline-variant');
50
+ }
55
51
  }
@@ -1,7 +1,3 @@
1
- // src/styles/elements/_index.scss
2
- // Every element's pre-upgrade rules, for a page that compiles mtrl's SCSS:
3
- // @use 'material/src/styles/elements' with ($tag-prefix: 'x');
4
- // The build emits the same rules as material/elements/preupgrade.css.
5
1
  @forward 'config';
6
2
  @use 'badge';
7
3
  @use 'bottom-app-bar';
@@ -1,40 +1,33 @@
1
- // src/styles/elements/_list.scss
2
- // <m-list> before upgrade: a row per <m-list-item>, which is drawn on upgrade.
3
1
  @use '../abstract/base' as base;
4
2
  @use '../abstract/mixins' as m;
5
3
  @use '../abstract/theme' as t;
6
4
  @use '../abstract/variables' as v;
7
5
  @use 'config' as c;
8
6
 
9
- // As components/_list.scss: 8px above and below the rows, one-line rows
10
- // 56px, two-line 72px, a 1px divider and the subheader's padded line.
11
- // The undefined host is the box the upgraded list will be, so it rounds by
12
- // the same property. After upgrade the host does not paint: `::part(list)`
13
- // is `.mtrl-list` and carries the radius.
14
7
  @include c.host('list') {
15
- display: block;
16
- padding: 8px 0;
17
- background-color: t.color('surface');
18
- border-radius: var(--#{base.$prefix}-list-item-shape-outer, v.shape('large'));
8
+ display: block;
9
+ padding: 8px 0;
10
+ background-color: t.color('surface');
11
+ border-radius: var(--#{base.$prefix}-list-item-shape-outer, v.shape('large'));
19
12
  }
20
13
 
21
14
  @include c.declarations('list') {
22
- display: block;
23
- height: 56px;
24
- overflow: hidden;
15
+ display: block;
16
+ height: 56px;
17
+ overflow: hidden;
25
18
 
26
- &[supporting-text],
27
- &[overline] {
28
- height: 72px;
29
- }
19
+ &[supporting-text],
20
+ &[overline] {
21
+ height: 72px;
22
+ }
30
23
 
31
- &[kind='divider'] {
32
- height: 1px;
33
- }
24
+ &[kind='divider'] {
25
+ height: 1px;
26
+ }
34
27
 
35
- &[kind='subheader'] {
36
- height: auto;
37
- padding: 16px 16px 8px;
38
- @include m.typography('label-large');
39
- }
28
+ &[kind='subheader'] {
29
+ height: auto;
30
+ padding: 16px 16px 8px;
31
+ @include m.typography('label-large');
32
+ }
40
33
  }
@@ -1,13 +1,10 @@
1
- // src/styles/elements/_loading-indicator.scss
2
- // <m-loading-indicator> before upgrade: its box.
3
1
  @use 'config' as c;
4
2
 
5
- // As --mtrl-loading-indicator-size in components/_loading-indicator.scss.
6
3
  @include c.host('loading-indicator') {
7
- display: inline-flex;
8
- vertical-align: middle;
9
- width: 48px;
10
- height: 48px;
11
- overflow: hidden;
12
- color: transparent;
4
+ display: inline-flex;
5
+ vertical-align: middle;
6
+ width: 48px;
7
+ height: 48px;
8
+ overflow: hidden;
9
+ color: transparent;
13
10
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_menu.scss
2
- // <m-menu> before upgrade: nothing. It opens in the top layer once upgraded,
3
- // and reserves no space in the page.
4
1
  @use 'config' as c;
5
2
 
6
3
  @include c.overlay('menu');
@@ -1,17 +1,13 @@
1
- // src/styles/elements/_navigation-bar.scss
2
- // <m-navigation-bar> before upgrade: the bar's surface and height, so the page
3
- // doesn't move when it is drawn; its <m-navigation-bar-item>s are drawn on upgrade.
4
1
  @use '../abstract/theme' as t;
5
2
  @use 'config' as c;
6
3
 
7
- // As components/_navigation-bar.scss: 64px and the bottom inset, surface container
8
4
  @include c.host('navigation-bar') {
9
- display: block;
10
- box-sizing: border-box;
11
- block-size: calc(64px + env(safe-area-inset-bottom, 0px));
12
- background: t.color('surface-container');
5
+ display: block;
6
+ box-sizing: border-box;
7
+ block-size: calc(64px + env(safe-area-inset-bottom, 0px));
8
+ background: t.color('surface-container');
13
9
  }
14
10
 
15
11
  @include c.declarations('navigation-bar') {
16
- display: none;
12
+ display: none;
17
13
  }
@@ -1,24 +1,19 @@
1
- // src/styles/elements/_navigation-rail.scss
2
- // <m-navigation-rail> before upgrade: the rail's surface and height, with a
3
- // place per <m-navigation-rail-item>, which is drawn on upgrade.
4
1
  @use '../abstract/theme' as t;
5
2
  @use 'config' as c;
6
3
 
7
- // As components/_navigation-rail.scss: 44px above the 48px menu button and
8
- // 40px under it, 64px items 4px apart, 16px at the end; the rail 96px wide.
9
4
  @include c.host('navigation-rail') {
10
- display: block;
11
- box-sizing: border-box;
12
- padding: 44px + 48px + 40px 0 16px;
13
- background: linear-gradient(t.color('surface'), t.color('surface')) no-repeat 0 0 / 96px 100%;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ padding: 44px + 48px + 40px 0 16px;
8
+ background: linear-gradient(t.color('surface'), t.color('surface')) no-repeat 0 0 / 96px 100%;
14
9
  }
15
10
 
16
11
  @include c.declarations('navigation-rail') {
17
- display: block;
18
- height: 64px;
19
- overflow: hidden;
12
+ display: block;
13
+ height: 64px;
14
+ overflow: hidden;
20
15
 
21
- & + * {
22
- margin-top: 4px;
23
- }
16
+ & + * {
17
+ margin-top: 4px;
18
+ }
24
19
  }
@@ -1,24 +1,21 @@
1
- // src/styles/elements/_progress.scss
2
- // <m-progress> before upgrade: the linear track's height, or the circle's box.
3
1
  @use '../abstract/theme' as t;
4
2
  @use 'config' as c;
5
3
 
6
- // As the factory's canvas: 4px thin linear (2px from each end), 40px circle.
7
4
  @include c.host('progress') {
8
- display: block;
9
- box-sizing: border-box;
10
- height: 4px;
11
- padding: 0 4px;
12
- overflow: hidden;
13
- color: transparent;
14
- background: t.color('secondary-container') content-box;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ height: 4px;
8
+ padding: 0 4px;
9
+ overflow: hidden;
10
+ color: transparent;
11
+ background: t.color('secondary-container') content-box;
15
12
 
16
- &[variant='circular'] {
17
- display: inline-flex;
18
- vertical-align: middle;
19
- width: 40px;
20
- height: 40px;
21
- padding: 0;
22
- background: none;
23
- }
13
+ &[variant='circular'] {
14
+ display: inline-flex;
15
+ vertical-align: middle;
16
+ width: 40px;
17
+ height: 40px;
18
+ padding: 0;
19
+ background: none;
20
+ }
24
21
  }
@@ -1,61 +1,36 @@
1
- // src/styles/elements/_radios.scss
2
- // <m-radios> before upgrade: a row per <m-radio>, which is drawn on upgrade.
3
1
  @use '../abstract/mixins' as m;
4
2
  @use 'config' as c;
5
3
 
6
4
  @include c.host('radios') {
7
- display: flex;
8
- flex-direction: column;
9
- @include m.typography('body-large');
5
+ display: flex;
6
+ flex-direction: column;
7
+ @include m.typography('body-large');
10
8
 
11
- &[direction='horizontal'] {
12
- flex-direction: row;
13
- flex-wrap: wrap;
9
+ &[direction='horizontal'] {
10
+ flex-direction: row;
11
+ flex-wrap: wrap;
14
12
 
15
- // As components/_radios.scss: 16px between options on the row, none after
16
- // the last. Without the gap reserved here the host is 16px narrower per
17
- // gap before upgrade — with three options 290.3px instead of 322.3px —
18
- // and everything on the line moves by the difference (floor/material#129).
19
- // The last option is found among the options (`:last-of-type`), not among
20
- // all children: a group's contract is its `<m-radio>` children, and only
21
- // they become items.
22
- > #{c.tag('radio')} {
23
- margin-inline-end: 16px;
13
+ > #{c.tag('radio')} {
14
+ margin-inline-end: 16px;
24
15
 
25
- &:last-of-type {
26
- margin-inline-end: 0;
27
- }
28
- }
29
- }
16
+ &:last-of-type {
17
+ margin-inline-end: 0;
18
+ }
19
+ }
20
+ }
30
21
 
31
- // On upgrade the host's baseline is its first row's: the 20px circle's
32
- // bottom edge, 14px down a 48px row (4px of label padding and 10px of the
33
- // control around the circle). The column's first item is a strut that ends
34
- // on that edge, so a baseline-aligned row holds the host in place; 0 wide
35
- // and -34 below itself, it moves nothing. Without it the baseline was the
36
- // label text's, 5px higher, and the host moved up 5px at upgrade
37
- // (floor/material#109).
38
- //
39
- // Only a group with an option reserves that baseline: an empty host is 0
40
- // tall after upgrade and exposes no baseline, so the strut would synthesize
41
- // one 34px below its top and lift the text after it 24px at upgrade. The
42
- // guard follows an actual option, not the absence of children: `:empty`
43
- // counts the newline and spaces of indented markup as content, and that
44
- // indented group has no option and no upgraded baseline either.
45
- &:has(> #{c.tag('radio')})::before {
46
- content: '';
47
- flex: none;
48
- height: 34px;
49
- margin-block-end: -34px;
50
- }
22
+ &:has(> #{c.tag('radio')})::before {
23
+ content: '';
24
+ flex: none;
25
+ height: 34px;
26
+ margin-block-end: -34px;
27
+ }
51
28
  }
52
29
 
53
- // As components/_radios.scss: a row at least 48px, the 40px control and 8px
54
- // before the text. A wrapping label grows the row.
55
30
  @include c.declarations('radios') {
56
- display: flex;
57
- align-items: center;
58
- box-sizing: border-box;
59
- min-height: 48px;
60
- padding-inline-start: 48px;
31
+ display: flex;
32
+ align-items: center;
33
+ box-sizing: border-box;
34
+ min-height: 48px;
35
+ padding-inline-start: 48px;
61
36
  }
@@ -1,36 +1,31 @@
1
- // src/styles/elements/_search.scss
2
- // <m-search> before upgrade: the search bar, with the placeholder where the
3
- // query goes; the <m-search-suggestion> declarations are drawn on upgrade.
4
1
  @use '../abstract/variables' as v;
5
2
  @use '../abstract/mixins' as m;
6
3
  @use '../abstract/theme' as t;
7
4
  @use 'config' as c;
8
5
 
9
- // As components/_search.scss: the 56px bar, fully rounded, its 48px leading
10
- // icon 4px from the start and the input 4px beyond it.
11
6
  @include c.host('search') {
12
- display: flex;
13
- align-items: center;
14
- box-sizing: border-box;
15
- height: 56px;
16
- padding: 0 56px 0 60px;
17
- border-radius: v.shape('full');
18
- background-color: t.color('surface-container-high');
19
- color: t.color('on-surface-variant');
20
- white-space: nowrap;
21
- overflow: hidden;
22
- @include m.typography('body-large');
7
+ display: flex;
8
+ align-items: center;
9
+ box-sizing: border-box;
10
+ height: 56px;
11
+ padding: 0 56px 0 60px;
12
+ border-radius: v.shape('full');
13
+ background-color: t.color('surface-container-high');
14
+ color: t.color('on-surface-variant');
15
+ white-space: nowrap;
16
+ overflow: hidden;
17
+ @include m.typography('body-large');
23
18
 
24
- &::before {
25
- content: attr(placeholder);
26
- }
19
+ &::before {
20
+ content: attr(placeholder);
21
+ }
27
22
 
28
- &[value]:not([value=''])::before {
29
- content: attr(value);
30
- color: t.color('on-surface');
31
- }
23
+ &[value]:not([value=''])::before {
24
+ content: attr(value);
25
+ color: t.color('on-surface');
26
+ }
32
27
  }
33
28
 
34
29
  @include c.declarations('search') {
35
- display: none;
30
+ display: none;
36
31
  }
@@ -1,15 +1,10 @@
1
- // src/styles/elements/_select.scss
2
- // <m-select> before upgrade: the text field it is, with the dropdown icon's
3
- // space; the <m-select-option> declarations are drawn on upgrade.
4
1
  @use 'config' as c;
5
2
  @use 'field';
6
3
 
7
- // As components/_select.scss: the 24px icon, 12px from the end and 16px from the text.
8
4
  @include c.host('select') {
9
- @include field.field(36px);
5
+ @include field.field(36px);
10
6
 
11
- // The value is an option's, shown on upgrade; the label floats above it.
12
- &::before {
13
- content: ' ';
14
- }
7
+ &::before {
8
+ content: ' ';
9
+ }
15
10
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_side-sheet.scss
2
- // <m-side-sheet> before upgrade: nothing. It opens in the top layer once upgraded,
3
- // and reserves no space in the page.
4
1
  @use 'config' as c;
5
2
 
6
3
  @include c.overlay('side-sheet');
@@ -1,48 +1,28 @@
1
- // src/styles/elements/_slider.scss
2
- // <m-slider> before upgrade: the container's row at each size, with the label's
3
- // body-large line and its 4px gutter over it when the host carries a label.
4
1
  @use 'sass:map';
5
2
  @use '../abstract/functions' as f;
6
3
  @use 'config' as c;
7
4
 
8
- // The label's line: the typescale map's body-large line-height, the role
9
- // components/_slider.scss gives __label (typography('body-large')).
10
5
  $label-line: map.get(f.get-typography('body-large'), 'line-height');
11
- // The label's gutter: __label's 4px margin (components/_slider.scss), under the
12
- // label or, with `label-position='end'`, over it -- the same height either way.
13
6
  $label-gap: 4px;
14
- // The container's height after upgrade. The factory sets it inline
15
- // (components/slider/features/tracks.ts: max(handle height, MIN_HEIGHT 48)),
16
- // with the handle 44 (SMALL_HANDLE_HEIGHT) at XS and S, and the track's own
17
- // height plus HANDLE_HEIGHT_OFFSET 12 (constants.ts) at M, L and XL:
18
- // 40 + 12, 56 + 12, 96 + 12.
19
7
  $containers: ('xs': 48px, 's': 48px, 'm': 52px, 'l': 68px, 'xl': 108px);
20
8
 
21
9
  @include c.host('slider') {
22
- display: block;
23
- height: 48px;
24
- overflow: hidden;
25
- color: transparent;
10
+ display: block;
11
+ height: 48px;
12
+ overflow: hidden;
13
+ color: transparent;
26
14
 
27
- // A label builds its own element and takes a body-large line and the 4px
28
- // gutter over the container. `label=""` builds none (withTextLabel returns on
29
- // a falsy label, as on the switch and checkbox), so that host keeps the
30
- // container's row, as the label-less rule below gives it.
31
- &[label]:not([label='']) {
32
- height: $label-line + $label-gap + map.get($containers, 'xs');
33
- }
15
+ &[label]:not([label='']) {
16
+ height: $label-line + $label-gap + map.get($containers, 'xs');
17
+ }
34
18
 
35
- @each $size, $container in $containers {
36
- // Without a label the host is the container's row itself: the factory lifts
37
- // it above the 48px minimum from M up (the track plus its 12px handle
38
- // offset). `label=""` takes this row too, as it builds no label. The size
39
- // names match in any case, as the element reads them.
40
- &:is(:not([label]), [label=''])[size='#{$size}' i] {
41
- height: $container;
42
- }
19
+ @each $size, $container in $containers {
20
+ &:is(:not([label]), [label=''])[size='#{$size}' i] {
21
+ height: $container;
22
+ }
43
23
 
44
- &[label]:not([label=''])[size='#{$size}' i] {
45
- height: $label-line + $label-gap + $container;
46
- }
47
- }
24
+ &[label]:not([label=''])[size='#{$size}' i] {
25
+ height: $label-line + $label-gap + $container;
26
+ }
27
+ }
48
28
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_snackbar.scss
2
- // <m-snackbar> before upgrade: nothing. It opens in the top layer once upgraded,
3
- // and reserves no space in the page.
4
1
  @use 'config' as c;
5
2
 
6
3
  @include c.overlay('snackbar');
@@ -1,53 +1,47 @@
1
- // src/styles/elements/_split-button.scss
2
- // <m-split-button> before upgrade: the leading button with its label, then
3
- // the trailing button; the <m-menu-item> declarations are drawn on upgrade.
4
1
  @use '../abstract/variables' as v;
5
2
  @use '../abstract/mixins' as m;
6
3
  @use '../abstract/theme' as t;
7
4
  @use 'config' as c;
8
5
 
9
- // As components/_split-button.scss (small, filled): the leading button's
10
- // 16px and 12px beside the label, the 2px gap, the 48px trailing button,
11
- // and their 4px inner corners.
12
6
  $gap: 2px;
13
7
  $trailing: 48px;
14
8
 
15
9
  @include c.host('split-button') {
16
- display: inline-flex;
17
- vertical-align: middle;
18
- align-items: center;
19
- position: relative;
20
- z-index: 0;
21
- box-sizing: border-box;
22
- height: v.button('height-s');
23
- padding: 0 calc(12px + #{$gap + $trailing}) 0 v.button('padding-s');
24
- color: t.color('on-primary');
25
- white-space: nowrap;
26
- @include m.typography('label-large');
10
+ display: inline-flex;
11
+ vertical-align: middle;
12
+ align-items: center;
13
+ position: relative;
14
+ z-index: 0;
15
+ box-sizing: border-box;
16
+ height: v.button('height-s');
17
+ padding: 0 calc(12px + #{$gap + $trailing}) 0 v.button('padding-s');
18
+ color: t.color('on-primary');
19
+ white-space: nowrap;
20
+ @include m.typography('label-large');
27
21
 
28
- &::before,
29
- &::after {
30
- content: '';
31
- position: absolute;
32
- z-index: -1;
33
- top: 0;
34
- bottom: 0;
35
- background-color: t.color('primary');
36
- }
22
+ &::before,
23
+ &::after {
24
+ content: '';
25
+ position: absolute;
26
+ z-index: -1;
27
+ top: 0;
28
+ bottom: 0;
29
+ background-color: t.color('primary');
30
+ }
37
31
 
38
- &::before {
39
- left: 0;
40
- right: $gap + $trailing;
41
- border-radius: v.button('shape-round-s') 4px 4px v.button('shape-round-s');
42
- }
32
+ &::before {
33
+ left: 0;
34
+ right: $gap + $trailing;
35
+ border-radius: v.button('shape-round-s') 4px 4px v.button('shape-round-s');
36
+ }
43
37
 
44
- &::after {
45
- right: 0;
46
- width: $trailing;
47
- border-radius: 4px v.button('shape-round-s') v.button('shape-round-s') 4px;
48
- }
38
+ &::after {
39
+ right: 0;
40
+ width: $trailing;
41
+ border-radius: 4px v.button('shape-round-s') v.button('shape-round-s') 4px;
42
+ }
49
43
 
50
- > * {
51
- display: none;
52
- }
44
+ > * {
45
+ display: none;
46
+ }
53
47
  }