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,31 +1,16 @@
1
- // src/styles/elements/_config.scss
2
- // =============================================================================
3
- // PRE-UPGRADE STYLES: shared configuration
4
- // =============================================================================
5
- // Until its script defines it, an element is its server-rendered light DOM,
6
- // unstyled. These rules give the undefined host the box it will have once
7
- // upgraded, so nothing moves when the shadow root arrives (ssr.md, Phase A).
8
- //
9
- // Every rule is scoped to `:not(:defined)`, so none can reach an upgraded
10
- // element. Sizes come from the same tokens and variables the components use.
11
- //
12
- // The tag prefix is a module variable: with a custom prefix, configure it
13
- // @use 'material/src/styles/elements' with ($tag-prefix: 'x');
14
- // or, at runtime, use `preupgradeStyles('x')` from `material/elements/preupgrade`.
15
- // =============================================================================
16
1
 
17
2
  $tag-prefix: 'm' !default;
18
3
 
19
4
  /** The element's tag: `tag('button')` is `m-button`. */
20
5
  @function tag($name) {
21
- @return '#{$tag-prefix}-#{$name}';
6
+ @return '#{$tag-prefix}-#{$name}';
22
7
  }
23
8
 
24
9
  /** Rules for the undefined host. */
25
10
  @mixin host($name) {
26
- #{tag($name)}:not(:defined) {
27
- @content;
28
- }
11
+ #{tag($name)}:not(:defined) {
12
+ @content;
13
+ }
29
14
  }
30
15
 
31
16
  /**
@@ -34,15 +19,15 @@ $tag-prefix: 'm' !default;
34
19
  * painted.
35
20
  */
36
21
  @mixin declarations($name, $selector: '*') {
37
- #{tag($name)}:not(:defined) > #{$selector} {
38
- visibility: hidden;
39
- @content;
40
- }
22
+ #{tag($name)}:not(:defined) > #{$selector} {
23
+ visibility: hidden;
24
+ @content;
25
+ }
41
26
  }
42
27
 
43
28
  /** An overlay renders nothing until upgrade, open or not: it opens in the top layer. */
44
29
  @mixin overlay($name) {
45
- @include host($name) {
46
- display: none;
47
- }
30
+ @include host($name) {
31
+ display: none;
32
+ }
48
33
  }
@@ -1,31 +1,26 @@
1
- // src/styles/elements/_datepicker.scss
2
- // <m-datepicker> before upgrade: the label above the field, the field and the
3
- // line under it for the supporting text.
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/_datepicker.scss: the text field's width, the label 4px above
10
- // the 56px field, and 4px + one body-small line under it.
11
6
  @include c.host('datepicker') {
12
- display: inline-flex;
13
- box-sizing: border-box;
14
- width: v.text-field('width');
15
- vertical-align: baseline;
16
- white-space: nowrap;
7
+ display: inline-flex;
8
+ box-sizing: border-box;
9
+ width: v.text-field('width');
10
+ vertical-align: baseline;
11
+ white-space: nowrap;
17
12
 
18
- &::before {
19
- content: attr(label) ' ';
20
- white-space: pre;
21
- display: inline-block;
22
- width: 100%;
23
- padding-bottom: 4px + v.text-field('height') + 4px + 16px;
24
- color: t.color('on-surface');
25
- @include m.typography('body-small');
26
- }
13
+ &::before {
14
+ content: attr(label) ' ';
15
+ white-space: pre;
16
+ display: inline-block;
17
+ width: 100%;
18
+ padding-bottom: 4px + v.text-field('height') + 4px + 16px;
19
+ color: t.color('on-surface');
20
+ @include m.typography('body-small');
21
+ }
27
22
 
28
- > * {
29
- display: none;
30
- }
23
+ > * {
24
+ display: none;
25
+ }
31
26
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_dialog.scss
2
- // <m-dialog> 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('dialog');
@@ -1,19 +1,17 @@
1
- // src/styles/elements/_divider.scss
2
- // <m-divider> before upgrade: the 1px line, horizontal or vertical.
3
1
  @use '../abstract/theme' as t;
4
2
  @use 'config' as c;
5
3
 
6
4
  @include c.host('divider') {
7
- display: block;
8
- height: 1px;
9
- overflow: hidden;
10
- color: transparent;
11
- background-color: t.color('outline-variant');
5
+ display: block;
6
+ height: 1px;
7
+ overflow: hidden;
8
+ color: transparent;
9
+ background-color: t.color('outline-variant');
12
10
 
13
- &[orientation='vertical'] {
14
- display: inline-block;
15
- align-self: stretch;
16
- width: 1px;
17
- height: auto;
18
- }
11
+ &[orientation='vertical'] {
12
+ display: inline-block;
13
+ align-self: stretch;
14
+ width: 1px;
15
+ height: auto;
16
+ }
19
17
  }
@@ -1,23 +1,18 @@
1
- // src/styles/elements/_drawer.scss
2
- // <m-drawer> before upgrade: the sheet's height, with a place per
3
- // <m-drawer-item>, which is drawn on upgrade. Closed, the upgraded drawer
4
- // keeps that height with nothing in it; open, its sheet is painted.
5
1
  @use '../abstract/theme' as t;
6
2
  @use 'config' as c;
7
3
 
8
- // As components/_drawer.scss: 12px above and below 56px items.
9
4
  @include c.host('drawer') {
10
- display: block;
11
- flex-shrink: 0;
12
- padding: 12px 0;
5
+ display: block;
6
+ flex-shrink: 0;
7
+ padding: 12px 0;
13
8
 
14
- &[open] {
15
- background-color: t.color('surface');
16
- }
9
+ &[open] {
10
+ background-color: t.color('surface');
11
+ }
17
12
  }
18
13
 
19
14
  @include c.declarations('drawer') {
20
- display: block;
21
- height: 56px;
22
- overflow: hidden;
15
+ display: block;
16
+ height: 56px;
17
+ overflow: hidden;
23
18
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_extended-fab.scss
2
- // <m-extended-fab> before upgrade: the container, with the label as its text
3
- // and the icon's place before it.
4
1
  @use 'sass:map';
5
2
  @use '../abstract/functions' as f;
6
3
  @use '../abstract/mixins' as m;
@@ -8,52 +5,51 @@
8
5
  @use 'config' as c;
9
6
  @use '../abstract/floating-placement' as placement;
10
7
 
11
- // As $sizes in components/_extended-fab.scss.
12
8
  $sizes: (
13
- 'small': (height: 56px, icon: 24px, label: 'title-medium', padding: 16px, gap: 8px, shape: 'large'),
14
- 'medium': (height: 80px, icon: 28px, label: 'title-large', padding: 26px, gap: 16px, shape: 'large-increased'),
15
- 'large': (height: 96px, icon: 32px, label: 'headline-small', padding: 28px, gap: 20px, shape: 'extra-large')
9
+ 'small': (height: 56px, icon: 24px, label: 'title-medium', padding: 16px, gap: 8px, shape: 'large'),
10
+ 'medium': (height: 80px, icon: 28px, label: 'title-large', padding: 26px, gap: 16px, shape: 'large-increased'),
11
+ 'large': (height: 96px, icon: 32px, label: 'headline-small', padding: 28px, gap: 20px, shape: 'extra-large')
16
12
  );
17
13
 
18
14
  @mixin size($size) {
19
- $tokens: map.get($sizes, $size);
20
- height: map.get($tokens, height);
21
- min-width: map.get($tokens, height);
22
- padding: 0 map.get($tokens, padding);
23
- gap: map.get($tokens, gap);
24
- border-radius: f.get-shape(map.get($tokens, shape));
25
- @include m.typography(map.get($tokens, label));
15
+ $tokens: map.get($sizes, $size);
16
+ height: map.get($tokens, height);
17
+ min-width: map.get($tokens, height);
18
+ padding: 0 map.get($tokens, padding);
19
+ gap: map.get($tokens, gap);
20
+ border-radius: f.get-shape(map.get($tokens, shape));
21
+ @include m.typography(map.get($tokens, label));
26
22
 
27
- &[icon]::before {
28
- width: map.get($tokens, icon);
29
- height: map.get($tokens, icon);
30
- }
23
+ &[icon]::before {
24
+ width: map.get($tokens, icon);
25
+ height: map.get($tokens, icon);
26
+ }
31
27
  }
32
28
 
33
29
  @include c.host('extended-fab') {
34
- @include placement.corners;
35
- display: inline-flex;
36
- vertical-align: middle;
37
- align-items: center;
38
- justify-content: center;
39
- box-sizing: border-box;
40
- white-space: nowrap;
41
- background-color: t.color('primary-container');
42
- color: t.color('on-primary-container');
43
- @include size('small');
30
+ @include placement.corners;
31
+ display: inline-flex;
32
+ vertical-align: middle;
33
+ align-items: center;
34
+ justify-content: center;
35
+ box-sizing: border-box;
36
+ white-space: nowrap;
37
+ background-color: t.color('primary-container');
38
+ color: t.color('on-primary-container');
39
+ @include size('small');
44
40
 
45
- &[icon]::before {
46
- content: '';
47
- flex: none;
48
- }
41
+ &[icon]::before {
42
+ content: '';
43
+ flex: none;
44
+ }
49
45
 
50
- &[icon-position='end']::before {
51
- order: 1;
52
- }
46
+ &[icon-position='end']::before {
47
+ order: 1;
48
+ }
53
49
 
54
- @each $size in ('medium', 'large') {
55
- &[size='#{$size}'] {
56
- @include size($size);
57
- }
58
- }
50
+ @each $size in ('medium', 'large') {
51
+ &[size='#{$size}'] {
52
+ @include size($size);
53
+ }
54
+ }
59
55
  }
@@ -1,43 +1,39 @@
1
- // src/styles/elements/_fab-menu.scss
2
- // <m-fab-menu> before upgrade: the closed FAB, at its size and on its colour
3
- // set's container. The item declarations render nothing.
4
1
  @use 'sass:list';
5
2
  @use 'sass:map';
6
3
  @use '../abstract/functions' as f;
7
4
  @use '../abstract/theme' as t;
8
5
  @use 'config' as c;
9
6
 
10
- // As components/_fab.scss and _fab-menu.scss: the FAB the menu opens from.
11
7
  $sizes: ('default': (56px, 'large'), 'medium': (80px, 'large-increased'), 'large': (96px, 'extra-large'));
12
8
 
13
9
  @mixin size($size) {
14
- $values: map.get($sizes, $size);
15
- width: list.nth($values, 1);
16
- height: list.nth($values, 1);
17
- border-radius: f.get-shape(list.nth($values, 2));
10
+ $values: map.get($sizes, $size);
11
+ width: list.nth($values, 1);
12
+ height: list.nth($values, 1);
13
+ border-radius: f.get-shape(list.nth($values, 2));
18
14
  }
19
15
 
20
16
  @include c.host('fab-menu') {
21
- display: inline-block;
22
- vertical-align: middle;
23
- box-sizing: border-box;
24
- overflow: hidden;
25
- background-color: t.color('primary-container');
26
- @include size('default');
17
+ display: inline-block;
18
+ vertical-align: middle;
19
+ box-sizing: border-box;
20
+ overflow: hidden;
21
+ background-color: t.color('primary-container');
22
+ @include size('default');
27
23
 
28
- @each $size in map.keys($sizes) {
29
- &[size='#{$size}'] {
30
- @include size($size);
31
- }
32
- }
24
+ @each $size in map.keys($sizes) {
25
+ &[size='#{$size}'] {
26
+ @include size($size);
27
+ }
28
+ }
33
29
 
34
- @each $role in secondary, tertiary {
35
- &[color='#{$role}'] {
36
- background-color: t.color('#{$role}-container');
37
- }
38
- }
30
+ @each $role in secondary, tertiary {
31
+ &[color='#{$role}'] {
32
+ background-color: t.color('#{$role}-container');
33
+ }
34
+ }
39
35
  }
40
36
 
41
37
  @include c.declarations('fab-menu') {
42
- display: none;
38
+ display: none;
43
39
  }
@@ -1,5 +1,3 @@
1
- // src/styles/elements/_fab.scss
2
- // <m-fab> before upgrade: the container, at its size.
3
1
  @use 'sass:list';
4
2
  @use 'sass:map';
5
3
  @use '../abstract/functions' as f;
@@ -7,29 +5,28 @@
7
5
  @use 'config' as c;
8
6
  @use '../abstract/floating-placement' as placement;
9
7
 
10
- // As the sizes in components/_fab.scss: container and shape.
11
8
  $sizes: ('default': (56px, 'large'), 'medium': (80px, 'large-increased'), 'large': (96px, 'extra-large'));
12
9
 
13
10
  @mixin size($size) {
14
- $values: map.get($sizes, $size);
15
- width: list.nth($values, 1);
16
- height: list.nth($values, 1);
17
- border-radius: f.get-shape(list.nth($values, 2));
11
+ $values: map.get($sizes, $size);
12
+ width: list.nth($values, 1);
13
+ height: list.nth($values, 1);
14
+ border-radius: f.get-shape(list.nth($values, 2));
18
15
  }
19
16
 
20
17
  @include c.host('fab') {
21
- @include placement.corners;
22
- display: inline-block;
23
- vertical-align: middle;
24
- box-sizing: border-box;
25
- overflow: hidden;
26
- color: transparent;
27
- background-color: t.color('primary-container');
28
- @include size('default');
18
+ @include placement.corners;
19
+ display: inline-block;
20
+ vertical-align: middle;
21
+ box-sizing: border-box;
22
+ overflow: hidden;
23
+ color: transparent;
24
+ background-color: t.color('primary-container');
25
+ @include size('default');
29
26
 
30
- @each $size in map.keys($sizes) {
31
- &[size='#{$size}'] {
32
- @include size($size);
33
- }
34
- }
27
+ @each $size in map.keys($sizes) {
28
+ &[size='#{$size}'] {
29
+ @include size($size);
30
+ }
31
+ }
35
32
  }
@@ -1,13 +1,7 @@
1
- // src/styles/elements/_field.scss
2
- // The text field's box before upgrade, shared by <m-text-field>, <m-select>
3
- // and <m-datepicker>: the container (filled or outlined, default or
4
- // compact), the label and the value on the input's line.
5
1
  @use '../abstract/variables' as v;
6
2
  @use '../abstract/mixins' as m;
7
3
  @use '../abstract/theme' as t;
8
4
 
9
- // 4dp under the field plus one body-small line (16dp). The multiline field
10
- // adds the same row (elements/_text-field.scss).
11
5
  $supporting-row: 20px;
12
6
 
13
7
  /**
@@ -15,112 +9,97 @@ $supporting-row: 20px;
15
9
  * icon takes beside the text).
16
10
  */
17
11
  @mixin field($trailing: 0px) {
18
- display: inline-block;
19
- position: relative;
20
- box-sizing: border-box;
21
- // The unsized field's width, as components/_text-field.scss sets it.
22
- width: v.text-field('width');
23
- height: v.text-field('height');
24
- // The input's line, where the upgraded field's text is: 24px down under a
25
- // label. The half pixel is the line's baseline, as measured: with
26
- // it, the sibling on this line does not move at upgrade.
27
- padding: 24.5px (v.text-field('padding-horizontal') + $trailing) 0 v.text-field('padding-horizontal');
28
- border-radius: v.text-field('border-radius') v.text-field('border-radius') 0 0;
29
- border-bottom: v.text-field('border-width') solid t.color('on-surface-variant');
30
- background-color: t.color('surface-container-highest');
31
- color: t.color('on-surface');
32
- white-space: nowrap;
33
- // Clipped without moving the baseline, as `hidden` would.
34
- overflow: clip;
35
- @include m.typography('body-large');
36
-
37
- // The value, or a space holding its line; then the label.
38
- &::before {
39
- content: attr(value) ' ';
40
- white-space: pre;
41
- }
42
-
43
- &[label]::after {
44
- content: attr(label);
45
- position: absolute;
46
- top: v.text-field('padding-vertical');
47
- left: v.text-field('padding-horizontal');
48
- color: t.color('on-surface-variant');
49
- }
50
-
51
- &[label][value]:not([value=''])::after {
52
- top: 8px;
53
- @include m.typography('body-small');
54
- }
55
-
56
- // Without a label the text is centred in the field
57
- &:not([label]) {
58
- padding-top: 16.5px;
59
- }
60
-
61
- &[variant='outlined'] {
62
- padding-top: 15.5px;
63
- border: v.text-field('border-width') solid t.color('outline');
64
- border-radius: v.text-field('border-radius');
65
- background: none;
66
-
67
- &[label][value]:not([value=''])::after {
68
- top: -8px;
69
- padding: 0 4px;
70
- left: 12px;
71
- }
72
- }
73
-
74
- &[density='compact'] {
75
- height: 40px;
76
- padding-top: 13.5px;
77
- @include m.typography('body-medium');
78
-
79
- &::after {
80
- top: 10px;
81
- @include m.typography('body-medium');
82
- }
83
-
84
- &:not([label]) {
85
- padding-top: 10px;
86
- }
87
-
88
- &[variant='outlined'] {
89
- padding-top: 9px;
90
- }
91
- }
92
-
93
- // The supporting text row: upgraded, the field gets a row under
94
- // it, 4dp and a 16dp body-small line, when it has supporting text or a
95
- // counter (a maxlength). The host reserves the row as a transparent bottom
96
- // border, so the fill stays on the 56px field (clipped to the padding box)
97
- // and the indicator is drawn as the padding box's last pixel line.
98
- &[supporting-text]:not([supporting-text='']),
99
- &[maxlength] {
100
- $row: $supporting-row;
101
- height: calc(#{v.text-field('height')} + #{$row});
102
- border-bottom: $row solid transparent;
103
- background-clip: padding-box;
104
- background-image: linear-gradient(to top, #{t.color('on-surface-variant')} v.text-field('border-width'), transparent v.text-field('border-width'));
105
-
106
- // Outlined: the outline as an inset ring round the padding box, whose
107
- // bottom corners keep their radius inside the reserved border
108
- &[variant='outlined'] {
109
- padding-top: calc(15.5px + #{v.text-field('border-width')});
110
- padding-left: calc(#{v.text-field('padding-horizontal')} + #{v.text-field('border-width')});
111
- border-width: 0 0 $row;
112
- border-radius: v.text-field('border-radius') / v.text-field('border-radius') v.text-field('border-radius') calc(#{v.text-field('border-radius')} + #{$row}) calc(#{v.text-field('border-radius')} + #{$row});
113
- background-image: none;
114
- box-shadow: inset 0 0 0 v.text-field('border-width') t.color('outline');
115
- }
116
-
117
- &[density='compact'] {
118
- height: calc(40px + #{$row});
119
- }
120
- }
121
-
122
- // Children are the element's own content only after upgrade.
123
- > * {
124
- display: none;
125
- }
12
+ display: inline-block;
13
+ position: relative;
14
+ box-sizing: border-box;
15
+ width: v.text-field('width');
16
+ height: v.text-field('height');
17
+ padding: 24.5px (v.text-field('padding-horizontal') + $trailing) 0 v.text-field('padding-horizontal');
18
+ border-radius: v.text-field('border-radius') v.text-field('border-radius') 0 0;
19
+ border-bottom: v.text-field('border-width') solid t.color('on-surface-variant');
20
+ background-color: t.color('surface-container-highest');
21
+ color: t.color('on-surface');
22
+ white-space: nowrap;
23
+ overflow: clip;
24
+ @include m.typography('body-large');
25
+
26
+ &::before {
27
+ content: attr(value) ' ';
28
+ white-space: pre;
29
+ }
30
+
31
+ &[label]::after {
32
+ content: attr(label);
33
+ position: absolute;
34
+ top: v.text-field('padding-vertical');
35
+ left: v.text-field('padding-horizontal');
36
+ color: t.color('on-surface-variant');
37
+ }
38
+
39
+ &[label][value]:not([value=''])::after {
40
+ top: 8px;
41
+ @include m.typography('body-small');
42
+ }
43
+
44
+ &:not([label]) {
45
+ padding-top: 16.5px;
46
+ }
47
+
48
+ &[variant='outlined'] {
49
+ padding-top: 15.5px;
50
+ border: v.text-field('border-width') solid t.color('outline');
51
+ border-radius: v.text-field('border-radius');
52
+ background: none;
53
+
54
+ &[label][value]:not([value=''])::after {
55
+ top: -8px;
56
+ padding: 0 4px;
57
+ left: 12px;
58
+ }
59
+ }
60
+
61
+ &[density='compact'] {
62
+ height: 40px;
63
+ padding-top: 13.5px;
64
+ @include m.typography('body-medium');
65
+
66
+ &::after {
67
+ top: 10px;
68
+ @include m.typography('body-medium');
69
+ }
70
+
71
+ &:not([label]) {
72
+ padding-top: 10px;
73
+ }
74
+
75
+ &[variant='outlined'] {
76
+ padding-top: 9px;
77
+ }
78
+ }
79
+
80
+ &[supporting-text]:not([supporting-text='']),
81
+ &[maxlength] {
82
+ $row: $supporting-row;
83
+ height: calc(#{v.text-field('height')} + #{$row});
84
+ border-bottom: $row solid transparent;
85
+ background-clip: padding-box;
86
+ background-image: linear-gradient(to top, #{t.color('on-surface-variant')} v.text-field('border-width'), transparent v.text-field('border-width'));
87
+
88
+ &[variant='outlined'] {
89
+ padding-top: calc(15.5px + #{v.text-field('border-width')});
90
+ padding-left: calc(#{v.text-field('padding-horizontal')} + #{v.text-field('border-width')});
91
+ border-width: 0 0 $row;
92
+ border-radius: v.text-field('border-radius') / v.text-field('border-radius') v.text-field('border-radius') calc(#{v.text-field('border-radius')} + #{$row}) calc(#{v.text-field('border-radius')} + #{$row});
93
+ background-image: none;
94
+ box-shadow: inset 0 0 0 v.text-field('border-width') t.color('outline');
95
+ }
96
+
97
+ &[density='compact'] {
98
+ height: calc(40px + #{$row});
99
+ }
100
+ }
101
+
102
+ > * {
103
+ display: none;
104
+ }
126
105
  }