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,196 +1,165 @@
1
- // src/styles/abstract/_direction.scss
2
- //
3
- // The inline insets and the logical corner radii through the compile's
4
- // direction form (abstract/_emit.scss): the logical form writes the logical
5
- // property, the arms form the physical side plus its mirrored arm. The full
6
- // contract — the forms, $self, arm aggregation, transitions, state-re-placed
7
- // insets — is in test/styles/direction.md, which the package does not pack.
8
1
  @use 'sass:list';
9
2
  @use 'base' as base;
10
3
  @use 'mixins' as m;
11
4
  @use 'emit' as emit;
12
5
 
13
- /// The inline-start inset.
14
6
  @mixin start($value, $self: false, $arm: true) {
15
- @if emit.$direction-arms {
16
- left: $value;
17
- @if $arm {
18
- @include m.rtl($self) {
19
- left: auto;
20
- right: $value;
21
- }
22
- }
23
- } @else {
24
- inset-inline-start: $value;
25
- }
7
+ @if emit.$direction-arms {
8
+ left: $value;
9
+ @if $arm {
10
+ @include m.rtl($self) {
11
+ left: auto;
12
+ right: $value;
13
+ }
14
+ }
15
+ } @else {
16
+ inset-inline-start: $value;
17
+ }
26
18
  }
27
19
 
28
- /// The inline-end inset.
29
20
  @mixin end($value, $self: false, $arm: true) {
30
- @if emit.$direction-arms {
31
- right: $value;
32
- @if $arm {
33
- @include m.rtl($self) {
34
- right: auto;
35
- left: $value;
36
- }
37
- }
38
- } @else {
39
- inset-inline-end: $value;
40
- }
21
+ @if emit.$direction-arms {
22
+ right: $value;
23
+ @if $arm {
24
+ @include m.rtl($self) {
25
+ right: auto;
26
+ left: $value;
27
+ }
28
+ }
29
+ } @else {
30
+ inset-inline-end: $value;
31
+ }
41
32
  }
42
33
 
43
- /// Both inline insets at once, `auto` allowed on either side; the arm swaps
44
- /// the pair whole.
45
34
  @mixin sides($start, $end, $self: false, $arm: true) {
46
- @if emit.$direction-arms {
47
- left: $start;
48
- right: $end;
49
- @if $arm {
50
- @include m.rtl($self) {
51
- left: $end;
52
- right: $start;
53
- }
54
- }
55
- } @else {
56
- inset-inline-start: $start;
57
- inset-inline-end: $end;
58
- }
35
+ @if emit.$direction-arms {
36
+ left: $start;
37
+ right: $end;
38
+ @if $arm {
39
+ @include m.rtl($self) {
40
+ left: $end;
41
+ right: $start;
42
+ }
43
+ }
44
+ } @else {
45
+ inset-inline-start: $start;
46
+ inset-inline-end: $end;
47
+ }
59
48
  }
60
49
 
61
- /// The four logical corner radii, `null` for an undeclared corner; all four
62
- /// write the physical shorthand in the arms form, fewer write longhands with
63
- /// mirrored longhand arms.
64
50
  @mixin corners(
65
- $start-start: null, $start-end: null, $end-start: null, $end-end: null,
66
- $self: false, $arm: true,
51
+ $start-start: null, $start-end: null, $end-start: null, $end-end: null,
52
+ $self: false, $arm: true,
67
53
  ) {
68
- @if emit.$direction-arms {
69
- @if $start-start and $start-end and $end-start and $end-end {
70
- border-radius: $start-start $start-end $end-end $end-start;
71
- @if $arm {
72
- @include m.rtl($self) {
73
- border-radius: $start-end $start-start $end-start $end-end;
74
- }
75
- }
76
- } @else {
77
- @if $start-start { border-top-left-radius: $start-start; }
78
- @if $start-end { border-top-right-radius: $start-end; }
79
- @if $end-start { border-bottom-left-radius: $end-start; }
80
- @if $end-end { border-bottom-right-radius: $end-end; }
81
- @if $arm {
82
- @include m.rtl($self) {
83
- @if $start-start { border-top-right-radius: $start-start; }
84
- @if $start-end { border-top-left-radius: $start-end; }
85
- @if $end-start { border-bottom-right-radius: $end-start; }
86
- @if $end-end { border-bottom-left-radius: $end-end; }
87
- }
88
- }
89
- }
90
- } @else {
91
- @if $start-start { border-start-start-radius: $start-start; }
92
- @if $start-end { border-start-end-radius: $start-end; }
93
- @if $end-start { border-end-start-radius: $end-start; }
94
- @if $end-end { border-end-end-radius: $end-end; }
95
- }
54
+ @if emit.$direction-arms {
55
+ @if $start-start and $start-end and $end-start and $end-end {
56
+ border-radius: $start-start $start-end $end-end $end-start;
57
+ @if $arm {
58
+ @include m.rtl($self) {
59
+ border-radius: $start-end $start-start $end-start $end-end;
60
+ }
61
+ }
62
+ } @else {
63
+ @if $start-start { border-top-left-radius: $start-start; }
64
+ @if $start-end { border-top-right-radius: $start-end; }
65
+ @if $end-start { border-bottom-left-radius: $end-start; }
66
+ @if $end-end { border-bottom-right-radius: $end-end; }
67
+ @if $arm {
68
+ @include m.rtl($self) {
69
+ @if $start-start { border-top-right-radius: $start-start; }
70
+ @if $start-end { border-top-left-radius: $start-end; }
71
+ @if $end-start { border-bottom-right-radius: $end-start; }
72
+ @if $end-end { border-bottom-left-radius: $end-end; }
73
+ }
74
+ }
75
+ }
76
+ } @else {
77
+ @if $start-start { border-start-start-radius: $start-start; }
78
+ @if $start-end { border-start-end-radius: $start-end; }
79
+ @if $end-start { border-end-start-radius: $end-start; }
80
+ @if $end-end { border-end-end-radius: $end-end; }
81
+ }
96
82
  }
97
83
 
98
- /// A direction arm this site aggregates by hand; nothing in the logical form.
99
84
  @mixin arms($self: false) {
100
- @if emit.$direction-arms {
101
- @include m.rtl($self) {
102
- @content;
103
- }
104
- }
85
+ @if emit.$direction-arms {
86
+ @include m.rtl($self) {
87
+ @content;
88
+ }
89
+ }
105
90
  }
106
91
 
107
- /// arms' wrapper for a subject that is not this site's selector extended
108
- /// (`rtl-selector` in abstract/_mixins.scss).
109
92
  @mixin arms-selector($subject) {
110
- @if emit.$direction-arms {
111
- @include m.rtl-selector($subject) {
112
- @content;
113
- }
114
- }
93
+ @if emit.$direction-arms {
94
+ @include m.rtl-selector($subject) {
95
+ @content;
96
+ }
97
+ }
115
98
  }
116
99
 
117
- /// An arms-only block at the document root under a prelude this site owns
118
- /// whole; nothing in the logical form.
119
100
  @mixin arms-at-root($prelude) {
120
- @if emit.$direction-arms {
121
- @at-root #{$prelude} {
122
- @content;
123
- }
124
- }
101
+ @if emit.$direction-arms {
102
+ @at-root #{$prelude} {
103
+ @content;
104
+ }
105
+ }
125
106
  }
126
107
 
127
- /// A logical alias of a physical base a shared rule wrote on the pair; the
128
- /// arms form flips that base under a self arm.
129
108
  @mixin flip-start($value) {
130
- @if emit.$direction-arms {
131
- @include m.rtl(true) {
132
- left: auto;
133
- right: $value;
134
- }
135
- } @else {
136
- left: auto;
137
- inset-inline-start: $value;
138
- }
109
+ @if emit.$direction-arms {
110
+ @include m.rtl(true) {
111
+ left: auto;
112
+ right: $value;
113
+ }
114
+ } @else {
115
+ left: auto;
116
+ inset-inline-start: $value;
117
+ }
139
118
  }
140
119
 
141
- /// `flip-start`'s end-side twin.
142
120
  @mixin flip-end($value) {
143
- @if emit.$direction-arms {
144
- @include m.rtl(true) {
145
- right: auto;
146
- left: $value;
147
- }
148
- } @else {
149
- right: auto;
150
- inset-inline-end: $value;
151
- }
121
+ @if emit.$direction-arms {
122
+ @include m.rtl(true) {
123
+ right: auto;
124
+ left: $value;
125
+ }
126
+ } @else {
127
+ right: auto;
128
+ inset-inline-end: $value;
129
+ }
152
130
  }
153
131
 
154
- /// One transition entry in this form's property names (emit.transition-names);
155
- /// an inline inset names both physical sides in the arms form, so the move
156
- /// animates whichever side the direction placed it on.
157
132
  @function transition($property, $timing) {
158
- $entries: ();
159
- @each $name in emit.transition-names($property) {
160
- $entries: list.append($entries, #{$name} $timing, comma);
161
- }
162
- @if list.length($entries) == 1 {
163
- @return list.nth($entries, 1);
164
- }
165
- @return $entries;
133
+ $entries: ();
134
+ @each $name in emit.transition-names($property) {
135
+ $entries: list.append($entries, #{$name} $timing, comma);
136
+ }
137
+ @if list.length($entries) == 1 {
138
+ @return list.nth($entries, 1);
139
+ }
140
+ @return $entries;
166
141
  }
167
142
 
168
- /// Only the self arm, for a marker on the root this block is written in; the
169
- /// logical form emits nothing.
170
143
  @mixin arms-self-only {
171
- @if emit.$direction-arms {
172
- &:where(.#{base.$prefix}-rtl, [dir='rtl']) {
173
- @content;
174
- }
175
- }
144
+ @if emit.$direction-arms {
145
+ &:where(.#{base.$prefix}-rtl, [dir='rtl']) {
146
+ @content;
147
+ }
148
+ }
176
149
  }
177
150
 
178
- /// An inline-start inset whose value states re-place, through a custom
179
- /// property in the arms form; the logical form is the plain logical inset.
180
151
  @mixin start-value($name, $value) {
181
- @if emit.$direction-arms {
182
- left: var(#{$name}, #{$value});
183
- } @else {
184
- inset-inline-start: $value;
185
- }
152
+ @if emit.$direction-arms {
153
+ left: var(#{$name}, #{$value});
154
+ } @else {
155
+ inset-inline-start: $value;
156
+ }
186
157
  }
187
158
 
188
- /// A state's override of a `start-value` base: the property this state moves
189
- /// the subject to.
190
159
  @mixin start-value-set($name, $value) {
191
- @if emit.$direction-arms {
192
- #{$name}: #{$value};
193
- } @else {
194
- inset-inline-start: $value;
195
- }
160
+ @if emit.$direction-arms {
161
+ #{$name}: #{$value};
162
+ } @else {
163
+ inset-inline-start: $value;
164
+ }
196
165
  }
@@ -1,20 +1,11 @@
1
- // src/styles/abstract/_emit.scss
2
- //
3
- // Which direction form this compile emits: logical by default; the artefacts
4
- // a consumer's bundler takes through a CSS pipeline compile once more with
5
- // $direction-arms: true (scripts/build-styles.ts, test/styles/direction.md). The
6
- // entry configures this module; every @use after it reads the same value.
7
1
  $direction-arms: false !default;
8
2
 
9
- /// The property names a transition needs in this form: an inline inset is two
10
- /// physical sides in the arms form, both named so a move animates the side
11
- /// the arm set.
12
3
  @function transition-names($property) {
13
- @if not $direction-arms {
14
- @return $property;
15
- }
16
- @if $property == 'inset-inline-start' or $property == 'inset-inline-end' {
17
- @return left, right;
18
- }
19
- @return $property;
4
+ @if not $direction-arms {
5
+ @return $property;
6
+ }
7
+ @if $property == 'inset-inline-start' or $property == 'inset-inline-end' {
8
+ @return left, right;
9
+ }
10
+ @return $property;
20
11
  }
@@ -1,12 +1,11 @@
1
- // The viewport corners reserved by FAB and extended FAB before upgrade.
2
1
  @mixin corners {
3
- @each $block in top, bottom {
4
- @each $inline in start, end {
5
- &[placement='#{$block}-#{$inline}'] {
6
- position: fixed;
7
- #{$block}: 16px;
8
- inset-inline-#{$inline}: 16px;
9
- }
10
- }
11
- }
2
+ @each $block in top, bottom {
3
+ @each $inline in start, end {
4
+ &[placement='#{$block}-#{$inline}'] {
5
+ position: fixed;
6
+ #{$block}: 16px;
7
+ inset-inline-#{$inline}: 16px;
8
+ }
9
+ }
10
+ }
12
11
  }
@@ -1,136 +1,121 @@
1
- // src/styles/abstract/_functions.scss
2
1
  @use 'sass:map';
3
2
  @use 'sass:math';
4
3
  @use 'sass:color';
5
4
  @use 'sass:string';
6
5
  @use 'variables' as v;
7
6
 
8
- // Get nested map value
9
7
  @function map-deep-get($map, $keys...) {
10
- @each $key in $keys {
11
- $map: map.get($map, $key);
12
- }
13
- @return $map;
8
+ @each $key in $keys {
9
+ $map: map.get($map, $key);
10
+ }
11
+ @return $map;
14
12
  }
15
13
 
16
- // Get value from design tokens
17
14
  @function get-token($category, $token) {
18
- $token-map: null;
19
-
20
- @if $category == 'state' {
21
- $token-map: v.$state;
22
- } @else if $category == 'motion' {
23
- $token-map: v.$motion;
24
- } @else if $category == 'elevation' {
25
- $token-map: v.$elevation;
26
- } @else if $category == 'typescale' {
27
- $token-map: v.$typescale;
28
- } @else if $category == 'shape' {
29
- $token-map: v.$shape;
30
- } @else if $category == 'z-index' {
31
- $token-map: v.$z-index;
32
- }
33
-
34
- @if not $token-map {
35
- @error 'Unknown token category: #{$category}';
36
- }
37
-
38
- $value: map.get($token-map, $token);
39
-
40
- @if not $value {
41
- @error 'Unknown token: #{$token} in category #{$category}';
42
- }
43
-
44
- @return $value;
45
- }
46
-
47
- // State Layer
15
+ $token-map: null;
16
+
17
+ @if $category == 'state' {
18
+ $token-map: v.$state;
19
+ } @else if $category == 'motion' {
20
+ $token-map: v.$motion;
21
+ } @else if $category == 'elevation' {
22
+ $token-map: v.$elevation;
23
+ } @else if $category == 'typescale' {
24
+ $token-map: v.$typescale;
25
+ } @else if $category == 'shape' {
26
+ $token-map: v.$shape;
27
+ } @else if $category == 'z-index' {
28
+ $token-map: v.$z-index;
29
+ }
30
+
31
+ @if not $token-map {
32
+ @error 'Unknown token category: #{$category}';
33
+ }
34
+
35
+ $value: map.get($token-map, $token);
36
+
37
+ @if not $value {
38
+ @error 'Unknown token: #{$token} in category #{$category}';
39
+ }
40
+
41
+ @return $value;
42
+ }
43
+
48
44
  @function get-state-opacity($state) {
49
- @return get-token('state', '#{$state}-state-layer-opacity');
45
+ @return get-token('state', '#{$state}-state-layer-opacity');
50
46
  }
51
47
 
52
- // Motion
53
48
  @function get-motion-duration($duration) {
54
- @return get-token('motion', 'duration-#{$duration}');
49
+ @return get-token('motion', 'duration-#{$duration}');
55
50
  }
56
51
 
57
52
  @function get-motion-easing($easing) {
58
- @return get-token('motion', 'easing-#{$easing}');
53
+ @return get-token('motion', 'easing-#{$easing}');
59
54
  }
60
55
 
61
- // Elevation
62
56
  @function get-elevation($level) {
63
- @return get-token('elevation', 'level-#{$level}');
57
+ @return get-token('elevation', 'level-#{$level}');
64
58
  }
65
59
 
66
- // Typography
67
60
  @function get-typography($scale) {
68
- @return get-token('typescale', $scale);
61
+ @return get-token('typescale', $scale);
69
62
  }
70
63
 
71
- /// The face a typescale role wears: the brand one for display, headline and
72
- /// title, the plain one for body and label.
73
64
  @function typeface($role) {
74
- @each $group in ('display-', 'headline-', 'title-') {
75
- @if string.index($role, $group) == 1 {
76
- @return 'brand';
77
- }
78
- }
79
- @return 'plain';
65
+ @each $group in ('display-', 'headline-', 'title-') {
66
+ @if string.index($role, $group) == 1 {
67
+ @return 'brand';
68
+ }
69
+ }
70
+ @return 'plain';
80
71
  }
81
72
 
82
- // Shape
83
73
  @function get-shape($size) {
84
- @return v.shape($size);
74
+ @return v.shape($size);
85
75
  }
86
76
 
87
- // Z-index
88
77
  @function get-z-index($layer) {
89
- @return get-token('z-index', $layer);
78
+ @return get-token('z-index', $layer);
90
79
  }
91
80
 
92
- // Breakpoints
93
81
  @function get-breakpoint($size) {
94
- @return map.get(v.$breakpoints, $size);
82
+ @return map.get(v.$breakpoints, $size);
95
83
  }
96
84
 
97
- // Color utilities
98
85
  @function get-luminance($color) {
99
- $red: color.red($color);
100
- $green: color.green($color);
101
- $blue: color.blue($color);
102
-
103
- $luminance: ($red * 0.299 + $green * 0.587 + $blue * 0.114) / 255;
104
- @return $luminance;
86
+ $red: color.red($color);
87
+ $green: color.green($color);
88
+ $blue: color.blue($color);
89
+
90
+ $luminance: ($red * 0.299 + $green * 0.587 + $blue * 0.114) / 255;
91
+ @return $luminance;
105
92
  }
106
93
 
107
94
  @function is-light-color($color) {
108
- @return get-luminance($color) > 0.6;
95
+ @return get-luminance($color) > 0.6;
109
96
  }
110
97
 
111
98
  @function get-contrast-color($color, $light: #fff, $dark: #000) {
112
- @return if(is-light-color($color), $dark, $light);
99
+ @return if(is-light-color($color), $dark, $light);
113
100
  }
114
101
 
115
- // Unit conversion utilities
116
102
  @function strip-unit($number) {
117
- @if type-of($number) == 'number' and not unitless($number) {
118
- @return math.div($number, ($number * 0 + 1));
119
- }
120
- @return $number;
103
+ @if type-of($number) == 'number' and not unitless($number) {
104
+ @return math.div($number, ($number * 0 + 1));
105
+ }
106
+ @return $number;
121
107
  }
122
108
 
123
109
  @function to-rem($size, $base-size: 16px) {
124
- $rem-size: math.div(strip-unit($size), strip-unit($base-size));
125
- @return #{$rem-size}rem;
110
+ $rem-size: math.div(strip-unit($size), strip-unit($base-size));
111
+ @return #{$rem-size}rem;
126
112
  }
127
113
 
128
114
  @function to-em($size, $base-size: 16px) {
129
- $em-size: math.div(strip-unit($size), strip-unit($base-size));
130
- @return #{$em-size}em;
115
+ $em-size: math.div(strip-unit($size), strip-unit($base-size));
116
+ @return #{$em-size}em;
131
117
  }
132
118
 
133
- // Value constraint utility
134
119
  @function constrain($min, $value, $max) {
135
- @return max($min, min($value, $max));
120
+ @return max($min, min($value, $max));
136
121
  }