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,4 +1,3 @@
1
- // src/styles/abstract/_mixins.scss
2
1
  @use 'sass:map';
3
2
  @use 'sass:list';
4
3
  @use 'sass:math';
@@ -7,551 +6,448 @@
7
6
  @use 'functions' as f;
8
7
  @use 'emit' as emit;
9
8
 
10
- // Common icons map
11
9
  $icons: (
12
- 'chevron_right': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="9 18 15 12 9 6"%3E%3C/polyline%3E%3C/svg%3E',
13
- 'chevron_down': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E',
14
- 'check': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="20 6 9 17 4 12"%3E%3C/polyline%3E%3C/svg%3E'
10
+ 'chevron_right': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="9 18 15 12 9 6"%3E%3C/polyline%3E%3C/svg%3E',
11
+ 'chevron_down': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E',
12
+ 'check': 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="20 6 9 17 4 12"%3E%3C/polyline%3E%3C/svg%3E'
15
13
  );
16
14
 
17
15
  @mixin icon($name, $size: 24px) {
18
- $icon-url: map.get($icons, $name);
19
- @if $icon-url {
20
- content: '';
21
- display: inline-block;
22
- width: $size;
23
- height: $size;
24
- background-image: url($icon-url);
25
- background-size: contain;
26
- background-position: center;
27
- background-repeat: no-repeat;
28
- }
29
- }
30
-
31
- // Typography
16
+ $icon-url: map.get($icons, $name);
17
+ @if $icon-url {
18
+ content: '';
19
+ display: inline-block;
20
+ width: $size;
21
+ height: $size;
22
+ background-image: url($icon-url);
23
+ background-size: contain;
24
+ background-position: center;
25
+ background-repeat: no-repeat;
26
+ }
27
+ }
28
+
32
29
  @mixin typography($scale) {
33
- $styles: f.get-typography($scale);
34
- // The role's face as its reference token, the compiled family as the fallback
35
- // An app or theme sets --{prefix}-ref-typeface-brand or -plain
36
- font-family: var(--#{base.$prefix}-ref-typeface-#{f.typeface($scale)}, #{map.get($styles, 'font-family')});
37
- font-size: map.get($styles, 'font-size');
38
- line-height: map.get($styles, 'line-height');
39
- letter-spacing: map.get($styles, 'letter-spacing');
40
- font-weight: map.get($styles, 'font-weight');
41
- }
42
-
43
- /// A typescale role through its custom properties: the
44
- /// `--{prefix}-sys-typescale-{role}-*` tokens base/_tokens.scss emits from the
45
- /// same map, so setting `--{prefix}-ref-typeface-brand`/`-plain`, or a size
46
- /// token, reaches everything that uses it.
30
+ $styles: f.get-typography($scale);
31
+ font-family: var(--#{base.$prefix}-ref-typeface-#{f.typeface($scale)}, #{map.get($styles, 'font-family')});
32
+ font-size: map.get($styles, 'font-size');
33
+ line-height: map.get($styles, 'line-height');
34
+ letter-spacing: map.get($styles, 'letter-spacing');
35
+ font-weight: map.get($styles, 'font-weight');
36
+ }
37
+
47
38
  @mixin typescale($role) {
48
- $t: '--#{base.$prefix}-sys-typescale-#{$role}';
49
- font-family: var(#{$t}-font);
50
- font-size: var(#{$t}-font-size);
51
- line-height: var(#{$t}-line-height);
52
- letter-spacing: var(#{$t}-letter-spacing);
53
- font-weight: var(#{$t}-font-weight);
39
+ $t: '--#{base.$prefix}-sys-typescale-#{$role}';
40
+ font-family: var(#{$t}-font);
41
+ font-size: var(#{$t}-font-size);
42
+ line-height: var(#{$t}-line-height);
43
+ letter-spacing: var(#{$t}-letter-spacing);
44
+ font-weight: var(#{$t}-font-weight);
54
45
  }
55
46
 
56
- // State Layers
57
47
  @mixin state-layer($color, $state: 'hover', $selector: false) {
58
- // The host is the layer's containing block, so a static host needs a
59
- // position. A host that already has one (a fixed corner FAB, an absolute or
60
- // sticky element of the app's own) keeps it: `:where()` gives this
61
- // declaration no specificity, so any other position wins, here or in the
62
- // page. Written beside the state selector it was (0,2,0) and beat the
63
- // corner classes' (0,1,0), which took the button out of its corner while
64
- // hovered, focused or pressed.
65
- @at-root :where(&) {
66
- position: relative;
67
- }
68
-
69
- // The ripple is the press (as Compose draws it: one pressed indication at
70
- // 0.10). An element that carries a ripple leaves its pressed layer to the wave, so
71
- // the two no longer add up to about 0.18; one without a ripple keeps it.
72
- @if $state == 'pressed' {
73
- &:not(:has(> .#{base.$prefix}-ripple)) {
74
- @include -state-layer-surface($color, $state, $selector);
75
- }
76
- } @else {
77
- @include -state-layer-surface($color, $state, $selector);
78
- }
48
+ @at-root :where(&) {
49
+ position: relative;
50
+ }
51
+
52
+ @if $state == 'pressed' {
53
+ &:not(:has(> .#{base.$prefix}-ripple)) {
54
+ @include -state-layer-surface($color, $state, $selector);
55
+ }
56
+ } @else {
57
+ @include -state-layer-surface($color, $state, $selector);
58
+ }
79
59
  }
80
60
 
81
61
  @mixin -state-layer-surface($color, $state, $selector) {
82
- @if $selector == false {
83
- // Default behavior - create a pseudo-element for the state layer
84
- &::before {
85
- content: '';
86
- position: absolute;
87
- inset: 0;
88
- background-color: $color;
89
- opacity: f.get-state-opacity($state);
90
- pointer-events: none;
91
- border-radius: inherit;
92
- }
93
- } @else {
94
- // Use the provided selector
95
- #{$selector} {
96
- content: '';
97
- position: absolute;
98
- inset: 0;
99
- background-color: $color;
100
- opacity: f.get-state-opacity($state);
101
- pointer-events: none;
102
- border-radius: inherit;
103
- }
104
- }
105
- }
106
-
107
- // Elevation
62
+ @if $selector == false {
63
+ &::before {
64
+ content: '';
65
+ position: absolute;
66
+ inset: 0;
67
+ background-color: $color;
68
+ opacity: f.get-state-opacity($state);
69
+ pointer-events: none;
70
+ border-radius: inherit;
71
+ }
72
+ } @else {
73
+ #{$selector} {
74
+ content: '';
75
+ position: absolute;
76
+ inset: 0;
77
+ background-color: $color;
78
+ opacity: f.get-state-opacity($state);
79
+ pointer-events: none;
80
+ border-radius: inherit;
81
+ }
82
+ }
83
+ }
84
+
108
85
  @mixin elevation($level) {
109
- box-shadow: f.get-elevation($level);
110
- }
111
-
112
- // Motion
113
- //
114
- // One transition on an M3 Expressive spring token: `spring(transform,
115
- // default-spatial)`. Spatial springs move position, size and shape and may
116
- // overshoot; effects springs change opacity and colour and never do.
117
- // A delay lets a property wait for another transition, such as visibility
118
- // flipping to hidden only once a fade has finished.
119
- // A spring on an inline inset the arms form splits across `left` and `right`
120
- // names both sides there, so the move animates whichever side the direction
121
- // placed it on (abstract/_emit.scss, abstract/_direction.scss).
86
+ box-shadow: f.get-elevation($level);
87
+ }
88
+
122
89
  @function spring($property, $token, $delay: null) {
123
- $names: emit.transition-names($property);
124
- $transitions: ();
125
- @each $name in $names {
126
- $transition: $name v.motion('spring-#{$token}-duration') v.motion('spring-#{$token}-easing');
127
- @if $delay {
128
- $transition: list.append($transition, $delay);
129
- }
130
- $transitions: list.append($transitions, $transition, comma);
131
- }
132
- @if list.length($transitions) == 1 {
133
- @return list.nth($transitions, 1);
134
- }
135
- @return $transitions;
136
- }
137
-
138
- // How long a spring token takes to settle, for delays tied to it.
90
+ $names: emit.transition-names($property);
91
+ $transitions: ();
92
+ @each $name in $names {
93
+ $transition: $name v.motion('spring-#{$token}-duration') v.motion('spring-#{$token}-easing');
94
+ @if $delay {
95
+ $transition: list.append($transition, $delay);
96
+ }
97
+ $transitions: list.append($transitions, $transition, comma);
98
+ }
99
+ @if list.length($transitions) == 1 {
100
+ @return list.nth($transitions, 1);
101
+ }
102
+ @return $transitions;
103
+ }
104
+
139
105
  @function spring-duration($token) {
140
- @return v.motion('spring-#{$token}-duration');
106
+ @return v.motion('spring-#{$token}-duration');
141
107
  }
142
108
 
143
- // Sheets that slide in on a spatial spring overshoot their resting place, so
144
- // for a moment a gap would open between the sheet and the screen edge it is
145
- // docked to. Compose stretches the sheet over that gap; a solid shadow of the
146
- // sheet's own colour, extended past the docked edge, covers it without a scale.
147
- // The spring overshoots by about 1.5% of the distance travelled.
148
109
  $sheet-overshoot-guard: 32px;
149
110
 
150
111
  @mixin motion-transition($properties...) {
151
- $transitions: ();
152
- @each $prop in $properties {
153
- $transitions: list.append(
154
- $transitions,
155
- $prop f.get-motion-duration('short2') v.motion('easing-standard'),
156
- comma
157
- );
158
- }
159
- transition: $transitions;
112
+ $transitions: ();
113
+ @each $prop in $properties {
114
+ $transitions: list.append(
115
+ $transitions,
116
+ $prop f.get-motion-duration('short2') v.motion('easing-standard'),
117
+ comma
118
+ );
119
+ }
120
+ transition: $transitions;
160
121
  }
161
122
 
162
123
  @mixin motion-exit($properties...) {
163
- $transitions: ();
164
- @each $prop in $properties {
165
- $transitions: list.append(
166
- $transitions,
167
- $prop f.get-motion-duration('short4') v.motion('easing-exit'),
168
- comma
169
- );
170
- }
171
- transition: $transitions;
124
+ $transitions: ();
125
+ @each $prop in $properties {
126
+ $transitions: list.append(
127
+ $transitions,
128
+ $prop f.get-motion-duration('short4') v.motion('easing-exit'),
129
+ comma
130
+ );
131
+ }
132
+ transition: $transitions;
172
133
  }
173
134
 
174
135
  @mixin motion-enter($properties...) {
175
- $transitions: ();
176
- @each $prop in $properties {
177
- $transitions: list.append(
178
- $transitions,
179
- $prop f.get-motion-duration('short4') v.motion('easing-enter'),
180
- comma
181
- );
182
- }
183
- transition: $transitions;
184
- }
185
-
186
- // New mixins for specific animation behaviors
136
+ $transitions: ();
137
+ @each $prop in $properties {
138
+ $transitions: list.append(
139
+ $transitions,
140
+ $prop f.get-motion-duration('short4') v.motion('easing-enter'),
141
+ comma
142
+ );
143
+ }
144
+ transition: $transitions;
145
+ }
146
+
187
147
  @mixin motion-appear($properties...) {
188
- $transitions: ();
189
- @each $prop in $properties {
190
- $transitions: list.append(
191
- $transitions,
192
- $prop f.get-motion-duration('short3') v.motion('easing-appear'),
193
- comma
194
- );
195
- }
196
- transition: $transitions;
148
+ $transitions: ();
149
+ @each $prop in $properties {
150
+ $transitions: list.append(
151
+ $transitions,
152
+ $prop f.get-motion-duration('short3') v.motion('easing-appear'),
153
+ comma
154
+ );
155
+ }
156
+ transition: $transitions;
197
157
  }
198
158
 
199
159
  @mixin motion-disappear($properties...) {
200
- $transitions: ();
201
- @each $prop in $properties {
202
- $transitions: list.append(
203
- $transitions,
204
- $prop f.get-motion-duration('short2') v.motion('easing-disappear'),
205
- comma
206
- );
207
- }
208
- transition: $transitions;
160
+ $transitions: ();
161
+ @each $prop in $properties {
162
+ $transitions: list.append(
163
+ $transitions,
164
+ $prop f.get-motion-duration('short2') v.motion('easing-disappear'),
165
+ comma
166
+ );
167
+ }
168
+ transition: $transitions;
209
169
  }
210
170
 
211
171
  @mixin motion-expand($properties...) {
212
- $transitions: ();
213
- @each $prop in $properties {
214
- $transitions: list.append(
215
- $transitions,
216
- $prop f.get-motion-duration('short4') v.motion('easing-expand'),
217
- comma
218
- );
219
- }
220
- transition: $transitions;
172
+ $transitions: ();
173
+ @each $prop in $properties {
174
+ $transitions: list.append(
175
+ $transitions,
176
+ $prop f.get-motion-duration('short4') v.motion('easing-expand'),
177
+ comma
178
+ );
179
+ }
180
+ transition: $transitions;
221
181
  }
222
182
 
223
183
  @mixin motion-collapse($properties...) {
224
- $transitions: ();
225
- @each $prop in $properties {
226
- $transitions: list.append(
227
- $transitions,
228
- $prop f.get-motion-duration('short3') v.motion('easing-collapse'),
229
- comma
230
- );
231
- }
232
- transition: $transitions;
233
- }
234
-
235
- // Focus Ring
184
+ $transitions: ();
185
+ @each $prop in $properties {
186
+ $transitions: list.append(
187
+ $transitions,
188
+ $prop f.get-motion-duration('short3') v.motion('easing-collapse'),
189
+ comma
190
+ );
191
+ }
192
+ transition: $transitions;
193
+ }
194
+
236
195
  @mixin focus-ring($color: var(--#{v.$prefix}-sys-color-primary), $width: 2px, $offset: 2px) {
237
- &:focus-visible {
238
- outline: $width solid $color;
239
- outline-offset: $offset;
240
- @include elevation(1);
241
- }
196
+ &:focus-visible {
197
+ outline: $width solid $color;
198
+ outline-offset: $offset;
199
+ @include elevation(1);
200
+ }
242
201
  }
243
202
 
244
- // Interactive States
245
203
  @mixin interactive-states($config: ()) {
246
- $default-config: (
247
- base-color: var(--#{v.$prefix}-sys-color-primary),
248
- hover-state: true,
249
- focus-state: true,
250
- active-state: true,
251
- disabled-state: true,
252
- disabled-opacity: 0.38
253
- );
254
-
255
- $config: map.merge($default-config, $config);
256
-
257
- @if map.get($config, hover-state) {
258
- &:hover {
259
- @include state-layer(map.get($config, base-color), 'hover');
260
- }
261
- }
262
-
263
- @if map.get($config, focus-state) {
264
- &:focus {
265
- @include state-layer(map.get($config, base-color), 'focus');
266
- }
267
- }
268
-
269
- @if map.get($config, active-state) {
270
- &:active {
271
- @include state-layer(map.get($config, base-color), 'pressed');
272
- }
273
- }
274
-
275
- @if map.get($config, disabled-state) {
276
- &:disabled {
277
- opacity: map.get($config, disabled-opacity);
278
- pointer-events: none;
279
- }
280
- }
281
- }
282
-
283
- // Layout
204
+ $default-config: (
205
+ base-color: var(--#{v.$prefix}-sys-color-primary),
206
+ hover-state: true,
207
+ focus-state: true,
208
+ active-state: true,
209
+ disabled-state: true,
210
+ disabled-opacity: 0.38
211
+ );
212
+
213
+ $config: map.merge($default-config, $config);
214
+
215
+ @if map.get($config, hover-state) {
216
+ &:hover {
217
+ @include state-layer(map.get($config, base-color), 'hover');
218
+ }
219
+ }
220
+
221
+ @if map.get($config, focus-state) {
222
+ &:focus {
223
+ @include state-layer(map.get($config, base-color), 'focus');
224
+ }
225
+ }
226
+
227
+ @if map.get($config, active-state) {
228
+ &:active {
229
+ @include state-layer(map.get($config, base-color), 'pressed');
230
+ }
231
+ }
232
+
233
+ @if map.get($config, disabled-state) {
234
+ &:disabled {
235
+ opacity: map.get($config, disabled-opacity);
236
+ pointer-events: none;
237
+ }
238
+ }
239
+ }
240
+
284
241
  @mixin flex-center {
285
- display: flex;
286
- align-items: center;
287
- justify-content: center;
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: center;
288
245
  }
289
246
 
290
247
  @mixin center-content {
291
- position: absolute;
292
- top: 50%;
293
- left: 50%;
294
- transform: translate(-50%, -50%);
248
+ position: absolute;
249
+ top: 50%;
250
+ left: 50%;
251
+ transform: translate(-50%, -50%);
295
252
  }
296
253
 
297
254
  @mixin container($max-width: 1200px, $padding: 24px) {
298
- width: 100%;
299
- max-width: $max-width;
300
- margin-inline: auto;
301
- padding-inline: $padding;
255
+ width: 100%;
256
+ max-width: $max-width;
257
+ margin-inline: auto;
258
+ padding-inline: $padding;
302
259
  }
303
260
 
304
- // Text
305
261
  @mixin truncate($lines: 1) {
306
- @if $lines == 1 {
307
- overflow: hidden;
308
- text-overflow: ellipsis;
309
- white-space: nowrap;
310
- } @else {
311
- display: -webkit-box;
312
- -webkit-line-clamp: $lines;
313
- -webkit-box-orient: vertical;
314
- overflow: hidden;
315
- }
316
- }
317
-
318
- // Shape
262
+ @if $lines == 1 {
263
+ overflow: hidden;
264
+ text-overflow: ellipsis;
265
+ white-space: nowrap;
266
+ } @else {
267
+ display: -webkit-box;
268
+ -webkit-line-clamp: $lines;
269
+ -webkit-box-orient: vertical;
270
+ overflow: hidden;
271
+ }
272
+ }
273
+
319
274
  @mixin shape($size) {
320
- border-radius: f.get-shape($size);
275
+ border-radius: f.get-shape($size);
321
276
  }
322
277
 
323
- // Media Queries
324
278
  @mixin breakpoint-up($size) {
325
- @media (min-width: f.get-breakpoint($size)) {
326
- @content;
327
- }
279
+ @media (min-width: f.get-breakpoint($size)) {
280
+ @content;
281
+ }
328
282
  }
329
283
 
330
284
  @mixin breakpoint-down($size) {
331
- @media (max-width: f.get-breakpoint($size) - 1) {
332
- @content;
333
- }
285
+ @media (max-width: f.get-breakpoint($size) - 1) {
286
+ @content;
287
+ }
334
288
  }
335
289
 
336
290
  @mixin breakpoint-between($min, $max) {
337
- @media (min-width: f.get-breakpoint($min)) and (max-width: f.get-breakpoint($max) - 1) {
338
- @content;
339
- }
291
+ @media (min-width: f.get-breakpoint($min)) and (max-width: f.get-breakpoint($max) - 1) {
292
+ @content;
293
+ }
340
294
  }
341
295
 
342
- // A11y
343
296
  @mixin visually-hidden {
344
- position: absolute;
345
- width: 1px;
346
- height: 1px;
347
- padding: 0;
348
- margin: -1px;
349
- overflow: hidden;
350
- clip: rect(0, 0, 0, 0);
351
- white-space: nowrap;
352
- border: 0;
297
+ position: absolute;
298
+ width: 1px;
299
+ height: 1px;
300
+ padding: 0;
301
+ margin: -1px;
302
+ overflow: hidden;
303
+ clip: rect(0, 0, 0, 0);
304
+ white-space: nowrap;
305
+ border: 0;
353
306
  }
354
307
 
355
308
  @mixin reduced-motion {
356
- @media (prefers-reduced-motion: reduce) {
357
- @content;
358
- }
309
+ @media (prefers-reduced-motion: reduce) {
310
+ @content;
311
+ }
359
312
  }
360
313
 
361
- // The page-wide switch, not a slot: movement stops, fades stay, and anything
362
- // that moves changes at once. The reset includes it in place; the opt-in
363
- // `material/styles/base-lite` emits it on its own, because that sheet drops the
364
- // rest of the reset and the switch is not optional.
365
314
  @mixin global-reduced-motion {
366
- @media (prefers-reduced-motion: reduce) {
367
- html:focus-within {
368
- scroll-behavior: auto;
369
- }
370
-
371
- *,
372
- *::before,
373
- *::after {
374
- animation-duration: 0.01ms !important;
375
- animation-iteration-count: 1 !important;
376
- transition-property: opacity, color, background-color, border-color, outline-color, box-shadow, visibility !important;
377
- scroll-behavior: auto !important;
378
- }
379
- }
315
+ @media (prefers-reduced-motion: reduce) {
316
+ html:focus-within {
317
+ scroll-behavior: auto;
318
+ }
319
+
320
+ *,
321
+ *::before,
322
+ *::after {
323
+ animation-duration: 0.01ms !important;
324
+ animation-iteration-count: 1 !important;
325
+ transition-property: opacity, color, background-color, border-color, outline-color, box-shadow, visibility !important;
326
+ scroll-behavior: auto !important;
327
+ }
328
+ }
380
329
  }
381
330
 
382
331
  @mixin high-contrast {
383
- @media (forced-colors: active) {
384
- @content;
385
- }
386
- }
387
-
388
- // RTL Support
389
- //
390
- // Three forms, because the rule has to reach where it is written and resolve
391
- // the direction the way the element does: the NEAREST `[dir]`, as `:dir()`
392
- // carries it. An attribute selector cannot say "nearest" — `[dir='rtl'] &`
393
- // matches any right-to-left ancestor, so markup in a `dir="ltr"` subtree of an
394
- // RTL page mirrored by the page root. The roots the library manages carry the
395
- // direction they resolved as a class (src/core/dom/direction.ts):
396
- //
397
- // - `:where(.mtrl-rtl) &` for a factory's markup, which is light DOM: its root
398
- // carries the class, and the part is its descendant;
399
- // - `:where(:host(.mtrl-rtl)) &` for a part inside a shadow root, where no
400
- // ancestor is `[dir='rtl']` and `:host()` is the only way in; it matches
401
- // nothing in the light DOM, so it is inert there.
402
- //
403
- // `[dir='rtl'] &` stays for markup the runtime does not manage (hand-written
404
- // classes, server output before hydration). A root that resolved its nearest
405
- // direction left-to-right carries `mtrl-ltr`, and its subtree is cut from
406
- // every arm — the class arms and the attribute arm alike: a nearer boundary
407
- // wins whether the ancestor above it is marked by the runtime's class or by
408
- // `dir`. `:where()` keeps
409
- // the classes and the cut out of the specificity, as an attribute on an
410
- // ancestor was: the rule replaces the physical rule it mirrors, and a state
411
- // rule more specific than that physical rule still wins (a drawer's open
412
- // transform over its closed position). `:dir()` itself stays out of the sheet:
413
- // consumer bundlers lower it into `:lang()` lists that match no `dir`
414
- // (src/styles/components/_text-field.scss).
415
- // A component factory rendered inside a shadow root the app owns needs the
416
- // direction set in the app's own stylesheet, or the class on that root.
417
- // A rule inside the block adds to the part with a compound (`&.x`,
418
- // `&:hover`), never a suffix: a suffix (`&__x`) cannot follow the guard's
419
- // `:not()`. A rule whose subject is a BEM element or a variant class goes
420
- // through `rtl-selector` instead, which writes the subject out.
421
- //
422
- // `$self: true` for a value the include site sets on itself (a factory's root):
423
- // its reflected class or its own `dir` matches, the nearest boundary, uncut.
332
+ @media (forced-colors: active) {
333
+ @content;
334
+ }
335
+ }
336
+
424
337
  @mixin rtl($self: false) {
425
- $cut: ":not(:where(.#{base.$prefix}-ltr, .#{base.$prefix}-ltr *))";
426
- $arms: ":where(.#{base.$prefix}-rtl) &#{$cut}, :where(:host(.#{base.$prefix}-rtl)) &#{$cut}, [dir='rtl'] &#{$cut}";
427
- @if $self { $arms: "&:where(.#{base.$prefix}-rtl, [dir='rtl']), #{$arms}"; }
428
- #{$arms} { @content; }
338
+ $cut: ":not(:where(.#{base.$prefix}-ltr, .#{base.$prefix}-ltr *))";
339
+ $arms: ":where(.#{base.$prefix}-rtl) &#{$cut}, :where(:host(.#{base.$prefix}-rtl)) &#{$cut}, [dir='rtl'] &#{$cut}";
340
+ @if $self { $arms: "&:where(.#{base.$prefix}-rtl, [dir='rtl']), #{$arms}"; }
341
+ #{$arms} { @content; }
429
342
  }
430
343
 
431
- // The same three arms for a subject that is not the include site's selector
432
- // extended: a BEM element or a variant class, which a suffix on `&` would
433
- // replace the subject with and the guard sits on the wrong compound for.
434
- // `$subject` is the class at the call site (e.g. `".#{$component}__item"`).
435
- // The cut rides the subject on all three, as `rtl()` writes it.
436
344
  @mixin rtl-selector($subject) {
437
- $cut: ":not(:where(.#{base.$prefix}-ltr, .#{base.$prefix}-ltr *))";
438
- @at-root {
439
- :where(.#{base.$prefix}-rtl) #{$subject}#{$cut},
440
- :where(:host(.#{base.$prefix}-rtl)) #{$subject}#{$cut},
441
- [dir='rtl'] #{$subject}#{$cut} {
442
- @content;
443
- }
444
- }
345
+ $cut: ":not(:where(.#{base.$prefix}-ltr, .#{base.$prefix}-ltr *))";
346
+ @at-root {
347
+ :where(.#{base.$prefix}-rtl) #{$subject}#{$cut},
348
+ :where(:host(.#{base.$prefix}-rtl)) #{$subject}#{$cut},
349
+ [dir='rtl'] #{$subject}#{$cut} {
350
+ @content;
351
+ }
352
+ }
445
353
  }
446
354
 
447
355
  @mixin touch-target($size: 48px) {
448
- // Position first to avoid the deprecation warning
449
- position: relative;
450
-
451
- &::after {
452
- content: '';
453
- position: absolute;
454
- // Centred physically, as the icon button's own rule is. The
455
- // translate is physical, so the offsets must be: a logical inline-start
456
- // inset pinned the box's inline-start edge to the centre, and the translate
457
- // then moved the whole box a further 24px past it — a full box-width off
458
- // under RTL. Not `inset: 50%` either: over-constrained, and the offset CSS
459
- // drops under RTL leaves the same wrong physical edge anchored.
460
- top: 50%;
461
- left: 50%;
462
- width: $size;
463
- height: $size;
464
- transform: translate(-50%, -50%);
465
- }
466
-
467
- @media (prefers-reduced-motion: reduce) {
468
- @content;
469
- }
470
-
471
- @media (forced-colors: active) {
472
- @content;
473
- }
474
- }
475
-
476
- // Scrollbars
356
+ position: relative;
357
+
358
+ &::after {
359
+ content: '';
360
+ position: absolute;
361
+ top: 50%;
362
+ left: 50%;
363
+ width: $size;
364
+ height: $size;
365
+ transform: translate(-50%, -50%);
366
+ }
367
+
368
+ @media (prefers-reduced-motion: reduce) {
369
+ @content;
370
+ }
371
+
372
+ @media (forced-colors: active) {
373
+ @content;
374
+ }
375
+ }
376
+
477
377
  @mixin custom-scrollbar($config: ()) {
478
- $default-config: (
479
- width: 8px,
480
- track-color: transparent,
481
- thumb-color: rgba(0, 0, 0, 0.2),
482
- thumb-hover-color: rgba(0, 0, 0, 0.3)
483
- );
484
-
485
- $config: map.merge($default-config, $config);
486
-
487
- &::-webkit-scrollbar {
488
- width: map.get($config, width);
489
- }
490
-
491
- &::-webkit-scrollbar-track {
492
- background: map.get($config, track-color);
493
- }
494
-
495
- &::-webkit-scrollbar-thumb {
496
- background: map.get($config, thumb-color);
497
- border-radius: f.get-shape('full');
498
-
499
- &:hover {
500
- background: map.get($config, thumb-hover-color);
501
- }
502
- }
503
- }
504
-
505
-
506
- // Scrollbar mixin for consistent styling across components
378
+ $default-config: (
379
+ width: 8px,
380
+ track-color: transparent,
381
+ thumb-color: rgba(0, 0, 0, 0.2),
382
+ thumb-hover-color: rgba(0, 0, 0, 0.3)
383
+ );
384
+
385
+ $config: map.merge($default-config, $config);
386
+
387
+ &::-webkit-scrollbar {
388
+ width: map.get($config, width);
389
+ }
390
+
391
+ &::-webkit-scrollbar-track {
392
+ background: map.get($config, track-color);
393
+ }
394
+
395
+ &::-webkit-scrollbar-thumb {
396
+ background: map.get($config, thumb-color);
397
+ border-radius: f.get-shape('full');
398
+
399
+ &:hover {
400
+ background: map.get($config, thumb-hover-color);
401
+ }
402
+ }
403
+ }
404
+
405
+
507
406
  @mixin scrollbar(
508
- $width: 8px,
509
- $track-color: rgba(0, 0, 0, 0.05),
510
- $thumb-color: rgba(0, 0, 0, 0.2)
407
+ $width: 8px,
408
+ $track-color: rgba(0, 0, 0, 0.05),
409
+ $thumb-color: rgba(0, 0, 0, 0.2)
511
410
  ) {
512
- &::-webkit-scrollbar {
513
- width: $width;
514
- }
515
-
516
- &::-webkit-scrollbar-track {
517
- background: $track-color;
518
- }
519
-
520
- &::-webkit-scrollbar-thumb {
521
- background: $thumb-color;
522
- border-radius: math.div($width, 2);
523
- }
524
-
525
- // Firefox scrollbar (future compatibility)
526
- scrollbar-width: thin;
527
- scrollbar-color: $thumb-color $track-color;
528
- }
529
-
530
-
531
- // Flexbox layout mixins
411
+ &::-webkit-scrollbar {
412
+ width: $width;
413
+ }
414
+
415
+ &::-webkit-scrollbar-track {
416
+ background: $track-color;
417
+ }
418
+
419
+ &::-webkit-scrollbar-thumb {
420
+ background: $thumb-color;
421
+ border-radius: math.div($width, 2);
422
+ }
423
+
424
+ scrollbar-width: thin;
425
+ scrollbar-color: $thumb-color $track-color;
426
+ }
427
+
428
+
532
429
  @mixin flex-row($align: center, $justify: flex-start, $gap: 0) {
533
- display: flex;
534
- flex-direction: row;
535
- align-items: $align;
536
- justify-content: $justify;
537
- @if $gap > 0 {
538
- gap: $gap;
539
- }
430
+ display: flex;
431
+ flex-direction: row;
432
+ align-items: $align;
433
+ justify-content: $justify;
434
+ @if $gap > 0 {
435
+ gap: $gap;
436
+ }
540
437
  }
541
438
 
542
439
  @mixin flex-column($align: flex-start, $justify: flex-start, $gap: 0) {
543
- display: flex;
544
- flex-direction: column;
545
- align-items: $align;
546
- justify-content: $justify;
547
- @if $gap > 0 {
548
- gap: $gap;
549
- }
440
+ display: flex;
441
+ flex-direction: column;
442
+ align-items: $align;
443
+ justify-content: $justify;
444
+ @if $gap > 0 {
445
+ gap: $gap;
446
+ }
550
447
  }
551
448
 
552
- // Print
553
449
  @mixin print {
554
- @media print {
555
- @content;
556
- }
450
+ @media print {
451
+ @content;
452
+ }
557
453
  }