@shortfuse/materialdesignweb 0.3.0 → 0.4.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 (398) hide show
  1. package/.eslintrc.json +136 -30
  2. package/.stylelintrc.json +6 -40
  3. package/.vscode/launch.json +20 -5
  4. package/CHANGELOG.md +24 -0
  5. package/README.md +12 -9
  6. package/adapters/datatable/column.js +82 -74
  7. package/adapters/datatable/index.js +173 -131
  8. package/adapters/dom/index.js +529 -75
  9. package/adapters/list/index.js +25 -12
  10. package/adapters/search/index.js +13 -13
  11. package/components/appbar/_spec.scss +87 -64
  12. package/components/appbar/index.scss +2 -2
  13. package/components/banner/_spec.scss +8 -8
  14. package/components/banner/index.scss +2 -2
  15. package/components/bottomnav/_spec.scss +22 -17
  16. package/components/bottomnav/index.js +61 -52
  17. package/components/bottomnav/index.scss +2 -2
  18. package/components/bottomnav/item.js +44 -25
  19. package/components/button/README.md +14 -14
  20. package/components/button/_spec.scss +23 -22
  21. package/components/button/_theme.scss +37 -21
  22. package/components/button/index.eta +32 -0
  23. package/components/button/index.js +12 -12
  24. package/components/button/index.scss +2 -2
  25. package/components/card/_spec.scss +40 -36
  26. package/components/card/index.scss +2 -2
  27. package/components/chip/_spec.scss +7 -8
  28. package/components/chip/_theme.scss +31 -31
  29. package/components/chip/index.js +3 -2
  30. package/components/chip/index.scss +2 -2
  31. package/components/chip/item.js +1 -16
  32. package/components/datatable/_spec.scss +71 -85
  33. package/components/datatable/_theme.scss +61 -156
  34. package/components/datatable/cell.js +45 -0
  35. package/components/datatable/columnheader.js +47 -0
  36. package/components/datatable/index.js +279 -366
  37. package/components/datatable/index.scss +2 -2
  38. package/components/datatable/row.js +49 -0
  39. package/components/datatable/rowheader.js +18 -0
  40. package/components/dialog/_spec.scss +61 -41
  41. package/components/dialog/index.js +325 -297
  42. package/components/dialog/index.scss +2 -2
  43. package/components/divider/_spec.scss +8 -6
  44. package/components/divider/index.scss +2 -2
  45. package/components/elevation/_spec.scss +2 -2
  46. package/components/elevation/index.scss +2 -2
  47. package/components/fab/_spec.scss +23 -24
  48. package/components/fab/index.js +50 -50
  49. package/components/fab/index.scss +2 -2
  50. package/components/grid/_spec.scss +33 -31
  51. package/components/grid/index.scss +2 -2
  52. package/components/layout/_mixins.scss +5 -5
  53. package/components/layout/_spec.scss +206 -176
  54. package/components/layout/_theme.scss +14 -16
  55. package/components/layout/index.js +181 -153
  56. package/components/layout/index.scss +2 -2
  57. package/components/list/_spec.scss +117 -104
  58. package/components/list/_theme.scss +31 -34
  59. package/components/list/content.js +68 -52
  60. package/components/list/index.js +194 -61
  61. package/components/list/index.scss +2 -2
  62. package/components/list/item.js +136 -12
  63. package/components/list/secondary.js +46 -0
  64. package/components/menu/_spec.scss +32 -19
  65. package/components/menu/index.js +242 -229
  66. package/components/menu/index.scss +2 -2
  67. package/components/menu/item.js +95 -110
  68. package/components/progress/_spec.scss +35 -27
  69. package/components/progress/index.js +21 -0
  70. package/components/progress/index.scss +2 -1
  71. package/components/selection/_spec.scss +242 -224
  72. package/components/selection/_theme.scss +100 -95
  73. package/components/selection/index.eta +60 -0
  74. package/components/selection/index.js +76 -0
  75. package/components/selection/index.pug +15 -8
  76. package/components/selection/index.scss +2 -2
  77. package/components/selection/input.js +56 -0
  78. package/components/selection/radiogroup.js +47 -0
  79. package/components/slider/_spec.scss +10 -8
  80. package/components/slider/index.scss +2 -2
  81. package/components/snackbar/_spec.scss +22 -21
  82. package/components/snackbar/index.js +102 -111
  83. package/components/snackbar/index.scss +2 -2
  84. package/components/tab/_spec.scss +20 -19
  85. package/components/tab/content.js +41 -40
  86. package/components/tab/index.js +192 -99
  87. package/components/tab/index.scss +2 -2
  88. package/components/tab/item.js +38 -55
  89. package/components/tab/list.js +96 -72
  90. package/components/tab/panel.js +12 -13
  91. package/components/template/_theme.scss +11 -11
  92. package/components/textfield/_mixins.scss +52 -0
  93. package/components/textfield/_spec.scss +215 -266
  94. package/components/textfield/_theme.scss +95 -72
  95. package/components/textfield/index.eta +74 -0
  96. package/components/textfield/index.js +63 -57
  97. package/components/textfield/index.scss +2 -2
  98. package/components/tooltip/_spec.scss +27 -25
  99. package/components/tooltip/index.scss +2 -2
  100. package/components/type/_spec.scss +51 -38
  101. package/components/type/index.scss +2 -2
  102. package/core/_breakpoint.scss +75 -91
  103. package/core/_elevation.scss +10 -10
  104. package/core/_length.scss +9 -0
  105. package/core/_motion.scss +14 -14
  106. package/core/_platform.scss +9 -15
  107. package/core/_type.scss +33 -32
  108. package/core/aria/attributes.js +125 -25
  109. package/core/aria/button.js +23 -23
  110. package/core/aria/keyboard.js +93 -0
  111. package/core/aria/rovingtabindex.js +69 -154
  112. package/core/aria/tab.js +31 -28
  113. package/core/color/_theme.scss +240 -280
  114. package/core/color/index.scss +2 -2
  115. package/core/document/index.js +39 -0
  116. package/core/dom.js +12 -12
  117. package/core/overlay/_spec.scss +0 -3
  118. package/core/overlay/_theme.scss +56 -74
  119. package/core/overlay/index.js +49 -18
  120. package/core/overlay/index.scss +2 -2
  121. package/core/ripple/_spec.scss +22 -39
  122. package/core/ripple/_theme.scss +13 -13
  123. package/core/ripple/index.js +137 -134
  124. package/core/ripple/index.scss +2 -2
  125. package/core/theme/_config.scss +2 -0
  126. package/core/theme/_mixins.scss +172 -0
  127. package/core/theme/_palettes.scss +155 -135
  128. package/core/theme/_variables.scss +24 -15
  129. package/core/theme/index.js +50 -0
  130. package/core/throttler.js +1 -1
  131. package/core/transition/index.js +36 -20
  132. package/{docs-src → docs}/_flex.scss +0 -0
  133. package/{docs-src → docs}/_menuoptions.js +21 -34
  134. package/{docs-src → docs}/_mixins.pug +39 -26
  135. package/docs/_partials/_androidnavbar.eta +5 -0
  136. package/docs/_partials/_androidstatusbar.eta +13 -0
  137. package/docs/_partials/_appbar.eta +29 -0
  138. package/docs/_partials/_buttontest.eta +31 -0
  139. package/docs/_partials/_header.eta +149 -0
  140. package/docs/_partials/_navlistitem.eta +16 -0
  141. package/docs/_partials/_target.eta +1 -0
  142. package/{docs-src → docs}/_sample-utils.js +8 -6
  143. package/{docs-src → docs}/_storage.js +0 -0
  144. package/{docs-src → docs}/docs.scss +5 -2
  145. package/docs/index.eta +16 -0
  146. package/{docs-src → docs}/index.js +0 -0
  147. package/docs/pages/appbar.eta +114 -0
  148. package/{docs-src/components → docs/pages}/appbar.js +0 -0
  149. package/{docs-src/components → docs/pages}/appbar.pug +15 -18
  150. package/docs/pages/bottomnav.eta +188 -0
  151. package/{docs-src/components → docs/pages}/bottomnav.js +23 -24
  152. package/{docs-src/components → docs/pages}/bottomnav.pug +4 -4
  153. package/docs/pages/button.eta +124 -0
  154. package/{docs-src/components → docs/pages}/button.js +19 -19
  155. package/{docs-src/components → docs/pages}/button.pug +15 -15
  156. package/docs/pages/card.eta +90 -0
  157. package/{docs-src/components → docs/pages}/card.js +3 -3
  158. package/{docs-src/components → docs/pages}/card.pug +7 -7
  159. package/docs/pages/chip.eta +122 -0
  160. package/{docs-src/components → docs/pages}/chip.js +3 -6
  161. package/{docs-src/components → docs/pages}/chip.pug +2 -2
  162. package/docs/pages/color.eta +143 -0
  163. package/{docs-src/core → docs/pages}/color.js +95 -20
  164. package/docs/pages/color.pug +121 -0
  165. package/docs/pages/datatable.eta +323 -0
  166. package/{docs-src/components → docs/pages}/datatable.js +26 -13
  167. package/docs/pages/datatable.pug +283 -0
  168. package/docs/pages/dialog.eta +186 -0
  169. package/{docs-src/components → docs/pages}/dialog.js +26 -13
  170. package/{docs-src/components → docs/pages}/dialog.pug +46 -28
  171. package/docs/pages/dom.eta +26 -0
  172. package/docs/pages/dom.js +143 -0
  173. package/docs/pages/dom.pug +22 -0
  174. package/docs/pages/elevation.eta +35 -0
  175. package/{docs-src/components → docs/pages}/elevation.js +0 -0
  176. package/{docs-src/components → docs/pages}/elevation.pug +0 -0
  177. package/docs/pages/fab.eta +99 -0
  178. package/{docs-src/components → docs/pages}/fab.js +3 -3
  179. package/{docs-src/components → docs/pages}/fab.pug +2 -2
  180. package/docs/pages/grid.eta +135 -0
  181. package/{docs-src/components → docs/pages}/grid.js +1 -1
  182. package/{docs-src/components → docs/pages}/grid.pug +3 -3
  183. package/docs/pages/layout.eta +8 -0
  184. package/{docs-src/components → docs/pages}/layout.js +0 -0
  185. package/{docs-src/components → docs/pages}/layout.pug +0 -0
  186. package/docs/pages/list.eta +465 -0
  187. package/{docs-src/components → docs/pages}/list.js +2 -2
  188. package/{docs-src/components → docs/pages}/list.pug +7 -14
  189. package/docs/pages/menu.eta +276 -0
  190. package/{docs-src/components → docs/pages}/menu.js +14 -10
  191. package/{docs-src/components → docs/pages}/menu.pug +0 -0
  192. package/docs/pages/overlay.eta +69 -0
  193. package/docs/pages/overlay.js +4 -0
  194. package/{docs-src/core → docs/pages}/overlay.pug +14 -11
  195. package/docs/pages/progress.eta +23 -0
  196. package/{docs-src/components → docs/pages}/progress.js +1 -1
  197. package/{docs-src/components → docs/pages}/progress.pug +1 -1
  198. package/docs/pages/ripple.eta +27 -0
  199. package/docs/pages/ripple.js +4 -0
  200. package/{docs-src/core → docs/pages}/ripple.pug +4 -4
  201. package/docs/pages/search.eta +246 -0
  202. package/{docs-src/components → docs/pages}/search.js +59 -42
  203. package/{docs-src/components → docs/pages}/search.pug +50 -51
  204. package/docs/pages/selection.eta +111 -0
  205. package/docs/pages/selection.js +13 -0
  206. package/docs/pages/selection.pug +74 -0
  207. package/docs/pages/slider.eta +23 -0
  208. package/{docs-src/components → docs/pages}/slider.js +0 -0
  209. package/{docs-src/components → docs/pages}/slider.pug +0 -0
  210. package/docs/pages/snackbar.eta +83 -0
  211. package/{docs-src/components → docs/pages}/snackbar.js +3 -3
  212. package/{docs-src/components → docs/pages}/snackbar.pug +0 -0
  213. package/docs/pages/tab.eta +421 -0
  214. package/{docs-src/components → docs/pages}/tab.js +18 -35
  215. package/{docs-src/components → docs/pages}/tab.pug +4 -4
  216. package/docs/pages/textfield.eta +486 -0
  217. package/{docs-src/components → docs/pages}/textfield.js +3 -4
  218. package/{docs-src/components → docs/pages}/textfield.pug +87 -35
  219. package/docs/pages/tooltip.eta +94 -0
  220. package/{docs-src/components → docs/pages}/tooltip.js +0 -0
  221. package/{docs-src/components → docs/pages}/tooltip.pug +0 -1
  222. package/docs/pages/transition.eta +117 -0
  223. package/{docs-src/core → docs/pages}/transition.js +7 -8
  224. package/{docs-src/core → docs/pages}/transition.pug +0 -0
  225. package/docs/pages/type.eta +31 -0
  226. package/{docs-src/components → docs/pages}/type.js +0 -0
  227. package/{docs-src/components → docs/pages}/type.pug +0 -1
  228. package/docs/postrender.js +39 -0
  229. package/{docs-src → docs}/prerender.js +3 -9
  230. package/docs/pwa/_dialogs.eta +143 -0
  231. package/docs/pwa/_dialogs.pug +96 -0
  232. package/docs/pwa/_menus.eta +16 -0
  233. package/{docs-src → docs}/pwa/_menus.pug +0 -0
  234. package/docs/pwa/pwa-prerender.js +3 -0
  235. package/docs/pwa/pwa.eta +480 -0
  236. package/docs/pwa/pwa.js +306 -0
  237. package/{docs-src → docs}/pwa/pwa.pug +166 -263
  238. package/docs/pwa/pwa.scss +26 -0
  239. package/docs/spec.scss +26 -0
  240. package/docs/themes/_component-themes.scss +26 -0
  241. package/docs/themes/theme-colored-fallbacks.scss +17 -0
  242. package/docs/themes/theme-colored.scss +17 -0
  243. package/docs/themes/theme-default-fallbacks.scss +17 -0
  244. package/docs/themes/theme-default.scss +17 -0
  245. package/jsconfig.json +4 -2
  246. package/package.json +40 -27
  247. package/scripts/deploy-docs.sh +9 -0
  248. package/templates/index.eta +2 -0
  249. package/utils/function.js +3 -0
  250. package/webpack.config.cjs +257 -0
  251. package/_spec.scss +0 -27
  252. package/_theme.scss +0 -27
  253. package/components/list/expander.js +0 -142
  254. package/components/list/itemgroup.js +0 -22
  255. package/core/theme/_builder.scss +0 -116
  256. package/core/theme/index.scss +0 -68
  257. package/docs/appbar.html +0 -1
  258. package/docs/appbar.min.js +0 -2
  259. package/docs/appbar.min.js.map +0 -1
  260. package/docs/bottomnav.html +0 -1
  261. package/docs/bottomnav.min.js +0 -2
  262. package/docs/bottomnav.min.js.map +0 -1
  263. package/docs/button.html +0 -1
  264. package/docs/button.min.js +0 -2
  265. package/docs/button.min.js.map +0 -1
  266. package/docs/card.html +0 -1
  267. package/docs/card.min.js +0 -2
  268. package/docs/card.min.js.map +0 -1
  269. package/docs/chip.html +0 -1
  270. package/docs/chip.min.js +0 -2
  271. package/docs/chip.min.js.map +0 -1
  272. package/docs/color.html +0 -1
  273. package/docs/color.min.js +0 -2
  274. package/docs/color.min.js.map +0 -1
  275. package/docs/datatable.html +0 -1
  276. package/docs/datatable.min.js +0 -2
  277. package/docs/datatable.min.js.map +0 -1
  278. package/docs/default.common.min.js +0 -2
  279. package/docs/default.common.min.js.map +0 -1
  280. package/docs/dialog.html +0 -1
  281. package/docs/dialog.min.js +0 -2
  282. package/docs/dialog.min.js.map +0 -1
  283. package/docs/docs.min.css +0 -1
  284. package/docs/docs.min.js +0 -2
  285. package/docs/docs.min.js.map +0 -1
  286. package/docs/elevation.html +0 -1
  287. package/docs/elevation.min.js +0 -2
  288. package/docs/elevation.min.js.map +0 -1
  289. package/docs/fab.html +0 -1
  290. package/docs/fab.min.js +0 -2
  291. package/docs/fab.min.js.map +0 -1
  292. package/docs/grid.html +0 -1
  293. package/docs/grid.min.js +0 -2
  294. package/docs/grid.min.js.map +0 -1
  295. package/docs/index.html +0 -1
  296. package/docs/index.min.js +0 -2
  297. package/docs/index.min.js.map +0 -1
  298. package/docs/ink.html +0 -1
  299. package/docs/ink.min.js +0 -2
  300. package/docs/ink.min.js.map +0 -1
  301. package/docs/layout.html +0 -1
  302. package/docs/layout.min.js +0 -2
  303. package/docs/layout.min.js.map +0 -1
  304. package/docs/list.html +0 -1
  305. package/docs/list.min.js +0 -2
  306. package/docs/list.min.js.map +0 -1
  307. package/docs/menu.html +0 -1
  308. package/docs/menu.min.js +0 -2
  309. package/docs/menu.min.js.map +0 -1
  310. package/docs/overlay.html +0 -1
  311. package/docs/overlay.min.js +0 -2
  312. package/docs/overlay.min.js.map +0 -1
  313. package/docs/prerender.common.min.js +0 -2
  314. package/docs/prerender.common.min.js.map +0 -1
  315. package/docs/prerender.min.js +0 -2
  316. package/docs/prerender.min.js.map +0 -1
  317. package/docs/progress.html +0 -1
  318. package/docs/progress.min.js +0 -2
  319. package/docs/progress.min.js.map +0 -1
  320. package/docs/pwa-prerender.min.js +0 -2
  321. package/docs/pwa-prerender.min.js.map +0 -1
  322. package/docs/pwa.html +0 -11
  323. package/docs/pwa.min.css +0 -1
  324. package/docs/pwa.min.js +0 -2
  325. package/docs/pwa.min.js.map +0 -1
  326. package/docs/ripple.html +0 -1
  327. package/docs/ripple.min.js +0 -2
  328. package/docs/ripple.min.js.map +0 -1
  329. package/docs/search.html +0 -1
  330. package/docs/search.min.js +0 -2
  331. package/docs/search.min.js.map +0 -1
  332. package/docs/selection.html +0 -1
  333. package/docs/selection.min.js +0 -2
  334. package/docs/selection.min.js.map +0 -1
  335. package/docs/slider.html +0 -1
  336. package/docs/slider.min.js +0 -2
  337. package/docs/slider.min.js.map +0 -1
  338. package/docs/snackbar.html +0 -1
  339. package/docs/snackbar.min.js +0 -2
  340. package/docs/snackbar.min.js.map +0 -1
  341. package/docs/spec.min.css +0 -1
  342. package/docs/spec.min.js +0 -2
  343. package/docs/spec.min.js.map +0 -1
  344. package/docs/surface.html +0 -1
  345. package/docs/surface.min.js +0 -2
  346. package/docs/surface.min.js.map +0 -1
  347. package/docs/tab.html +0 -1
  348. package/docs/tab.min.js +0 -2
  349. package/docs/tab.min.js.map +0 -1
  350. package/docs/textfield.html +0 -2
  351. package/docs/textfield.min.js +0 -2
  352. package/docs/textfield.min.js.map +0 -1
  353. package/docs/theme-colored-fallbacks.min.css +0 -1
  354. package/docs/theme-colored-fallbacks.min.js +0 -2
  355. package/docs/theme-colored-fallbacks.min.js.map +0 -1
  356. package/docs/theme-colored.min.css +0 -1
  357. package/docs/theme-colored.min.js +0 -2
  358. package/docs/theme-colored.min.js.map +0 -1
  359. package/docs/theme-default-fallbacks.min.css +0 -1
  360. package/docs/theme-default-fallbacks.min.js +0 -2
  361. package/docs/theme-default-fallbacks.min.js.map +0 -1
  362. package/docs/theme-default.min.css +0 -1
  363. package/docs/theme-default.min.js +0 -2
  364. package/docs/theme-default.min.js.map +0 -1
  365. package/docs/themes-fallbacks.min.css +0 -1
  366. package/docs/themes-fallbacks.min.js +0 -2
  367. package/docs/themes-fallbacks.min.js.map +0 -1
  368. package/docs/themes.min.css +0 -1
  369. package/docs/themes.min.js +0 -2
  370. package/docs/themes.min.js.map +0 -1
  371. package/docs/tooltip.html +0 -1
  372. package/docs/tooltip.min.js +0 -2
  373. package/docs/tooltip.min.js.map +0 -1
  374. package/docs/transition.html +0 -1
  375. package/docs/transition.min.js +0 -2
  376. package/docs/transition.min.js.map +0 -1
  377. package/docs/type.html +0 -1
  378. package/docs/type.min.js +0 -2
  379. package/docs/type.min.js.map +0 -1
  380. package/docs-src/components/datatable.pug +0 -327
  381. package/docs-src/components/selection.js +0 -9
  382. package/docs-src/components/selection.pug +0 -77
  383. package/docs-src/core/color.pug +0 -201
  384. package/docs-src/core/overlay.js +0 -4
  385. package/docs-src/core/ripple.js +0 -4
  386. package/docs-src/index.pug +0 -9
  387. package/docs-src/pwa/_dialogs.pug +0 -15
  388. package/docs-src/pwa/pwa-prerender.js +0 -3
  389. package/docs-src/pwa/pwa.js +0 -182
  390. package/docs-src/pwa/pwa.scss +0 -25
  391. package/docs-src/spec.scss +0 -1
  392. package/docs-src/themes/theme-colored-fallbacks.scss +0 -14
  393. package/docs-src/themes/theme-colored.scss +0 -14
  394. package/docs-src/themes/theme-default-fallbacks.scss +0 -14
  395. package/docs-src/themes/theme-default.scss +0 -14
  396. package/index.js +0 -51
  397. package/index.scss +0 -2
  398. package/webpack.config.js +0 -187
@@ -1,212 +1,219 @@
1
1
  // https://material.io/design/interaction/states.html
2
2
 
3
- @import '../theme/index.scss';
4
-
5
- $mdw-color__theme-values: (
6
- default-ink: (('foreground-light', 0.87), ('foreground-dark', 1.00)),
7
-
8
- high-ink-opacity: (0.87, 1.00),
9
- medium-ink-opacity: (0.60, 0.70),
10
- inactive-ink-opacity: (0.38, 0.50),
11
- divider-ink-opacity: (0.12, 0.24),
12
-
13
- primary-ink: (('primary', 'A700', 1.00), ('primary', 'A200', 1.00)),
14
- secondary-ink: (('secondary', 'A700', 1.00), ('secondary', 'A200', 1.00)),
15
- warn-ink: (('warn', 'A700', 1.00), ('warn', 'A200', 1.00)),
16
- primary-contrast-ink: (('primary', 'A700', 1.00), ('primary', 'A100', 1.00)),
17
- secondary-contrast-ink: (('secondary', 'A700', 1.00), ('secondary', 'A100', 1.00)),
18
- warn-contrast-ink: (('warn', 'A700', 1.00), ('warn', 'A100', 1.00)),
19
- primary-light-ink: (('primary', 'A400', 1.00), ('primary', 'A100', 1.00)),
20
- secondary-light-ink: (('secondary', 'A400', 1.00), ('secondary', 'A100', 1.00)),
21
- warn-light-ink: (('warn', 'A400', 1.00), ('warn', 'A100', 1.00)),
22
-
23
- card-surface: ((#fff, 1.00), ('background', '800', 1.00)),
24
- binary-surface: ((#fff, 1.00), (#000, 1.00)),
25
- background-surface: (('background', '50', 1.00), ('background', '900', 1.00)),
26
- primary-surface: (('primary', '50', 1.00), ('primary', '900', 1.00)),
27
- secondary-surface: (('secondary', '50', 1.00), ('secondary', '900', 1.00)),
28
- warn-surface: (('warn', '50', 1.00), ('warn', '900', 1.00)),
29
-
30
- background-alt-surface: (('background', '100', 1.00), ('background', '800', 1.00)),
31
- primary-alt-surface: (('primary', '100', 1.00), ('primary', '800', 1.00)),
32
- secondary-alt-surface: (('secondary', '100', 1.00), ('secondary', '800', 1.00)),
33
- warn-alt-surface: (('warn', '100', 1.00), ('warn', '800', 1.00)),
3
+ @use '../theme/_mixins.scss' as theme;
4
+ @use "../_platform.scss" as platform;
5
+
6
+ @function _resortColors($list) {
7
+ $newList: ();
8
+ @each $color in $list {
9
+ @if (index($newList, $color) == null) {
10
+ $newList: append($newList, $color);
11
+ $palette: theme.getThemeParamValue($color);
12
+ @each $color2 in $list {
13
+ @if (index($newList, $color2) == null) {
14
+ $palette2: theme.getThemeParamValue($color2);
15
+ @if ($palette == $palette2) {
16
+ $newList: append($newList, $color2);
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ @return $newList;
23
+ }
24
+
25
+ // Resort colors with aliases for CSS rule merging
26
+ $sortedInks: _resortColors(theme.$inks);
27
+ $sortedSurfaces: _resortColors(theme.$surfaces);
28
+
29
+ $themeValues: (
30
+ default-ink: theme.$foreground,
31
+
32
+ high-ink-opacity: theme.$high-opacity,
33
+ medium-ink-opacity: theme.$medium-opacity,
34
+ inactive-ink-opacity: theme.$inactive-opacity,
35
+ divider-ink-opacity: theme.$divider-opacity,
36
+
37
+ card-surface: ((#fff, null), (#121212, null)),
38
+ binary-surface: ((#fff, null), (#000, null)),
34
39
  ) !default;
35
40
 
36
- @function mdwColorThemeValue($key, $type) {
37
- @return mdwGetThemeValue('color', $mdw-color__theme-values, $key, $type);
41
+ @each $color in $sortedInks {
42
+ $newInkMap: (
43
+ #{$color}-default-ink: (($color, nth(theme.$default-color-ink, 1),null), ($color, nth(theme.$default-color-ink, 2), null)),
44
+ #{$color}-contrast-ink: (($color, nth(theme.$contrast-color-ink, 1),null), ($color, nth(theme.$contrast-color-ink, 2), null)),
45
+ #{$color}-light-ink: (($color, nth(theme.$light-color-ink, 1),null), ($color, nth(theme.$light-color-ink, 2), null)),
46
+ );
47
+ $themeValues: map-merge($themeValues, $newInkMap);
38
48
  }
39
49
 
40
- @mixin mdw-color__theme-rules($type: 'var') {
50
+ @each $color in $sortedSurfaces {
51
+ $newSurfaceMap: (
52
+ #{$color}-default-surface: (($color, nth(theme.$default-color-surface, 1),null), ($color, nth(theme.$default-color-surface, 2), null)),
53
+ #{$color}-alt-surface: (($color, nth(theme.$alt-color-surface, 1),null), ($color, nth(theme.$alt-color-surface, 2), null)),
54
+ );
55
+ $themeValues: map-merge($themeValues, $newSurfaceMap);
56
+ }
57
+
58
+ @function getThemeValue($key, $type) {
59
+ @return theme.getThemeValue('color', $themeValues, $key, $type);
60
+ }
61
+
62
+ @mixin addThemeRules($type: 'var') {
41
63
  @if ($type == 'var') {
42
64
  .mdw-theme {
43
- &[mdw-surface] {
44
- background-color: RGB(var(--surface-color));
45
- }
46
-
47
- &svg[mdw-surface] {
48
- background-color: transparent;
65
+ /** Surface Colors **/
49
66
 
50
- fill: RGBA(var(--surface-color));
67
+ &[mdw-surface] {
68
+ background-color: RGB(var(--mdw-surface));
51
69
  }
70
+ }
52
71
 
53
- @each $color in ('primary', 'secondary', 'warn', 'background') {
54
- &[mdw-surface~="#{$color}"] {
55
- @each $tone in $mdw-theme__tone-list {
56
- --#{$tone}-surface: var(--#{$color}-#{$tone}-color);
57
- }
58
- }
59
-
60
- &[mdw-ink~="#{$color}"] {
61
- @each $tone in $mdw-theme__tone-list {
62
- --#{$tone}-color: var(--#{$color}-#{$tone}-color);
63
- }
64
- }
65
- }
72
+ svg.mdw-theme[mdw-surface] {
73
+ background-color: transparent;
66
74
 
67
- &[mdw-ink] {
68
- --ink-color: #{mdwColorThemeValue("default-ink", $type)};
69
- --ink-opacity: #{mdwColorThemeValue("high-ink-opacity", $type)};
70
- color: RGBA(var(--ink-color),var(--ink-opacity));
71
- }
75
+ fill: RGB(var(--mdw-surface));
76
+ }
72
77
 
78
+ .mdw-theme {
73
79
  &[mdw-surface]:not([mdw-ink]) {
74
- --ink-color: #{mdwColorThemeValue("default-ink", $type)};
75
- --ink-opacity: #{mdwColorThemeValue("high-ink-opacity", $type)};
76
- color: RGBA(var(--ink-color),var(--ink-opacity));
80
+ --mdw-ink: #{getThemeValue("default-ink", $type)};
81
+ --mdw-ink-opacity: #{getThemeValue("high-ink-opacity", $type)};
82
+ color: RGBA(var(--mdw-ink),var(--mdw-ink-opacity));
77
83
  }
78
84
 
79
85
  &[mdw-surface="white"] {
80
- --surface-color: 255,255,255;
86
+ --mdw-surface: 255,255,255;
81
87
  }
82
88
 
83
89
  &[mdw-surface="black"] {
84
- --surface-color: 0,0,0;
90
+ --mdw-surface: 0,0,0;
85
91
  }
86
92
 
87
93
  &[mdw-surface="binary"] {
88
- --surface-color: #{mdwColorThemeValue("binary-surface", $type)};
94
+ --mdw-surface: #{getThemeValue("binary-surface", $type)};
89
95
  }
90
96
 
91
97
  &[mdw-surface="card"] {
92
- --surface-color: #{mdwColorThemeValue("card-surface", $type)};
93
- }
94
-
95
- &[mdw-surface="background"] {
96
- --surface-color: #{mdwColorThemeValue("background-surface", $type)};
97
- }
98
-
99
- &[mdw-surface="primary"] {
100
- --surface-color: #{mdwColorThemeValue("primary-surface", $type)};
101
- }
102
-
103
- &[mdw-surface="secondary"] {
104
- --surface-color: #{mdwColorThemeValue("secondary-surface", $type)};
98
+ --mdw-surface: #{getThemeValue("card-surface", $type)};
105
99
  }
106
-
107
- &[mdw-surface="warn"] {
108
- --surface-color: #{mdwColorThemeValue("warn-surface", $type)};
100
+
101
+ @each $surface in $sortedSurfaces {
102
+ &[mdw-surface~="#{$surface}"] {
103
+ --mdw-surface: #{getThemeValue("#{$surface}-default-surface", $type)};
104
+ }
109
105
  }
110
106
 
111
- &[mdw-surface="background alt"] {
112
- --surface-color: #{mdwColorThemeValue("background-alt-surface", $type)};
107
+ @each $surface in $sortedSurfaces {
108
+ &[mdw-surface~="#{$surface}"] {
109
+ $palette: theme.getThemeParamValue($surface);
110
+ @each $tone in theme.$surface-tones {
111
+ $value: map-get($palette, $tone);
112
+ --#{$tone}-surface: #{red($value),green($value),blue($value)};
113
+ }
114
+ }
113
115
  }
114
-
115
- &[mdw-surface="primary alt"] {
116
- --surface-color: #{mdwColorThemeValue("primary-alt-surface", $type)};
116
+
117
+ @each $surface in $sortedSurfaces {
118
+ &[mdw-surface="#{$surface} alt"] {
119
+ --mdw-surface: #{getThemeValue("#{$surface}-alt-surface", $type)};
120
+ }
117
121
  }
118
-
119
- &[mdw-surface="secondary alt"] {
120
- --surface-color: #{mdwColorThemeValue("secondary-alt-surface", $type)};
122
+
123
+ @each $tone in theme.$surface-tones {
124
+ &[mdw-surface~="#{$tone}"] {
125
+ --mdw-surface: var(--#{$tone}-surface);
126
+ }
121
127
  }
122
-
123
- &[mdw-surface="warn alt"] {
124
- --surface-color: #{mdwColorThemeValue("warn-alt-surface", $type)};
128
+
129
+ /** Ink Color **/
130
+
131
+ &[mdw-ink] {
132
+ --mdw-ink: #{getThemeValue("default-ink", $type)};
133
+ --mdw-ink-opacity: 1;
134
+ color: RGBA(var(--mdw-ink),var(--mdw-ink-opacity));
125
135
  }
126
-
136
+
137
+ &[mdw-ink=""],
138
+ &[mdw-ink~="default"] {
139
+ --mdw-ink: #{getThemeValue("default-ink", $type)};
140
+ --mdw-ink-opacity: #{getThemeValue("high-ink-opacity", $type)};
141
+ }
142
+
127
143
  &[mdw-ink~="white"] {
128
- --ink-color: 255,255,255;
144
+ --mdw-ink: 255,255,255;
129
145
  }
130
146
 
131
147
  &[mdw-ink~="black"] {
132
- --ink-color: 0,0,0;
148
+ --mdw-ink: 0,0,0;
133
149
  }
134
150
 
135
- &[mdw-ink~="default"] {
136
- --ink-color: #{mdwColorThemeValue("default-ink", $type)};
151
+ @each $ink in $sortedInks {
152
+ &[mdw-ink~="#{$ink}"] {
153
+ --mdw-ink: #{getThemeValue("#{$ink}-default-ink", $type)};
154
+ }
137
155
  }
138
156
 
139
- &[mdw-ink~="primary"] {
140
- --ink-opacity: 1;
141
- --ink-color: #{mdwColorThemeValue("primary-ink", $type)};
142
- }
143
-
144
- &[mdw-ink~="secondary"] {
145
- --ink-opacity: 1;
146
- --ink-color: #{mdwColorThemeValue("secondary-ink", $type)};
157
+ @each $ink in $sortedInks {
158
+ &[mdw-ink~="#{$ink}"] {
159
+ $palette: theme.getThemeParamValue($ink);
160
+ @each $tone in theme.$ink-tones {
161
+ $value: map-get($palette, $tone);
162
+ --mdw-ink-#{$tone}: #{red($value),green($value),blue($value)};
163
+ }
164
+ }
147
165
  }
148
-
149
- &[mdw-ink~="warn"] {
150
- --ink-opacity: 1;
151
- --ink-color: #{mdwColorThemeValue("warn-ink", $type)};
166
+
167
+ @each $ink in $sortedInks {
168
+ &[mdw-ink^="#{$ink} contrast"] {
169
+ --mdw-ink: #{getThemeValue("#{$ink}-contrast-ink", $type)};
170
+ }
152
171
  }
153
172
 
154
- @each $tone in $mdw-theme__tone-list {
155
- &[mdw-surface~="#{$tone}"] {
156
- --surface-color: var(--#{$tone}-surface);
173
+ @each $ink in $sortedInks {
174
+ @if ($ink != 'background') {
175
+ &[mdw-ink^="#{$ink} light"] {
176
+ --mdw-ink: #{getThemeValue("#{$ink}-light-ink", $type)};
177
+ }
157
178
  }
158
-
179
+ }
180
+
181
+ @each $tone in theme.$ink-tones {
159
182
  &[mdw-ink~="#{$tone}"] {
160
- --ink-color: var(--#{$tone}-color);
183
+ --mdw-ink: var(--mdw-ink-#{$tone});
161
184
  }
162
185
  }
163
186
 
164
- &[mdw-ink^="primary contrast"] {
165
- --ink-color: #{mdwColorThemeValue("primary-contrast-ink", $type)};
166
- }
167
-
168
- &[mdw-ink^="secondary contrast"] {
169
- --ink-color: #{mdwColorThemeValue("secondary-contrast-ink", $type)};
170
- }
171
-
172
- &[mdw-ink^="warn contrast"] {
173
- --ink-color: #{mdwColorThemeValue("warn-contrast-ink", $type)};
174
- }
187
+ /** Ink Opacity **/
175
188
 
176
- &[mdw-ink^="primary light"] {
177
- --ink-color: #{mdwColorThemeValue("primary-light-ink", $type)};
189
+ &[mdw-ink~="solid"] {
190
+ --mdw-ink-opacity: 1;
178
191
  }
179
-
180
- &[mdw-ink^="secondary light"] {
181
- --ink-color: #{mdwColorThemeValue("secondary-light-ink", $type)};
182
- }
183
-
184
- &[mdw-ink^="warn light"] {
185
- --ink-color: #{mdwColorThemeValue("warn-light-ink", $type)};
186
- }
187
-
192
+
188
193
  &[mdw-ink~="high"] {
189
- --ink-opacity: #{mdwColorThemeValue("high-ink-opacity", $type)};
194
+ --mdw-ink-opacity: #{getThemeValue("high-ink-opacity", $type)};
190
195
  }
191
196
 
192
197
  &[mdw-ink~="medium"] {
193
- --ink-opacity: #{mdwColorThemeValue("medium-ink-opacity", $type)};
198
+ --mdw-ink-opacity: #{getThemeValue("medium-ink-opacity", $type)};
194
199
  }
195
200
 
196
201
  &[mdw-ink~="inactive"] {
197
- --ink-opacity: #{mdwColorThemeValue("inactive-ink-opacity", $type)};
202
+ --mdw-ink-opacity: #{getThemeValue("inactive-ink-opacity", $type)};
198
203
  }
199
204
 
200
205
  &[mdw-ink~="divider"] {
201
- --ink-opacity: #{mdwColorThemeValue("divider-ink-opacity", $type)};
206
+ --mdw-ink-opacity: #{getThemeValue("divider-ink-opacity", $type)};
202
207
  }
203
208
 
209
+ /** Border Ink **/
210
+
204
211
  &[mdw-border-ink] {
205
- border-color: #{RGBA(var(--ink-color), mdwColorThemeValue("divider-ink-opacity", $type))};
212
+ border-color: #{RGBA(var(--mdw-ink), getThemeValue("divider-ink-opacity", $type))};
206
213
  }
207
214
 
208
215
  &[mdw-border-ink="default"] {
209
- border-color: #{RGBA(mdwColorThemeValue("default-ink", $type), mdwColorThemeValue("divider-ink-opacity", $type))};
216
+ border-color: #{RGBA(getThemeValue("default-ink", $type), getThemeValue("divider-ink-opacity", $type))};
210
217
  }
211
218
 
212
219
  &[mdw-border-ink="none"] {
@@ -217,104 +224,79 @@ $mdw-color__theme-values: (
217
224
  & {
218
225
  &[mdw-ink="default"],
219
226
  &[mdw-surface]:not([mdw-ink]) {
220
- color: rgba(mdwColorThemeValue("default-ink", $type),mdwColorThemeValue("high-ink-opacity", $type));
227
+ color: RGBA(getThemeValue("default-ink", $type),getThemeValue("high-ink-opacity", $type));
221
228
  }
222
229
 
223
230
  &[mdw-surface="binary"] {
224
- background-color: #{mdwColorThemeValue("binary-surface", $type)};
231
+ background-color: RGB(getThemeValue("binary-surface", $type));
225
232
  }
226
233
 
227
234
  &[mdw-surface="card"] {
228
- background-color: #{mdwColorThemeValue("card-surface", $type)};
229
- }
230
-
231
- &[mdw-surface="background"] {
232
- background-color: #{mdwColorThemeValue("background-surface", $type)};
233
- }
234
-
235
- &[mdw-surface="primary"] {
236
- background-color: #{mdwColorThemeValue("primary-surface", $type)};
237
- }
238
-
239
- &[mdw-surface="secondary"] {
240
- background-color: #{mdwColorThemeValue("secondary-surface", $type)};
241
- }
242
-
243
- &[mdw-surface="warn"] {
244
- background-color: #{mdwColorThemeValue("warn-surface", $type)};
245
- }
246
-
247
- &[mdw-surface="background alt"] {
248
- background-color: #{mdwColorThemeValue("background-alt-surface", $type)};
249
- }
250
-
251
- &[mdw-surface="primary alt"] {
252
- background-color: #{mdwColorThemeValue("primary-alt-surface", $type)};
253
- }
254
-
255
- &[mdw-surface="secondary alt"] {
256
- background-color: #{mdwColorThemeValue("secondary-alt-surface", $type)};
257
- }
258
-
259
- &[mdw-surface="warn alt"] {
260
- background-color: #{mdwColorThemeValue("warn-alt-surface", $type)};
235
+ background-color: RGB(getThemeValue("card-surface", $type));
261
236
  }
262
237
 
263
- &[mdw-ink~="primary"] {
264
- color: #{mdwColorThemeValue("primary-ink", $type)};
265
- }
266
-
267
- &[mdw-ink~="secondary"] {
268
- color: #{mdwColorThemeValue("secondary-ink", $type)};
269
- }
270
-
271
- &[mdw-ink~="warn"] {
272
- color: #{mdwColorThemeValue("warn-ink", $type)};
238
+ @each $surface in $sortedSurfaces {
239
+ &[mdw-surface="#{$surface}"] {
240
+ background-color: RGB(getThemeValue("#{$surface}-default-surface", $type));
241
+ }
273
242
  }
274
243
 
275
- &[mdw-ink^="primary contrast"] {
276
- color: #{mdwColorThemeValue("primary-contrast-ink", $type)};
277
- }
278
-
279
- &[mdw-ink^="secondary contrast"] {
280
- color: #{mdwColorThemeValue("secondary-contrast-ink", $type)};
281
- }
282
-
283
- &[mdw-ink^="warn contrast"] {
284
- color: #{mdwColorThemeValue("warn-contrast-ink", $type)};
244
+ @each $surface in $sortedSurfaces {
245
+ &[mdw-surface="#{$surface} alt"] {
246
+ background-color: RGB(getThemeValue("#{$surface}-alt-surface", $type));
247
+ }
285
248
  }
286
249
 
287
- &[mdw-ink^="primary light"] {
288
- color: #{mdwColorThemeValue("primary-light-ink", $type)};
289
- }
290
-
291
- &[mdw-ink^="secondary light"] {
292
- color: #{mdwColorThemeValue("secondary-light-ink", $type)};
293
- }
294
-
295
- &[mdw-ink^="warn light"] {
296
- color: #{mdwColorThemeValue("warn-light-ink", $type)};
250
+ &[mdw-ink~="solid"] {
251
+ color: RGB(getThemeValue("default-ink", $type));
297
252
  }
298
253
 
299
254
  &[mdw-ink~="high"] {
300
- color: rgba(mdwColorThemeValue("default-ink", $type),mdwColorThemeValue("high-ink-opacity", $type));
255
+ color: RGBA(getThemeValue("default-ink", $type),getThemeValue("high-ink-opacity", $type));
301
256
  }
302
257
 
303
258
  &[mdw-ink~="medium"] {
304
- color: rgba(mdwColorThemeValue("default-ink", $type),mdwColorThemeValue("medium-ink-opacity", $type));
259
+ color: RGBA(getThemeValue("default-ink", $type),getThemeValue("medium-ink-opacity", $type));
305
260
  }
306
261
 
307
262
  &[mdw-ink~="inactive"] {
308
- color: rgba(mdwColorThemeValue("default-ink", $type),mdwColorThemeValue("inactive-ink-opacity", $type));
263
+ color: RGBA(getThemeValue("default-ink", $type),getThemeValue("inactive-ink-opacity", $type));
309
264
  }
310
265
 
311
266
  &[mdw-ink~="divider"] {
312
- color: rgba(mdwColorThemeValue("default-ink", $type),mdwColorThemeValue("divider-ink-opacity", $type));
267
+ color: RGBA(getThemeValue("default-ink", $type),getThemeValue("divider-ink-opacity", $type));
268
+ }
269
+
270
+ @each $ink in $sortedInks {
271
+ &[mdw-ink="#{$ink}"] {
272
+ &,
273
+ &.mdw-overlay::before {
274
+ color: RGB(getThemeValue("#{$ink}-default-ink", $type));
275
+ }
276
+ }
277
+ }
278
+
279
+ @each $ink in $sortedInks {
280
+ &[mdw-ink="#{$ink} contrast"] {
281
+ &,
282
+ &.mdw-overlay::before {
283
+ color: RGB(getThemeValue("#{$ink}-contrast-ink", $type));
284
+ }
285
+ }
286
+ }
287
+
288
+ @each $ink in $sortedInks {
289
+ &[mdw-ink="#{$ink} light"] {
290
+ &,
291
+ &.mdw-overlay::before {
292
+ color: RGB(getThemeValue("#{$ink}-light-ink", $type));
293
+ }
294
+ }
313
295
  }
314
296
 
315
297
  &[mdw-border-ink],
316
298
  &[mdw-border-ink="default"] {
317
- border-color: rgba(mdwColorThemeValue("default-ink", $type), mdwColorThemeValue("divider-ink-opacity", $type));
299
+ border-color: RGBA(getThemeValue("default-ink", $type), getThemeValue("divider-ink-opacity", $type));
318
300
  }
319
301
 
320
302
  &[mdw-border-ink="none"] {
@@ -324,7 +306,7 @@ $mdw-color__theme-values: (
324
306
  }
325
307
  }
326
308
 
327
- @mixin __mdw-color__add-fallbacks() {
309
+ @mixin addThemeFallbackRules() {
328
310
  .mdw-theme[mdw-surface="white"] {
329
311
  background-color: #fff;
330
312
  }
@@ -333,98 +315,76 @@ $mdw-color__theme-values: (
333
315
  background-color: #000;
334
316
  }
335
317
 
336
- .mdw-theme[mdw-ink="white"] {
337
- color: #fff;
338
- }
339
-
340
- .mdw-theme[mdw-ink="black"] {
341
- color: #000;
342
- }
343
-
344
- @each $tone in $mdw-theme__tone-list {
345
- @each $param in ('primary', 'secondary', 'warn', 'background') {
346
- $palette: mdwGetThemeParamValue($param);
318
+ @each $surface in $sortedSurfaces {
319
+ $palette: theme.getThemeParamValue($surface);
320
+ @each $tone in theme.$surface-tones {
347
321
  $value: map-get($palette, $tone);
348
322
 
349
- .mdw-theme[mdw-surface="#{$param} #{$tone}"] {
323
+ .mdw-theme[mdw-surface="#{$surface} #{$tone}"] {
350
324
  background-color: #{$value};
351
325
  }
326
+ }
327
+ }
352
328
 
353
- .mdw-theme[mdw-ink^="#{$param} #{$tone}"] {
354
- color: #{$value};
355
- }
329
+ /** Ink Fallback Colors **/
330
+
331
+ .mdw-theme[mdw-ink~="white"] {
332
+ &,
333
+ &.mdw-overlay::before {
334
+ color: #fff;
335
+ }
336
+ }
337
+
338
+ .mdw-theme[mdw-ink~="black"] {
339
+ &,
340
+ &.mdw-overlay::before {
341
+ color: #000;
356
342
  }
357
- @each $color in $mdw-theme__colors {
358
- $palette: map-get($mdw-theme__palettes, $color);
343
+ }
344
+
345
+ @each $tone in theme.$surface-tones {
346
+ @each $surface in $sortedSurfaces {
347
+ $palette: theme.getThemeParamValue($surface);
359
348
  $value: map-get($palette, $tone);
360
349
 
361
- .mdw-theme[mdw-surface^="#{$color} #{$tone}"] {
350
+ .mdw-theme[mdw-surface^="#{$surface} #{$tone}"] {
362
351
  background-color: #{$value};
363
352
  }
353
+ }
354
+ }
364
355
 
365
- .mdw-theme[mdw-ink^="#{$color} #{$tone}"] {
366
- color: #{$value};
356
+ @each $tone in theme.$ink-tones {
357
+ @each $ink in $sortedInks {
358
+ $palette: theme.getThemeParamValue($ink);
359
+ $value: map-get($palette, $tone);
360
+ .mdw-theme[mdw-ink^="#{$ink} #{$tone}"] {
361
+ &,
362
+ &.mdw-overlay::before {
363
+ color: #{$value};
364
+ }
367
365
  }
368
366
  }
369
367
  }
370
368
 
371
369
  .mdw-theme[mdw-light],
372
370
  .mdw-theme[mdw-light] .mdw-theme:not([mdw-dark]) {
373
- @include mdw-color__theme-rules('light');
371
+ @include addThemeRules('light');
374
372
  }
375
373
 
376
374
  .mdw-theme[mdw-dark],
377
375
  .mdw-theme[mdw-dark] .mdw-theme:not([mdw-light]) {
378
- @include mdw-color__theme-rules('dark');
376
+ @include addThemeRules('dark');
379
377
  }
380
378
  }
381
379
 
382
- @if ($mdw-theme__fallbacks == 'ieonly') {
383
- @include mdw-platform__ie() {
384
- @include __mdw-color__add-fallbacks();
380
+ @if (theme.$fallbacks == 'ieonly') {
381
+ @include platform.ifIE() {
382
+ @include addThemeFallbackRules();
385
383
  }
386
- } @else if ($mdw-theme__fallbacks != false) {
387
- @include __mdw-color__add-fallbacks();
384
+ } @else if (theme.$fallbacks != false) {
385
+ @include addThemeFallbackRules();
388
386
  }
389
387
 
390
-
391
- @include mdw-theme__add-component-variable-rules('color', $mdw-color__theme-values, true) {
392
- @each $color in $mdw-theme__colors {
393
- $palette: map-get($mdw-theme__palettes, $color);
394
- @each $tone in map-keys(map-remove($palette, "light", "dark")) {
395
- $value: map-get($palette, $tone);
396
-
397
- :root {
398
- --#{$color}-#{$tone}-color: #{red($value),green($value),blue($value)};
399
- }
400
- }
401
-
402
- .mdw-theme[mdw-surface~="#{$color}"] {
403
- @each $tone in $mdw-theme__tone-list {
404
- --#{$tone}-surface: var(--#{$color}-#{$tone}-color);
405
- }
406
- }
407
-
408
- .mdw-theme[mdw-ink~="#{$color}"] {
409
- @each $tone in $mdw-theme__tone-list {
410
- --#{$tone}-color: var(--#{$color}-#{$tone}-color);
411
- }
412
- }
413
- }
414
-
415
- :root,
416
- .mdw-theme {
417
- --foreground-light-color: #{red($mdw-theme__foreground-light),green($mdw-theme__foreground-light),blue($mdw-theme__foreground-light)};
418
- --foreground-dark-color: #{red($mdw-theme__foreground-dark),green($mdw-theme__foreground-dark),blue($mdw-theme__foreground-dark)};
419
- @each $param in ('primary', 'secondary', 'warn', 'background') {
420
- $palette: mdwGetThemeParamValue($param);
421
- @each $tone in map-keys(map-remove($palette, "light", "dark")) {
422
- $value: map-get($palette, $tone);
423
-
424
- --#{$param}-#{$tone}-color: #{red($value),green($value),blue($value)};
425
- }
426
- }
427
- }
428
-
429
- @include mdw-color__theme-rules();
388
+ @include theme.addComponentCSSVariableRules('color', $themeValues) {
389
+ @include addThemeRules();
430
390
  }
@@ -1,2 +1,2 @@
1
- @import './_spec.scss';
2
- @import './_theme.scss';
1
+ @forward './_spec.scss';
2
+ @forward './_theme.scss';