material 3.7.2 → 3.7.3

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 (264) hide show
  1. package/README.md +2 -2
  2. package/dist/components/slider/features/controller.js +24 -8
  3. package/dist/elements/css/card.css +1 -1
  4. package/dist/elements/css/card.js +1 -1
  5. package/dist/elements/css/dialog.css +1 -1
  6. package/dist/elements/css/dialog.js +1 -1
  7. package/dist/elements/css/menu.css +1 -1
  8. package/dist/elements/css/menu.js +1 -1
  9. package/dist/elements/css/select.css +1 -1
  10. package/dist/elements/css/select.js +1 -1
  11. package/dist/elements/css/slider.css +1 -1
  12. package/dist/elements/css/slider.js +1 -1
  13. package/dist/elements/css/tabs.css +1 -1
  14. package/dist/elements/css/tabs.js +1 -1
  15. package/dist/elements/css/timepicker.css +1 -1
  16. package/dist/elements/css/timepicker.js +1 -1
  17. package/dist/elements/preupgrade/badge.css +1 -1
  18. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  19. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  20. package/dist/elements/preupgrade/button-group.css +1 -1
  21. package/dist/elements/preupgrade/button.css +1 -1
  22. package/dist/elements/preupgrade/card.css +1 -1
  23. package/dist/elements/preupgrade/carousel.css +1 -1
  24. package/dist/elements/preupgrade/checkbox.css +1 -1
  25. package/dist/elements/preupgrade/chips.css +1 -1
  26. package/dist/elements/preupgrade/datepicker.css +1 -1
  27. package/dist/elements/preupgrade/dialog.css +1 -1
  28. package/dist/elements/preupgrade/divider.css +1 -1
  29. package/dist/elements/preupgrade/drawer.css +1 -1
  30. package/dist/elements/preupgrade/extended-fab.css +1 -1
  31. package/dist/elements/preupgrade/fab-menu.css +1 -1
  32. package/dist/elements/preupgrade/fab.css +1 -1
  33. package/dist/elements/preupgrade/icon-button.css +1 -1
  34. package/dist/elements/preupgrade/list.css +1 -1
  35. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  36. package/dist/elements/preupgrade/menu.css +1 -1
  37. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  38. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  39. package/dist/elements/preupgrade/progress.css +1 -1
  40. package/dist/elements/preupgrade/radios.css +1 -1
  41. package/dist/elements/preupgrade/search.css +1 -1
  42. package/dist/elements/preupgrade/select.css +1 -1
  43. package/dist/elements/preupgrade/side-sheet.css +1 -1
  44. package/dist/elements/preupgrade/slider.css +1 -1
  45. package/dist/elements/preupgrade/snackbar.css +1 -1
  46. package/dist/elements/preupgrade/split-button.css +1 -1
  47. package/dist/elements/preupgrade/switch.css +1 -1
  48. package/dist/elements/preupgrade/tabs.css +1 -1
  49. package/dist/elements/preupgrade/text-field.css +1 -1
  50. package/dist/elements/preupgrade/timepicker.css +1 -1
  51. package/dist/elements/preupgrade/toolbar.css +1 -1
  52. package/dist/elements/preupgrade/tooltip.css +1 -1
  53. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  54. package/dist/elements/preupgrade.css +1 -1
  55. package/dist/styles/badge.css +1 -1
  56. package/dist/styles/base-lite.css +1 -1
  57. package/dist/styles/base.css +1 -1
  58. package/dist/styles/bottom-app-bar.css +1 -1
  59. package/dist/styles/bottom-sheet.css +1 -1
  60. package/dist/styles/button-group.css +1 -1
  61. package/dist/styles/button.css +1 -1
  62. package/dist/styles/card.css +2 -2
  63. package/dist/styles/carousel.css +1 -1
  64. package/dist/styles/checkbox.css +1 -1
  65. package/dist/styles/chips.css +1 -1
  66. package/dist/styles/contrast.css +1 -1
  67. package/dist/styles/datepicker.css +1 -1
  68. package/dist/styles/dialog.css +2 -2
  69. package/dist/styles/divider.css +1 -1
  70. package/dist/styles/drawer.css +1 -1
  71. package/dist/styles/extended-fab.css +1 -1
  72. package/dist/styles/fab-menu.css +1 -1
  73. package/dist/styles/fab.css +1 -1
  74. package/dist/styles/icon-button.css +1 -1
  75. package/dist/styles/list.css +1 -1
  76. package/dist/styles/loading-indicator.css +1 -1
  77. package/dist/styles/menu.css +2 -2
  78. package/dist/styles/navigation-bar.css +1 -1
  79. package/dist/styles/navigation-rail.css +1 -1
  80. package/dist/styles/progress.css +1 -1
  81. package/dist/styles/radios.css +1 -1
  82. package/dist/styles/search.css +1 -1
  83. package/dist/styles/select.css +2 -2
  84. package/dist/styles/side-sheet.css +1 -1
  85. package/dist/styles/slider.css +2 -2
  86. package/dist/styles/snackbar.css +1 -1
  87. package/dist/styles/split-button.css +1 -1
  88. package/dist/styles/switch.css +1 -1
  89. package/dist/styles/tabs.css +2 -2
  90. package/dist/styles/text-field.css +1 -1
  91. package/dist/styles/timepicker.css +2 -2
  92. package/dist/styles/toolbar.css +1 -1
  93. package/dist/styles/tooltip.css +1 -1
  94. package/dist/styles/top-app-bar.css +1 -1
  95. package/dist/styles/typography.css +1 -1
  96. package/dist/styles/utilities.css +1 -1
  97. package/dist/styles.css +2 -2
  98. package/dist/themes/autumn-contrast.css +1 -1
  99. package/dist/themes/autumn.css +1 -1
  100. package/dist/themes/baseline-contrast.css +1 -1
  101. package/dist/themes/baseline.css +1 -1
  102. package/dist/themes/brownbeige-contrast.css +1 -1
  103. package/dist/themes/brownbeige.css +1 -1
  104. package/dist/themes/content-contrast.css +1 -1
  105. package/dist/themes/content.css +1 -1
  106. package/dist/themes/desert-contrast.css +1 -1
  107. package/dist/themes/desert.css +1 -1
  108. package/dist/themes/expressive-contrast.css +1 -1
  109. package/dist/themes/expressive.css +1 -1
  110. package/dist/themes/fidelity-contrast.css +1 -1
  111. package/dist/themes/fidelity.css +1 -1
  112. package/dist/themes/forest-contrast.css +1 -1
  113. package/dist/themes/forest.css +1 -1
  114. package/dist/themes/fruit-salad-contrast.css +1 -1
  115. package/dist/themes/fruit-salad.css +1 -1
  116. package/dist/themes/highcontrast-contrast.css +1 -1
  117. package/dist/themes/highcontrast.css +1 -1
  118. package/dist/themes/monochrome-contrast.css +1 -1
  119. package/dist/themes/monochrome.css +1 -1
  120. package/dist/themes/neutral-contrast.css +1 -1
  121. package/dist/themes/neutral.css +1 -1
  122. package/dist/themes/ocean-contrast.css +1 -1
  123. package/dist/themes/ocean.css +1 -1
  124. package/dist/themes/rainbow-contrast.css +1 -1
  125. package/dist/themes/rainbow.css +1 -1
  126. package/dist/themes/sageivory-contrast.css +1 -1
  127. package/dist/themes/sageivory.css +1 -1
  128. package/dist/themes/spring-contrast.css +1 -1
  129. package/dist/themes/spring.css +1 -1
  130. package/dist/themes/summer-contrast.css +1 -1
  131. package/dist/themes/summer.css +1 -1
  132. package/dist/themes/sunset-contrast.css +1 -1
  133. package/dist/themes/sunset.css +1 -1
  134. package/dist/themes/tealcaramel-contrast.css +1 -1
  135. package/dist/themes/tealcaramel.css +1 -1
  136. package/dist/themes/vibrant-contrast.css +1 -1
  137. package/dist/themes/vibrant.css +1 -1
  138. package/package.json +2 -1
  139. package/src/styles/abstract/_base.scss +0 -1
  140. package/src/styles/abstract/_direction.scss +121 -152
  141. package/src/styles/abstract/_emit.scss +7 -16
  142. package/src/styles/abstract/_floating-placement.scss +9 -10
  143. package/src/styles/abstract/_functions.scss +64 -79
  144. package/src/styles/abstract/_mixins.scss +355 -459
  145. package/src/styles/abstract/_theme.scss +122 -136
  146. package/src/styles/abstract/_variables.scss +320 -390
  147. package/src/styles/abstract/chips/_assist.scss +2 -3
  148. package/src/styles/abstract/chips/_filter.scss +2 -3
  149. package/src/styles/abstract/chips/_input.scss +2 -3
  150. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  151. package/src/styles/base/_body-theme.scss +10 -15
  152. package/src/styles/base/_document.scss +10 -33
  153. package/src/styles/base/_reset.scss +20 -40
  154. package/src/styles/base/_tokens.scss +6 -21
  155. package/src/styles/base/_typescale-tokens.scss +12 -16
  156. package/src/styles/base/_typography.scss +28 -37
  157. package/src/styles/components/_badge.scss +171 -193
  158. package/src/styles/components/_bottom-app-bar.scss +72 -90
  159. package/src/styles/components/_bottom-sheet.scss +188 -232
  160. package/src/styles/components/_button-group.scss +140 -189
  161. package/src/styles/components/_button.scss +382 -478
  162. package/src/styles/components/_card.scss +349 -473
  163. package/src/styles/components/_carousel.scss +134 -156
  164. package/src/styles/components/_checkbox.scss +208 -249
  165. package/src/styles/components/_chips.scss +239 -304
  166. package/src/styles/components/_datepicker.scss +172 -222
  167. package/src/styles/components/_dialog.scss +428 -553
  168. package/src/styles/components/_divider.scss +37 -46
  169. package/src/styles/components/_drawer.scss +571 -678
  170. package/src/styles/components/_extended-fab.scss +263 -294
  171. package/src/styles/components/_fab-menu.scss +225 -267
  172. package/src/styles/components/_fab.scss +197 -218
  173. package/src/styles/components/_icon-button.scss +483 -588
  174. package/src/styles/components/_list.scss +115 -144
  175. package/src/styles/components/_loading-indicator.scss +23 -29
  176. package/src/styles/components/_menu.scss +543 -699
  177. package/src/styles/components/_navigation-bar.scss +189 -234
  178. package/src/styles/components/_navigation-rail.scss +256 -312
  179. package/src/styles/components/_progress.scss +60 -85
  180. package/src/styles/components/_radios.scss +170 -207
  181. package/src/styles/components/_search.scss +369 -455
  182. package/src/styles/components/_select.scss +78 -185
  183. package/src/styles/components/_side-sheet.scss +234 -292
  184. package/src/styles/components/_slider.scss +289 -367
  185. package/src/styles/components/_snackbar.scss +149 -198
  186. package/src/styles/components/_split-button.scss +139 -228
  187. package/src/styles/components/_switch.scss +282 -349
  188. package/src/styles/components/_tabs.scss +350 -547
  189. package/src/styles/components/_text-field.scss +788 -980
  190. package/src/styles/components/_timepicker.scss +435 -506
  191. package/src/styles/components/_toolbar.scss +178 -242
  192. package/src/styles/components/_tooltip.scss +152 -197
  193. package/src/styles/components/_top-app-bar.scss +206 -230
  194. package/src/styles/elements/_badge.scss +42 -61
  195. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  196. package/src/styles/elements/_bottom-sheet.scss +0 -3
  197. package/src/styles/elements/_button-group.scss +80 -80
  198. package/src/styles/elements/_button.scss +72 -88
  199. package/src/styles/elements/_card.scss +48 -57
  200. package/src/styles/elements/_carousel.scss +2 -5
  201. package/src/styles/elements/_checkbox.scss +32 -43
  202. package/src/styles/elements/_chips.scss +18 -22
  203. package/src/styles/elements/_config.scss +11 -26
  204. package/src/styles/elements/_datepicker.scss +17 -22
  205. package/src/styles/elements/_dialog.scss +0 -3
  206. package/src/styles/elements/_divider.scss +11 -13
  207. package/src/styles/elements/_drawer.scss +9 -14
  208. package/src/styles/elements/_extended-fab.scss +36 -40
  209. package/src/styles/elements/_fab-menu.scss +21 -25
  210. package/src/styles/elements/_fab.scss +17 -20
  211. package/src/styles/elements/_field.scss +93 -114
  212. package/src/styles/elements/_icon-button.scss +34 -38
  213. package/src/styles/elements/_index.scss +0 -4
  214. package/src/styles/elements/_list.scss +19 -26
  215. package/src/styles/elements/_loading-indicator.scss +6 -9
  216. package/src/styles/elements/_menu.scss +0 -3
  217. package/src/styles/elements/_navigation-bar.scss +5 -9
  218. package/src/styles/elements/_navigation-rail.scss +10 -15
  219. package/src/styles/elements/_progress.scss +15 -18
  220. package/src/styles/elements/_radios.scss +24 -49
  221. package/src/styles/elements/_search.scss +19 -24
  222. package/src/styles/elements/_select.scss +4 -9
  223. package/src/styles/elements/_side-sheet.scss +0 -3
  224. package/src/styles/elements/_slider.scss +15 -35
  225. package/src/styles/elements/_snackbar.scss +0 -3
  226. package/src/styles/elements/_split-button.scss +33 -39
  227. package/src/styles/elements/_switch.scss +50 -90
  228. package/src/styles/elements/_tabs.scss +9 -13
  229. package/src/styles/elements/_text-field.scss +150 -178
  230. package/src/styles/elements/_timepicker.scss +0 -3
  231. package/src/styles/elements/_toolbar.scss +30 -35
  232. package/src/styles/elements/_tooltip.scss +0 -3
  233. package/src/styles/elements/_top-app-bar.scss +38 -45
  234. package/src/styles/main.scss +0 -15
  235. package/src/styles/themes/_autumn.scss +240 -258
  236. package/src/styles/themes/_base-theme.scss +96 -128
  237. package/src/styles/themes/_baseline.scss +273 -314
  238. package/src/styles/themes/_brownbeige.scss +242 -250
  239. package/src/styles/themes/_content.scss +240 -248
  240. package/src/styles/themes/_desert.scss +242 -250
  241. package/src/styles/themes/_expressive.scss +242 -250
  242. package/src/styles/themes/_fidelity.scss +240 -248
  243. package/src/styles/themes/_forest.scss +242 -259
  244. package/src/styles/themes/_fruit-salad.scss +242 -250
  245. package/src/styles/themes/_highcontrast.scss +164 -172
  246. package/src/styles/themes/_index.scss +0 -1
  247. package/src/styles/themes/_monochrome.scss +226 -234
  248. package/src/styles/themes/_neutral.scss +242 -250
  249. package/src/styles/themes/_ocean.scss +242 -259
  250. package/src/styles/themes/_rainbow.scss +242 -250
  251. package/src/styles/themes/_sageivory.scss +242 -250
  252. package/src/styles/themes/_spring.scss +238 -255
  253. package/src/styles/themes/_summer.scss +242 -250
  254. package/src/styles/themes/_sunset.scss +242 -259
  255. package/src/styles/themes/_tealcaramel.scss +242 -250
  256. package/src/styles/themes/_vibrant.scss +242 -250
  257. package/src/styles/utilities/_colors.scss +44 -50
  258. package/src/styles/utilities/_flexbox.scss +48 -59
  259. package/src/styles/utilities/_layout.scss +516 -591
  260. package/src/styles/utilities/_ripple.scss +61 -70
  261. package/src/styles/utilities/_spacing.scss +120 -127
  262. package/src/styles/utilities/_typography.scss +45 -58
  263. package/src/styles/utilities/_visibility.scss +61 -76
  264. package/dist/package.json +0 -488
@@ -1,103 +1,63 @@
1
- // src/styles/elements/_switch.scss
2
- // <m-switch> before upgrade: the label, then the track (unchecked or checked),
3
- // with the supporting text under the label.
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/_switch.scss: the 48px row with 4px above and below, the
10
- // 12px gap, the 52 x 32 track with its 2px outline and its 16px thumb.
11
6
  @include c.host('switch') {
12
- display: inline-grid;
13
- grid-template-columns: auto auto;
14
- align-content: center;
15
- align-items: center;
16
- column-gap: 12px;
17
- box-sizing: border-box;
18
- min-height: 56px;
19
- padding: 4px 0;
20
- color: t.color('on-surface');
21
- @include m.typography('body-large');
22
-
23
- &::after {
24
- content: '';
25
- grid-column: 2;
26
- grid-row: 1;
27
- box-sizing: border-box;
28
- width: 52px;
29
- height: 32px;
30
- border: 2px solid t.color('outline');
31
- border-radius: v.shape('full');
32
- background: radial-gradient(circle at 14px 50%, t.color('outline') 8px, transparent 8.5px) t.color('surface-container-highest');
33
- }
7
+ display: inline-grid;
8
+ grid-template-columns: auto auto;
9
+ align-content: center;
10
+ align-items: center;
11
+ column-gap: 12px;
12
+ box-sizing: border-box;
13
+ min-height: 56px;
14
+ padding: 4px 0;
15
+ color: t.color('on-surface');
16
+ @include m.typography('body-large');
17
+
18
+ &::after {
19
+ content: '';
20
+ grid-column: 2;
21
+ grid-row: 1;
22
+ box-sizing: border-box;
23
+ width: 52px;
24
+ height: 32px;
25
+ border: 2px solid t.color('outline');
26
+ border-radius: v.shape('full');
27
+ background: radial-gradient(circle at 14px 50%, t.color('outline') 8px, transparent 8.5px) t.color('surface-container-highest');
28
+ }
34
29
 
35
- &[checked]::after {
36
- border-color: t.color('primary');
37
- background: radial-gradient(circle at calc(100% - 14px) 50%, t.color('on-primary') 12px, transparent 12.5px) t.color('primary');
38
- }
30
+ &[checked]::after {
31
+ border-color: t.color('primary');
32
+ background: radial-gradient(circle at calc(100% - 14px) 50%, t.color('on-primary') 12px, transparent 12.5px) t.color('primary');
33
+ }
39
34
 
40
- &[supporting-text]::after {
41
- grid-row: 1 / span 2;
42
- }
35
+ &[supporting-text]::after {
36
+ grid-row: 1 / span 2;
37
+ }
43
38
 
44
- &[supporting-text]::before {
45
- content: attr(supporting-text);
46
- grid-column: 1;
47
- grid-row: 2;
48
- color: t.color('on-surface-variant');
49
- @include m.typography('body-medium');
50
- }
39
+ &[supporting-text]::before {
40
+ content: attr(supporting-text);
41
+ grid-column: 1;
42
+ grid-row: 2;
43
+ color: t.color('on-surface-variant');
44
+ @include m.typography('body-medium');
45
+ }
51
46
 
52
- // No slotted text and no label, so the supporting text is the only text and
53
- // there is no label row above it: the spanning track is then the first row's
54
- // only item, and an empty box synthesizes its baseline at its bottom edge —
55
- // the track's bottom, 44px — so that was the host's baseline, 11px below the
56
- // supporting text's own (33px) that the element's helper keeps after
57
- // upgrade, and inline text beside the switch moved 11px at upgrade (the
58
- // check's `[supporting-text no label]` rows). With no label above it the
59
- // track belongs beside the text, in the row `[supporting-text]::before`
60
- // places the text in: without it the first row keeps no height, the track's
61
- // box does not move, and the text's baseline — the first row with one — is
62
- // the host's before upgrade too. The labelled case keeps the span there: its
63
- // label leads the first row and carries the baseline. An empty
64
- // `supporting-text` is no supporting text (the element builds no helper from
65
- // an empty value) and is the track box below, not this.
66
- &:empty:is(:not([label]), [label=''])[supporting-text]:not([supporting-text='']) {
67
- &::after {
68
- grid-row: 2;
69
- }
70
- }
47
+ &:empty:is(:not([label]), [label=''])[supporting-text]:not([supporting-text='']) {
48
+ &::after {
49
+ grid-row: 2;
50
+ }
51
+ }
71
52
 
72
- // No slotted text, and no `label` attribute or an empty one (the element
73
- // reads `label=""` as no label and builds none), and no supporting text
74
- // (`supporting-text` absent or empty: the element builds no helper from an
75
- // empty value): the host is the 52 x 48 track box itself, as
76
- // components/_switch.scss has it — the 12px gap stands between text (a
77
- // label or supporting text) and the track, and there is none. A
78
- // whitespace-only text node is not matched here: CSS cannot see it, so
79
- // `<m-switch> </m-switch>` (or the tag with a line break inside) keeps the
80
- // labelled layout before upgrade although the element then builds no label.
81
- // Write the tag with nothing between its tags.
82
- &:empty:is(:not([label]), [label='']):is(:not([supporting-text]), [supporting-text='']) {
83
- column-gap: 0;
84
- min-height: 48px;
53
+ &:empty:is(:not([label]), [label='']):is(:not([supporting-text]), [supporting-text='']) {
54
+ column-gap: 0;
55
+ min-height: 48px;
85
56
 
86
- // The container's baseline is its first row's first item's, and the track
87
- // was the only item: an empty box synthesizes a baseline at its bottom
88
- // edge, so the host's baseline was the track's bottom, 40px from the
89
- // host's top — 16px below the 24px the element's own container has after
90
- // upgrade (4px above and below the 32px track, centred: the centre). A
91
- // zero-height item centred with the track carries that centre as the
92
- // baseline before upgrade too; it is 0 x 0, so the host's box, the track's
93
- // box and the zero gap do not change. `span 2` matches the empty
94
- // `supporting-text`'s spanning `::after` above: with an item in the first
95
- // row, that span gives the first row none of the track's 32px, so the item
96
- // has to span with it to stay centred in the track.
97
- &::before {
98
- content: '';
99
- grid-column: 1;
100
- grid-row: 1 / span 2;
101
- }
102
- }
57
+ &::before {
58
+ content: '';
59
+ grid-column: 1;
60
+ grid-row: 1 / span 2;
61
+ }
62
+ }
103
63
  }
@@ -1,22 +1,18 @@
1
- // src/styles/elements/_tabs.scss
2
- // <m-tabs> before upgrade: the row of tabs, 48px, or 64px when they have
3
- // icons; the <m-tab> declarations are drawn on upgrade.
4
1
  @use '../abstract/theme' as t;
5
2
  @use 'config' as c;
6
3
 
7
- // As components/_tabs.scss: the tab heights and the 1px divider under them.
8
4
  @include c.host('tabs') {
9
- display: block;
10
- box-sizing: border-box;
11
- height: 48px;
12
- overflow: hidden;
13
- border-bottom: 1px solid t.color('outline-variant');
5
+ display: block;
6
+ box-sizing: border-box;
7
+ height: 48px;
8
+ overflow: hidden;
9
+ border-bottom: 1px solid t.color('outline-variant');
14
10
 
15
- &:has(> [icon]) {
16
- height: 64px;
17
- }
11
+ &:has(> [icon]) {
12
+ height: 64px;
13
+ }
18
14
  }
19
15
 
20
16
  @include c.declarations('tabs') {
21
- display: none;
17
+ display: none;
22
18
  }
@@ -1,6 +1,3 @@
1
- // <m-text-field> keeps the consumer's line box around its inline field,
2
- // just as the upgraded host does. The surrogate carries the field's own
3
- // typography, box and baseline; a tall inherited strut can enlarge the host.
4
1
  @use 'config' as c;
5
2
  @use 'field';
6
3
  @use '../abstract/variables' as v;
@@ -8,179 +5,154 @@
8
5
  @use '../abstract/theme' as t;
9
6
 
10
7
  @include c.host('text-field') {
11
- display: inline-block;
12
- position: relative;
13
- width: v.text-field('width');
14
-
15
- // The value (or a space holding its baseline) paints the inner field.
16
- // Its half-pixel inset matches the input's baseline. The outer host must
17
- // retain the page's typography, including the space below that baseline.
18
- &::before {
19
- content: attr(value) ' ';
20
- display: inline-block;
21
- box-sizing: border-box;
22
- width: 100%;
23
- height: v.text-field('height');
24
- padding: 24.5px v.text-field('padding-horizontal') 0;
25
- border-radius: v.text-field('border-radius') v.text-field('border-radius') 0 0;
26
- border-bottom: v.text-field('border-width') solid t.color('on-surface-variant');
27
- background-color: t.color('surface-container-highest');
28
- color: t.color('on-surface');
29
- white-space: pre;
30
- // Clip the value without replacing its baseline with the bottom edge.
31
- overflow: clip;
32
- @include m.typography('body-large');
33
- }
34
-
35
- &:not([label])::before {
36
- padding-top: 16.5px;
37
- }
38
-
39
- &[variant='outlined']::before {
40
- padding-top: 15.5px;
41
- border: v.text-field('border-width') solid t.color('outline');
42
- border-radius: v.text-field('border-radius');
43
- background: none;
44
- }
45
-
46
- &[density='compact'] {
47
- &::before {
48
- height: 40px;
49
- padding-top: 13.5px;
50
- @include m.typography('body-medium');
51
- }
52
-
53
- &:not([label])::before { padding-top: 10px; }
54
- &[variant='outlined']::before { padding-top: 9px; }
55
- }
56
-
57
- // Reserve the helper/counter row under the field, keeping the fill and
58
- // indicator inside the field's own box.
59
- &[supporting-text]:not([supporting-text='']),
60
- &[maxlength] {
61
- &::before {
62
- height: calc(#{v.text-field('height')} + #{field.$supporting-row});
63
- border-bottom: field.$supporting-row solid transparent;
64
- background-clip: padding-box;
65
- background-image: linear-gradient(to top, #{t.color('on-surface-variant')} v.text-field('border-width'), transparent v.text-field('border-width'));
66
- }
67
-
68
- &[variant='outlined']::before {
69
- padding-top: calc(15.5px + #{v.text-field('border-width')});
70
- padding-left: calc(#{v.text-field('padding-horizontal')} + #{v.text-field('border-width')});
71
- border-width: 0 0 field.$supporting-row;
72
- border-radius: v.text-field('border-radius') / v.text-field('border-radius') v.text-field('border-radius') calc(#{v.text-field('border-radius')} + #{field.$supporting-row}) calc(#{v.text-field('border-radius')} + #{field.$supporting-row});
73
- background-image: none;
74
- box-shadow: inset 0 0 0 v.text-field('border-width') t.color('outline');
75
- }
76
-
77
- &[density='compact']::before {
78
- height: calc(40px + #{field.$supporting-row});
79
- }
80
- }
81
-
82
- &[label]::after {
83
- content: attr(label);
84
- white-space: nowrap;
85
- position: absolute;
86
- top: v.text-field('padding-vertical');
87
- left: v.text-field('padding-horizontal');
88
- color: t.color('on-surface-variant');
89
- @include m.typography('body-large');
90
- }
91
-
92
- &[label][value]:not([value=''])::after {
93
- top: 8px;
94
- @include m.typography('body-small');
95
- }
96
-
97
- &[variant='outlined'][label][value]:not([value=''])::after {
98
- top: -8px;
99
- padding: 0 4px;
100
- left: 12px;
101
- }
102
-
103
- &[density='compact']::after {
104
- top: 10px;
105
- @include m.typography('body-medium');
106
- }
107
-
108
- // Multiline reserves the textarea's box and first line. Compact multiline
109
- // keeps the compact single-line height, as the upgraded input does. The
110
- // value may hold line breaks: an inline-block's baseline is its last line,
111
- // so each deeper line would push the page's baseline down and grow the
112
- // host past the reserved box. An inline-flex container's baseline is its
113
- // first item's, so the box and the first line stay put and the deeper
114
- // lines stay clipped (#522).
115
- &[type='multiline'] {
116
- &::before {
117
- display: inline-flex;
118
- height: v.text-field('height-multiline');
119
- padding-top: v.text-field('padding-top-multiline');
120
- }
121
-
122
- &[label]::before {
123
- padding-top: v.text-field('padding-top-multiline-label');
124
- }
125
-
126
- &[variant='outlined']::before {
127
- padding-top: calc(#{v.text-field('padding-top-multiline')} - #{v.text-field('border-width')});
128
- }
129
-
130
- &[density='compact'] {
131
- &::before {
132
- height: 40px;
133
- padding-top: v.text-field('padding-top-multiline-compact');
134
- }
135
-
136
- &[label]::before {
137
- padding-top: v.text-field('padding-top-multiline-compact-label');
138
- }
139
-
140
- &[variant='outlined']::before {
141
- padding-top: calc(#{v.text-field('padding-top-multiline-compact')} - #{v.text-field('border-width')});
142
- }
143
- }
144
-
145
- &[supporting-text]:not([supporting-text='']),
146
- &[maxlength] {
147
- &::before {
148
- height: calc(#{v.text-field('height-multiline')} + #{field.$supporting-row});
149
- }
150
-
151
- &[variant='outlined']::before {
152
- padding-top: v.text-field('padding-top-multiline');
153
- }
154
-
155
- &[density='compact'] {
156
- &::before { height: calc(40px + #{field.$supporting-row}); }
157
- &[variant='outlined']::before {
158
- padding-top: v.text-field('padding-top-multiline-compact');
159
- }
160
- }
161
- }
162
- }
163
-
164
- // A password or hidden field paints no value (#53): the value attribute can
165
- // hold a password or a token in clear text, and the shared rule above paints
166
- // it for every type. The space is the empty field's line box, so a password's
167
- // box does not move at upgrade; no mask either — its length is information
168
- // too. `i`: HTML reads an input's type case-insensitively, so
169
- // `type="PASSWORD"` upgrades to a masked input and must not paint here.
170
- &[type='password' i]::before,
171
- &[type='hidden' i]::before {
172
- content: ' ';
173
- }
174
-
175
- // A hidden field takes no space, before upgrade or after: the upgraded host
176
- // is not rendered at all — a host rule for `type="hidden"` in the element's
177
- // host styles, as for `[hidden]` — so reserving a box here would move the
178
- // page twice, at paint and at upgrade. `display: none` is that, and with it
179
- // the field's chrome never renders either; the value still submits with the
180
- // form, the element being form-associated.
181
- &[type='hidden' i] {
182
- display: none;
183
- }
184
-
185
- > * { display: none; }
8
+ display: inline-block;
9
+ position: relative;
10
+ width: v.text-field('width');
11
+
12
+ &::before {
13
+ content: attr(value) ' ';
14
+ display: inline-block;
15
+ box-sizing: border-box;
16
+ width: 100%;
17
+ height: v.text-field('height');
18
+ padding: 24.5px v.text-field('padding-horizontal') 0;
19
+ border-radius: v.text-field('border-radius') v.text-field('border-radius') 0 0;
20
+ border-bottom: v.text-field('border-width') solid t.color('on-surface-variant');
21
+ background-color: t.color('surface-container-highest');
22
+ color: t.color('on-surface');
23
+ white-space: pre;
24
+ overflow: clip;
25
+ @include m.typography('body-large');
26
+ }
27
+
28
+ &:not([label])::before {
29
+ padding-top: 16.5px;
30
+ }
31
+
32
+ &[variant='outlined']::before {
33
+ padding-top: 15.5px;
34
+ border: v.text-field('border-width') solid t.color('outline');
35
+ border-radius: v.text-field('border-radius');
36
+ background: none;
37
+ }
38
+
39
+ &[density='compact'] {
40
+ &::before {
41
+ height: 40px;
42
+ padding-top: 13.5px;
43
+ @include m.typography('body-medium');
44
+ }
45
+
46
+ &:not([label])::before { padding-top: 10px; }
47
+ &[variant='outlined']::before { padding-top: 9px; }
48
+ }
49
+
50
+ &[supporting-text]:not([supporting-text='']),
51
+ &[maxlength] {
52
+ &::before {
53
+ height: calc(#{v.text-field('height')} + #{field.$supporting-row});
54
+ border-bottom: field.$supporting-row solid transparent;
55
+ background-clip: padding-box;
56
+ background-image: linear-gradient(to top, #{t.color('on-surface-variant')} v.text-field('border-width'), transparent v.text-field('border-width'));
57
+ }
58
+
59
+ &[variant='outlined']::before {
60
+ padding-top: calc(15.5px + #{v.text-field('border-width')});
61
+ padding-left: calc(#{v.text-field('padding-horizontal')} + #{v.text-field('border-width')});
62
+ border-width: 0 0 field.$supporting-row;
63
+ border-radius: v.text-field('border-radius') / v.text-field('border-radius') v.text-field('border-radius') calc(#{v.text-field('border-radius')} + #{field.$supporting-row}) calc(#{v.text-field('border-radius')} + #{field.$supporting-row});
64
+ background-image: none;
65
+ box-shadow: inset 0 0 0 v.text-field('border-width') t.color('outline');
66
+ }
67
+
68
+ &[density='compact']::before {
69
+ height: calc(40px + #{field.$supporting-row});
70
+ }
71
+ }
72
+
73
+ &[label]::after {
74
+ content: attr(label);
75
+ white-space: nowrap;
76
+ position: absolute;
77
+ top: v.text-field('padding-vertical');
78
+ left: v.text-field('padding-horizontal');
79
+ color: t.color('on-surface-variant');
80
+ @include m.typography('body-large');
81
+ }
82
+
83
+ &[label][value]:not([value=''])::after {
84
+ top: 8px;
85
+ @include m.typography('body-small');
86
+ }
87
+
88
+ &[variant='outlined'][label][value]:not([value=''])::after {
89
+ top: -8px;
90
+ padding: 0 4px;
91
+ left: 12px;
92
+ }
93
+
94
+ &[density='compact']::after {
95
+ top: 10px;
96
+ @include m.typography('body-medium');
97
+ }
98
+
99
+ &[type='multiline'] {
100
+ &::before {
101
+ display: inline-flex;
102
+ height: v.text-field('height-multiline');
103
+ padding-top: v.text-field('padding-top-multiline');
104
+ }
105
+
106
+ &[label]::before {
107
+ padding-top: v.text-field('padding-top-multiline-label');
108
+ }
109
+
110
+ &[variant='outlined']::before {
111
+ padding-top: calc(#{v.text-field('padding-top-multiline')} - #{v.text-field('border-width')});
112
+ }
113
+
114
+ &[density='compact'] {
115
+ &::before {
116
+ height: 40px;
117
+ padding-top: v.text-field('padding-top-multiline-compact');
118
+ }
119
+
120
+ &[label]::before {
121
+ padding-top: v.text-field('padding-top-multiline-compact-label');
122
+ }
123
+
124
+ &[variant='outlined']::before {
125
+ padding-top: calc(#{v.text-field('padding-top-multiline-compact')} - #{v.text-field('border-width')});
126
+ }
127
+ }
128
+
129
+ &[supporting-text]:not([supporting-text='']),
130
+ &[maxlength] {
131
+ &::before {
132
+ height: calc(#{v.text-field('height-multiline')} + #{field.$supporting-row});
133
+ }
134
+
135
+ &[variant='outlined']::before {
136
+ padding-top: v.text-field('padding-top-multiline');
137
+ }
138
+
139
+ &[density='compact'] {
140
+ &::before { height: calc(40px + #{field.$supporting-row}); }
141
+ &[variant='outlined']::before {
142
+ padding-top: v.text-field('padding-top-multiline-compact');
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ &[type='password' i]::before,
149
+ &[type='hidden' i]::before {
150
+ content: ' ';
151
+ }
152
+
153
+ &[type='hidden' i] {
154
+ display: none;
155
+ }
156
+
157
+ > * { display: none; }
186
158
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_timepicker.scss
2
- // <m-timepicker> 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('timepicker');
@@ -1,47 +1,42 @@
1
- // src/styles/elements/_toolbar.scss
2
- // <m-toolbar> before upgrade: the docked bar or the floating pill, with the
3
- // items in a row (a column when vertical) and the FAB after them.
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/_toolbar.scss: 64px, docked padded 16px at each end with the
10
- // items spread, floating padded 8px with the items 4px apart.
11
6
  @include c.host('toolbar') {
12
- display: flex;
13
- align-items: center;
14
- justify-content: space-between;
15
- gap: 8px;
16
- box-sizing: border-box;
17
- min-height: 64px;
18
- padding-inline: 16px;
19
- background-color: t.color('surface-container');
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ gap: 8px;
11
+ box-sizing: border-box;
12
+ min-height: 64px;
13
+ padding-inline: 16px;
14
+ background-color: t.color('surface-container');
20
15
 
21
- &[arrangement='center'] {
22
- justify-content: center;
23
- gap: 32px;
24
- }
16
+ &[arrangement='center'] {
17
+ justify-content: center;
18
+ gap: 32px;
19
+ }
25
20
 
26
- &[variant='floating'] {
27
- width: fit-content;
28
- justify-content: center;
29
- gap: 4px;
30
- padding: 8px;
31
- border-radius: v.shape('full');
21
+ &[variant='floating'] {
22
+ width: fit-content;
23
+ justify-content: center;
24
+ gap: 4px;
25
+ padding: 8px;
26
+ border-radius: v.shape('full');
32
27
 
33
- &:not([flat]) {
34
- @include m.elevation(1);
35
- }
28
+ &:not([flat]) {
29
+ @include m.elevation(1);
30
+ }
36
31
 
37
- &[orientation='vertical'] {
38
- flex-direction: column;
39
- min-height: 0;
40
- min-width: 64px;
41
- }
42
- }
32
+ &[orientation='vertical'] {
33
+ flex-direction: column;
34
+ min-height: 0;
35
+ min-width: 64px;
36
+ }
37
+ }
43
38
 
44
- &[color='vibrant'] {
45
- background-color: t.color('primary-container');
46
- }
39
+ &[color='vibrant'] {
40
+ background-color: t.color('primary-container');
41
+ }
47
42
  }
@@ -1,6 +1,3 @@
1
- // src/styles/elements/_tooltip.scss
2
- // <m-tooltip> 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('tooltip');