@angular/material 20.0.0-rc.0 → 20.0.0-rc.2
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.
- package/autocomplete/_autocomplete-theme.scss +17 -37
- package/autocomplete/_m2-autocomplete.scss +3 -6
- package/autocomplete/_m3-autocomplete.scss +14 -9
- package/badge/_badge-theme.scss +26 -39
- package/badge/_m2-badge.scss +32 -35
- package/badge/_m3-badge.scss +41 -70
- package/bottom-sheet/_bottom-sheet-theme.scss +16 -27
- package/bottom-sheet/_m2-bottom-sheet.scss +11 -11
- package/bottom-sheet/_m3-bottom-sheet.scss +18 -17
- package/button/_button-theme.scss +29 -46
- package/button/_fab-theme.scss +22 -41
- package/button/_icon-button-theme.scss +29 -46
- package/button/_m2-button.scss +135 -133
- package/button/_m2-fab.scss +51 -53
- package/button/_m2-icon-button.scss +14 -17
- package/button/_m3-button.scss +145 -240
- package/button/_m3-fab.scss +69 -166
- package/button/_m3-icon-button.scss +28 -56
- package/button-toggle/_button-toggle-theme.scss +23 -49
- package/button-toggle/_m2-button-toggle.scss +45 -37
- package/button-toggle/_m3-button-toggle.scss +53 -53
- package/card/_card-theme.scss +16 -37
- package/card/_m2-card.scss +24 -25
- package/card/_m3-card.scss +32 -36
- package/checkbox/_checkbox-theme.scss +25 -52
- package/checkbox/_m2-checkbox.scss +32 -35
- package/checkbox/_m3-checkbox.scss +49 -84
- package/chips/_chips-theme.scss +24 -44
- package/chips/_m2-chip.scss +47 -51
- package/chips/_m3-chip.scss +63 -110
- package/core/_core-theme.scss +58 -56
- package/core/_core.scss +15 -18
- package/core/_m2-app.scss +3 -7
- package/core/_m3-app.scss +37 -24
- package/core/color/_all-color.scss +1 -1
- package/core/option/_m2-optgroup.scss +6 -9
- package/core/option/_m2-option.scss +10 -13
- package/core/option/_m3-optgroup.scss +16 -13
- package/core/option/_m3-option.scss +28 -48
- package/core/option/_optgroup-theme.scss +14 -25
- package/core/option/_option-theme.scss +22 -33
- package/core/ripple/_m2-ripple.scss +1 -4
- package/core/ripple/_m3-ripple.scss +11 -13
- package/core/ripple/_ripple-theme.scss +15 -33
- package/core/ripple/_ripple.scss +5 -5
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -11
- package/core/selection/pseudo-checkbox/_m3-pseudo-checkbox.scss +25 -40
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +16 -27
- package/core/style/_sass-utils.scss +0 -29
- package/core/theming/_all-theme.scss +41 -0
- package/core/theming/_color-api-backwards-compatibility.scss +49 -35
- package/core/theming/_definition.scss +78 -72
- package/core/theming/_inspection.scss +23 -46
- package/core/tokens/_m3-system.scss +106 -112
- package/core/tokens/_m3-tokens.scss +30 -354
- package/core/tokens/_m3-utils.scss +36 -73
- package/core/tokens/_token-utils.scss +53 -226
- package/core/tokens/m3/_index.scss +7 -8
- package/core/tokens/m3/_md-sys-color.scss +125 -137
- package/core/tokens/m3/_md-sys-elevation.scss +7 -7
- package/core/tokens/m3/_md-sys-motion.scss +27 -38
- package/core/tokens/m3/_md-sys-shape.scss +13 -16
- package/core/tokens/m3/_md-sys-state.scss +5 -5
- package/core/tokens/m3/_md-sys-typescale.scss +107 -306
- package/core/tokens/m3/_theme.scss +47 -0
- package/datepicker/_datepicker-theme.scss +24 -39
- package/datepicker/_m2-datepicker.scss +55 -50
- package/datepicker/_m3-datepicker.scss +65 -113
- package/datepicker/index.d.ts +1 -0
- package/dialog/_dialog-theme.scss +15 -27
- package/dialog/_m2-dialog.scss +25 -26
- package/dialog/_m3-dialog.scss +35 -35
- package/divider/_divider-theme.scss +14 -25
- package/divider/_m2-divider.scss +2 -5
- package/divider/_m3-divider.scss +13 -13
- package/expansion/_expansion-theme.scss +15 -33
- package/expansion/_m2-expansion.scss +28 -27
- package/expansion/_m3-expansion.scss +41 -36
- package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +23 -23
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -11
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +11 -11
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +20 -24
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +21 -21
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +47 -47
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +11 -11
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +52 -52
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/{common-module-DZl8g1kc.mjs → common-module-BeAwwoi6.mjs} +5 -5
- package/fesm2022/common-module-BeAwwoi6.mjs.map +1 -0
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +24 -24
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
- package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +99 -95
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +18 -5
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +2 -2
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +8 -8
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/{error-options-BWOa3B4G.mjs → error-options-C79tZCHG.mjs} +7 -7
- package/fesm2022/error-options-C79tZCHG.mjs.map +1 -0
- package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +28 -28
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/{form-field-B3aq6ikj.mjs → form-field-Cdw3iYrm.mjs} +70 -62
- package/fesm2022/form-field-Cdw3iYrm.mjs.map +1 -0
- package/fesm2022/form-field.mjs +3 -3
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +24 -24
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +8 -8
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/{icon-button-DH8TBWWr.mjs → icon-button-D5zzuoJc.mjs} +10 -10
- package/fesm2022/icon-button-D5zzuoJc.mjs.map +1 -0
- package/fesm2022/{icon-registry-Bk5cM8Z5.mjs → icon-registry-DVrJNtTv.mjs} +4 -4
- package/fesm2022/icon-registry-DVrJNtTv.mjs.map +1 -0
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-CrjYeoWX.mjs +22 -0
- package/fesm2022/index-CrjYeoWX.mjs.map +1 -0
- package/fesm2022/index-DTIUI_kX.mjs +20 -0
- package/fesm2022/index-DTIUI_kX.mjs.map +1 -0
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input-harness-oQzj5EsQ.mjs.map +1 -1
- package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
- package/fesm2022/input.mjs +12 -12
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/{internal-form-field-DVvKYBKJ.mjs → internal-form-field-B9_shC5z.mjs} +4 -4
- package/fesm2022/internal-form-field-B9_shC5z.mjs.map +1 -0
- package/fesm2022/{line-Dwrcg_t9.mjs → line-XysKlyvU.mjs} +9 -9
- package/fesm2022/line-XysKlyvU.mjs.map +1 -0
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +55 -55
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +20 -20
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-hX_hFZhs.mjs → module-CVpKZX1V.mjs} +7 -7
- package/fesm2022/module-CVpKZX1V.mjs.map +1 -0
- package/fesm2022/{module-B-ci3hbc.mjs → module-CdXqcjot.mjs} +28 -28
- package/fesm2022/module-CdXqcjot.mjs.map +1 -0
- package/fesm2022/{module-X29xYsIk.mjs → module-CwYXiMoV.mjs} +12 -12
- package/fesm2022/module-CwYXiMoV.mjs.map +1 -0
- package/fesm2022/{module-D9IKGg_w.mjs → module-r2U_2G3G.mjs} +17 -17
- package/fesm2022/module-r2U_2G3G.mjs.map +1 -0
- package/fesm2022/{option-MOeehkAg.mjs → option-D4ZNnnWi.mjs} +11 -11
- package/fesm2022/option-D4ZNnnWi.mjs.map +1 -0
- package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +25 -25
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +8 -8
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +8 -8
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/{pseudo-checkbox-BFGIaGxz.mjs → pseudo-checkbox-DQugCpur.mjs} +4 -4
- package/fesm2022/pseudo-checkbox-DQugCpur.mjs.map +1 -0
- package/fesm2022/pseudo-checkbox-module-BXWS_-PP.mjs +20 -0
- package/fesm2022/pseudo-checkbox-module-BXWS_-PP.mjs.map +1 -0
- package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +19 -16
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/{ripple-CuyVtN3V.mjs → ripple-BtLhcfGO.mjs} +7 -7
- package/fesm2022/ripple-BtLhcfGO.mjs.map +1 -0
- package/fesm2022/{ripple-loader-pOctSZby.mjs → ripple-loader-DBdhLqHy.mjs} +5 -5
- package/fesm2022/ripple-loader-DBdhLqHy.mjs.map +1 -0
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +29 -25
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +11 -11
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +21 -21
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +29 -29
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +15 -15
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +38 -38
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/{structural-styles-CasigI3l.mjs → structural-styles-DWEe15sC.mjs} +4 -4
- package/fesm2022/structural-styles-DWEe15sC.mjs.map +1 -0
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs +56 -56
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +67 -63
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +20 -20
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +12 -12
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +2 -2
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +23 -55
- package/form-field/_m2-form-field.scss +112 -91
- package/form-field/_m3-form-field.scss +116 -131
- package/form-field/index.d.ts +2 -2
- package/{form-field.d-CIxjiZIX.d.ts → form-field.d-C6p5uYjG.d.ts} +4 -2
- package/grid-list/_grid-list-theme.scss +13 -23
- package/grid-list/_m2-grid-list.scss +8 -7
- package/grid-list/_m3-grid-list.scss +14 -15
- package/icon/_icon-theme.scss +20 -30
- package/icon/_m2-icon.scss +1 -4
- package/icon/_m3-icon.scss +13 -27
- package/input/_input-theme.scss +7 -40
- package/input/index.d.ts +4 -4
- package/list/_list-theme.scss +22 -52
- package/list/_m2-list.scss +56 -55
- package/list/_m3-list.scss +69 -67
- package/menu/_m2-menu.scss +22 -25
- package/menu/_m3-menu.scss +35 -38
- package/menu/_menu-theme.scss +15 -27
- package/{module.d-CDrqNC7Q.d.ts → module.d-D1Ym5Wf2.d.ts} +1 -1
- package/{module.d-DZ8DPHcV.d.ts → module.d-DMabQ4_c.d.ts} +2 -2
- package/package.json +2 -2
- package/paginator/_m2-paginator.scss +16 -17
- package/paginator/_m3-paginator.scss +28 -27
- package/paginator/_paginator-theme.scss +14 -40
- package/paginator/index.d.ts +5 -5
- package/{paginator.d-Ci_wE-RV.d.ts → paginator.d-DuJ-oYgT.d.ts} +1 -1
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_m2-progress-bar.scss +5 -8
- package/progress-bar/_m3-progress-bar.scss +17 -26
- package/progress-bar/_progress-bar-theme.scss +17 -27
- package/progress-spinner/_m2-progress-spinner.scss +3 -6
- package/progress-spinner/_m3-progress-spinner.scss +15 -22
- package/progress-spinner/_progress-spinner-theme.scss +20 -43
- package/radio/_m2-radio.scss +24 -27
- package/radio/_m3-radio.scss +44 -58
- package/radio/_radio-theme.scss +23 -50
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
- package/schematics/ng-generate/theme-color/index_bundled.js.map +1 -1
- package/schematics/ng-update/index_bundled.js +56 -2
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/_m2-select.scss +15 -18
- package/select/_m3-select.scss +32 -38
- package/select/_select-theme.scss +23 -50
- package/select/index.d.ts +3 -3
- package/sidenav/_m2-sidenav.scss +9 -12
- package/sidenav/_m3-sidenav.scss +20 -22
- package/sidenav/_sidenav-theme.scss +14 -25
- package/slide-toggle/_m2-slide-toggle.scss +82 -83
- package/slide-toggle/_m3-slide-toggle.scss +102 -143
- package/slide-toggle/_slide-toggle-theme.scss +26 -61
- package/slider/_m2-slider.scss +46 -46
- package/slider/_m3-slider.scss +54 -109
- package/slider/_slider-theme.scss +23 -34
- package/snack-bar/_m2-snack-bar.scss +10 -11
- package/snack-bar/_m3-snack-bar.scss +20 -19
- package/snack-bar/_snack-bar-theme.scss +14 -26
- package/sort/_m2-sort.scss +1 -4
- package/sort/_m3-sort.scss +11 -9
- package/sort/_sort-theme.scss +15 -27
- package/stepper/_m2-stepper.scss +32 -31
- package/stepper/_m3-stepper.scss +44 -79
- package/stepper/_stepper-theme.scss +22 -50
- package/table/_m2-table.scss +25 -26
- package/table/_m3-table.scss +36 -27
- package/table/_table-theme.scss +15 -32
- package/table/index.d.ts +2 -2
- package/tabs/_m2-tabs.scss +26 -29
- package/tabs/_m3-tabs.scss +40 -51
- package/tabs/_tabs-theme.scss +37 -58
- package/tabs/index.d.ts +5 -3
- package/timepicker/_m2-timepicker.scss +3 -6
- package/timepicker/_m3-timepicker.scss +14 -15
- package/timepicker/_timepicker-theme.scss +20 -45
- package/toolbar/_m2-toolbar.scss +11 -12
- package/toolbar/_m3-toolbar.scss +22 -17
- package/toolbar/_toolbar-theme.scss +13 -37
- package/tooltip/_m2-tooltip.scss +9 -11
- package/tooltip/_m3-tooltip.scss +19 -19
- package/tooltip/_tooltip-theme.scss +17 -35
- package/tree/_m2-tree.scss +6 -9
- package/tree/_m3-tree.scss +19 -16
- package/tree/_tree-theme.scss +14 -36
- package/core/tokens/m3/_md-ref-palette.scss +0 -100
- package/core/tokens/m3/_md-ref-typeface.scss +0 -14
- package/fesm2022/common-module-DZl8g1kc.mjs.map +0 -1
- package/fesm2022/error-options-BWOa3B4G.mjs.map +0 -1
- package/fesm2022/form-field-B3aq6ikj.mjs.map +0 -1
- package/fesm2022/icon-button-DH8TBWWr.mjs.map +0 -1
- package/fesm2022/icon-registry-Bk5cM8Z5.mjs.map +0 -1
- package/fesm2022/index-BHJ4tVIe.mjs +0 -22
- package/fesm2022/index-BHJ4tVIe.mjs.map +0 -1
- package/fesm2022/index-D2rZ0V78.mjs +0 -20
- package/fesm2022/index-D2rZ0V78.mjs.map +0 -1
- package/fesm2022/internal-form-field-DVvKYBKJ.mjs.map +0 -1
- package/fesm2022/line-Dwrcg_t9.mjs.map +0 -1
- package/fesm2022/module-B-ci3hbc.mjs.map +0 -1
- package/fesm2022/module-D9IKGg_w.mjs.map +0 -1
- package/fesm2022/module-X29xYsIk.mjs.map +0 -1
- package/fesm2022/module-hX_hFZhs.mjs.map +0 -1
- package/fesm2022/option-MOeehkAg.mjs.map +0 -1
- package/fesm2022/pseudo-checkbox-BFGIaGxz.mjs.map +0 -1
- package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs +0 -20
- package/fesm2022/pseudo-checkbox-module-Dxth-mPi.mjs.map +0 -1
- package/fesm2022/ripple-CuyVtN3V.mjs.map +0 -1
- package/fesm2022/ripple-loader-pOctSZby.mjs.map +0 -1
- package/fesm2022/structural-styles-CasigI3l.mjs.map +0 -1
- package/schematics/tsconfig.json +0 -26
|
@@ -1,127 +1,7 @@
|
|
|
1
|
-
@use '../../autocomplete/m3-autocomplete';
|
|
2
|
-
@use '../../badge/m3-badge';
|
|
3
|
-
@use '../../bottom-sheet/m3-bottom-sheet';
|
|
4
|
-
@use '../../button-toggle/m3-button-toggle';
|
|
5
|
-
@use '../../button/m3-button';
|
|
6
|
-
@use '../../button/m3-fab';
|
|
7
|
-
@use '../../button/m3-icon-button';
|
|
8
|
-
@use '../../card/m3-card';
|
|
9
|
-
@use '../../checkbox/m3-checkbox';
|
|
10
|
-
@use '../../chips/m3-chip';
|
|
11
|
-
@use '../../datepicker/m3-datepicker';
|
|
12
|
-
@use '../../dialog/m3-dialog';
|
|
13
|
-
@use '../../divider/m3-divider';
|
|
14
|
-
@use '../../expansion/m3-expansion';
|
|
15
|
-
@use '../../form-field/m3-form-field';
|
|
16
|
-
@use '../../grid-list/m3-grid-list';
|
|
17
|
-
@use '../../icon/m3-icon';
|
|
18
|
-
@use '../../list/m3-list';
|
|
19
|
-
@use '../../menu/m3-menu';
|
|
20
|
-
@use '../../paginator/m3-paginator';
|
|
21
|
-
@use '../../progress-bar/m3-progress-bar';
|
|
22
|
-
@use '../../progress-spinner/m3-progress-spinner';
|
|
23
|
-
@use '../../radio/m3-radio';
|
|
24
|
-
@use '../../select/m3-select';
|
|
25
|
-
@use '../../sidenav/m3-sidenav';
|
|
26
|
-
@use '../../slide-toggle/m3-slide-toggle';
|
|
27
|
-
@use '../../slider/m3-slider';
|
|
28
|
-
@use '../../snack-bar/m3-snack-bar';
|
|
29
|
-
@use '../../sort/m3-sort';
|
|
30
|
-
@use '../../stepper/m3-stepper';
|
|
31
|
-
@use '../../table/m3-table';
|
|
32
|
-
@use '../../tabs/m3-tabs';
|
|
33
|
-
@use '../../timepicker/m3-timepicker';
|
|
34
|
-
@use '../../toolbar/m3-toolbar';
|
|
35
|
-
@use '../../tooltip/m3-tooltip';
|
|
36
|
-
@use '../../tree/m3-tree';
|
|
37
|
-
@use '../m2' as m2-theming;
|
|
38
|
-
@use '../m3-app';
|
|
39
|
-
@use '../option/m3-optgroup';
|
|
40
|
-
@use '../option/m3-option';
|
|
41
|
-
@use '../ripple/m3-ripple';
|
|
42
|
-
@use '../selection/pseudo-checkbox/m3-pseudo-checkbox';
|
|
43
1
|
@use '../style/sass-utils';
|
|
44
|
-
@use './format-tokens';
|
|
45
|
-
@use './m2-tokens';
|
|
46
2
|
@use './m3';
|
|
47
3
|
@use 'sass:map';
|
|
48
4
|
|
|
49
|
-
/// Generates tokens for the given palette with the given prefix.
|
|
50
|
-
/// @param {Map} $palette The palette to generate tokens for
|
|
51
|
-
/// @param {String} $prefix The key prefix used to name the tokens
|
|
52
|
-
/// @return {Map} A set of tokens for the given palette
|
|
53
|
-
@function _generate-palette-tokens($palette, $prefix) {
|
|
54
|
-
$palette: map.remove($palette, neutral, neutral-variant);
|
|
55
|
-
$result: ();
|
|
56
|
-
@each $hue, $value in $palette {
|
|
57
|
-
$result: map.set($result, '#{$prefix}#{$hue}', $value);
|
|
58
|
-
}
|
|
59
|
-
@return $result;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
63
|
-
/// ./m3/definitions/_md-ref-palette.scss)
|
|
64
|
-
/// @param {Map} $primary The primary palette
|
|
65
|
-
/// @param {Map} $secondary The secondary palette
|
|
66
|
-
/// @param {Map} $tertiary The tertiary palette
|
|
67
|
-
/// @param {Map} $error The error palette
|
|
68
|
-
/// @return {Map} A set of `md-ref-palette` tokens
|
|
69
|
-
@function generate-ref-palette-tokens($primary, $tertiary, $error) {
|
|
70
|
-
@return sass-utils.merge-all(
|
|
71
|
-
(black: #000, white: #fff),
|
|
72
|
-
_generate-palette-tokens($primary, primary),
|
|
73
|
-
_generate-palette-tokens(map.get($primary, secondary), secondary),
|
|
74
|
-
_generate-palette-tokens($tertiary, tertiary),
|
|
75
|
-
_generate-palette-tokens(map.get($primary, neutral), neutral),
|
|
76
|
-
_generate-palette-tokens(map.get($primary, neutral-variant), neutral-variant),
|
|
77
|
-
_generate-palette-tokens($error, error),
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
82
|
-
/// ./m3/definitions/_md-ref-typeface.scss)
|
|
83
|
-
/// @param {List|String} $brand The font-family to use for brand text
|
|
84
|
-
/// @param {List|String} $plain The font-family to use for plain text
|
|
85
|
-
/// @param {String} $bold The font-weight to use for bold text
|
|
86
|
-
/// @param {String} $medium The font-weight to use for medium text
|
|
87
|
-
/// @param {String} $regular The font-weight to use for regular text
|
|
88
|
-
/// @return {Map} A set of `md-ref-typeface` tokens
|
|
89
|
-
@function generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular) {
|
|
90
|
-
@return (
|
|
91
|
-
brand: $brand,
|
|
92
|
-
plain: $plain,
|
|
93
|
-
weight-bold: $bold,
|
|
94
|
-
weight-medium: $medium,
|
|
95
|
-
weight-regular: $regular,
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
$_cached-token-slots: null;
|
|
100
|
-
|
|
101
|
-
/// Determines the token slots for all components.
|
|
102
|
-
@function _get-token-slots() {
|
|
103
|
-
// Cache the slots since they're constant and calculating
|
|
104
|
-
// them appears to be expensive (see #29009).
|
|
105
|
-
@if ($_cached-token-slots) {
|
|
106
|
-
@return $_cached-token-slots;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// TODO(mmalerba): Refactor this to not depend on the legacy theme when moving out of
|
|
110
|
-
// material-experimental. This is a hack for now because there is no good way to get the token
|
|
111
|
-
// slots in material-experimental without exposing them all from material.
|
|
112
|
-
$fake-theme: m2-theming.define-light-theme((
|
|
113
|
-
color: (
|
|
114
|
-
primary: m2-theming.define-palette(m2-theming.$red-palette),
|
|
115
|
-
accent: m2-theming.define-palette(m2-theming.$red-palette),
|
|
116
|
-
warn: m2-theming.define-palette(m2-theming.$red-palette),
|
|
117
|
-
),
|
|
118
|
-
typography: m2-theming.define-typography-config(),
|
|
119
|
-
density: 0
|
|
120
|
-
));
|
|
121
|
-
$_cached-token-slots: m2-tokens.m2-tokens-from-theme($fake-theme) !global;
|
|
122
|
-
@return $_cached-token-slots;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
5
|
/// Generates a set of namespaced tokens for all components.
|
|
126
6
|
/// @param {Map} $systems The MDC system tokens
|
|
127
7
|
/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
|
|
@@ -138,11 +18,6 @@ $_cached-token-slots: null;
|
|
|
138
18
|
), $systems);
|
|
139
19
|
$exclude-hardcoded: not $include-non-systemized;
|
|
140
20
|
|
|
141
|
-
// DO NOT REMOVE
|
|
142
|
-
// This function is used internally.
|
|
143
|
-
$systems: format-tokens.private-format-tokens($systems);
|
|
144
|
-
$token-slots: _get-token-slots();
|
|
145
|
-
|
|
146
21
|
// TODO(mmalerba): Fill in remaining tokens.
|
|
147
22
|
$result: sass-utils.deep-merge-all(
|
|
148
23
|
// Add the system color & typography tokens (so we can give users access via an API).
|
|
@@ -150,7 +25,6 @@ $_cached-token-slots: null;
|
|
|
150
25
|
(mat, theme): map.get($systems, md-sys-color),
|
|
151
26
|
(mat, typography): map.get($systems, md-sys-typescale),
|
|
152
27
|
),
|
|
153
|
-
get-m3-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
154
28
|
);
|
|
155
29
|
|
|
156
30
|
@return $result;
|
|
@@ -164,170 +38,34 @@ $_cached-token-slots: null;
|
|
|
164
38
|
@return $result;
|
|
165
39
|
}
|
|
166
40
|
|
|
167
|
-
@function
|
|
168
|
-
$
|
|
169
|
-
m3.md-sys-color-values-dark($
|
|
170
|
-
m3.md-sys-color-values-light($
|
|
41
|
+
@function get-sys-color($type, $palettes, $prefix) {
|
|
42
|
+
$sys-color: if($type == dark,
|
|
43
|
+
m3.md-sys-color-values-dark($palettes),
|
|
44
|
+
m3.md-sys-color-values-light($palettes));
|
|
171
45
|
|
|
172
46
|
@if (sass-utils.$use-system-color-variables) {
|
|
173
|
-
$
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
'inverse-surface',
|
|
180
|
-
'on-background',
|
|
181
|
-
'on-error',
|
|
182
|
-
'on-error-container',
|
|
183
|
-
'on-primary',
|
|
184
|
-
'on-primary-container',
|
|
185
|
-
'on-primary-fixed',
|
|
186
|
-
'on-primary-fixed-variant',
|
|
187
|
-
'on-secondary',
|
|
188
|
-
'on-secondary-container',
|
|
189
|
-
'on-secondary-fixed',
|
|
190
|
-
'on-secondary-fixed-variant',
|
|
191
|
-
'on-surface',
|
|
192
|
-
'on-surface-variant',
|
|
193
|
-
'on-tertiary',
|
|
194
|
-
'on-tertiary-container',
|
|
195
|
-
'on-tertiary-fixed',
|
|
196
|
-
'on-tertiary-fixed-variant',
|
|
197
|
-
'outline',
|
|
198
|
-
'outline-variant',
|
|
199
|
-
'primary',
|
|
200
|
-
'primary-container',
|
|
201
|
-
'primary-fixed',
|
|
202
|
-
'primary-fixed-dim',
|
|
203
|
-
'scrim',
|
|
204
|
-
'secondary',
|
|
205
|
-
'secondary-container',
|
|
206
|
-
'secondary-fixed',
|
|
207
|
-
'secondary-fixed-dim',
|
|
208
|
-
'surface',
|
|
209
|
-
'surface-bright',
|
|
210
|
-
'surface-container',
|
|
211
|
-
'surface-container-high',
|
|
212
|
-
'surface-container-highest',
|
|
213
|
-
'surface-container-low',
|
|
214
|
-
'surface-container-lowest',
|
|
215
|
-
'surface-dim',
|
|
216
|
-
'surface-tint',
|
|
217
|
-
'surface-variant',
|
|
218
|
-
'tertiary',
|
|
219
|
-
'tertiary-container',
|
|
220
|
-
'tertiary-fixed',
|
|
221
|
-
'tertiary-fixed-dim'
|
|
222
|
-
);
|
|
223
|
-
@return map.merge(create-map($keys, $prefix), (
|
|
224
|
-
shadow: map.get($mdc-sys-color, shadow)
|
|
225
|
-
));
|
|
47
|
+
$var-values: ();
|
|
48
|
+
@each $key in map.keys($sys-color) {
|
|
49
|
+
$var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
|
|
50
|
+
}
|
|
51
|
+
$var-values: map.set($var-values, shadow, map.get($sys-color, shadow));
|
|
52
|
+
@return $var-values;
|
|
226
53
|
}
|
|
227
54
|
|
|
228
|
-
@return $
|
|
55
|
+
@return $sys-color;
|
|
229
56
|
}
|
|
230
57
|
|
|
231
|
-
@function
|
|
58
|
+
@function get-sys-typeface($typography, $prefix) {
|
|
59
|
+
$sys-typography: m3.md-sys-typescale-values($typography);
|
|
232
60
|
@if (sass-utils.$use-system-typography-variables) {
|
|
233
|
-
$
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
'body-large-tracking',
|
|
239
|
-
'body-large-weight',
|
|
240
|
-
'body-medium',
|
|
241
|
-
'body-medium-font',
|
|
242
|
-
'body-medium-line-height',
|
|
243
|
-
'body-medium-size',
|
|
244
|
-
'body-medium-tracking',
|
|
245
|
-
'body-medium-weight',
|
|
246
|
-
'body-small',
|
|
247
|
-
'body-small-font',
|
|
248
|
-
'body-small-line-height',
|
|
249
|
-
'body-small-size',
|
|
250
|
-
'body-small-tracking',
|
|
251
|
-
'body-small-weight',
|
|
252
|
-
'display-large',
|
|
253
|
-
'display-large-font',
|
|
254
|
-
'display-large-line-height',
|
|
255
|
-
'display-large-size',
|
|
256
|
-
'display-large-tracking',
|
|
257
|
-
'display-large-weight',
|
|
258
|
-
'display-medium',
|
|
259
|
-
'display-medium-font',
|
|
260
|
-
'display-medium-line-height',
|
|
261
|
-
'display-medium-size',
|
|
262
|
-
'display-medium-tracking',
|
|
263
|
-
'display-medium-weight',
|
|
264
|
-
'display-small',
|
|
265
|
-
'display-small-font',
|
|
266
|
-
'display-small-line-height',
|
|
267
|
-
'display-small-size',
|
|
268
|
-
'display-small-tracking',
|
|
269
|
-
'display-small-weight',
|
|
270
|
-
'headline-large',
|
|
271
|
-
'headline-large-font',
|
|
272
|
-
'headline-large-line-height',
|
|
273
|
-
'headline-large-size',
|
|
274
|
-
'headline-large-tracking',
|
|
275
|
-
'headline-large-weight',
|
|
276
|
-
'headline-medium',
|
|
277
|
-
'headline-medium-font',
|
|
278
|
-
'headline-medium-line-height',
|
|
279
|
-
'headline-medium-size',
|
|
280
|
-
'headline-medium-tracking',
|
|
281
|
-
'headline-medium-weight',
|
|
282
|
-
'headline-small',
|
|
283
|
-
'headline-small-font',
|
|
284
|
-
'headline-small-line-height',
|
|
285
|
-
'headline-small-size',
|
|
286
|
-
'headline-small-tracking',
|
|
287
|
-
'headline-small-weight',
|
|
288
|
-
'label-large',
|
|
289
|
-
'label-large-font',
|
|
290
|
-
'label-large-line-height',
|
|
291
|
-
'label-large-size',
|
|
292
|
-
'label-large-tracking',
|
|
293
|
-
'label-large-weight',
|
|
294
|
-
'label-large-weight-prominent',
|
|
295
|
-
'label-medium',
|
|
296
|
-
'label-medium-font',
|
|
297
|
-
'label-medium-line-height',
|
|
298
|
-
'label-medium-size',
|
|
299
|
-
'label-medium-tracking',
|
|
300
|
-
'label-medium-weight',
|
|
301
|
-
'label-medium-weight-prominent',
|
|
302
|
-
'label-small',
|
|
303
|
-
'label-small-font',
|
|
304
|
-
'label-small-line-height',
|
|
305
|
-
'label-small-size',
|
|
306
|
-
'label-small-tracking',
|
|
307
|
-
'label-small-weight',
|
|
308
|
-
'title-large',
|
|
309
|
-
'title-large-font',
|
|
310
|
-
'title-large-line-height',
|
|
311
|
-
'title-large-size',
|
|
312
|
-
'title-large-tracking',
|
|
313
|
-
'title-large-weight',
|
|
314
|
-
'title-medium',
|
|
315
|
-
'title-medium-font',
|
|
316
|
-
'title-medium-line-height',
|
|
317
|
-
'title-medium-size',
|
|
318
|
-
'title-medium-tracking',
|
|
319
|
-
'title-medium-weight',
|
|
320
|
-
'title-small',
|
|
321
|
-
'title-small-font',
|
|
322
|
-
'title-small-line-height',
|
|
323
|
-
'title-small-size',
|
|
324
|
-
'title-small-tracking',
|
|
325
|
-
'title-small-weight'
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
@return create-map($keys, $prefix);
|
|
61
|
+
$var-values: ();
|
|
62
|
+
@each $key in map.keys($sys-typography) {
|
|
63
|
+
$var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
|
|
64
|
+
}
|
|
65
|
+
@return $var-values;
|
|
329
66
|
}
|
|
330
|
-
|
|
67
|
+
|
|
68
|
+
@return $sys-typography;
|
|
331
69
|
}
|
|
332
70
|
|
|
333
71
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -337,15 +75,15 @@ $_cached-token-slots: null;
|
|
|
337
75
|
/// @param {Map} $error The error palette
|
|
338
76
|
/// @param {String} $system-variables-prefix The prefix of system tokens
|
|
339
77
|
/// @return {Map} A map of namespaced color tokens
|
|
340
|
-
@function generate-color-tokens($type, $
|
|
341
|
-
$
|
|
342
|
-
md-ref-palette: generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
343
|
-
);
|
|
344
|
-
|
|
345
|
-
$sys-color: _get-sys-color($type, $ref, $system-variables-prefix);
|
|
78
|
+
@function generate-color-tokens($type, $palettes, $system-variables-prefix) {
|
|
79
|
+
$sys-color: get-sys-color($type, $palettes, $system-variables-prefix);
|
|
346
80
|
|
|
347
|
-
@return generate-tokens(
|
|
81
|
+
@return generate-tokens((
|
|
348
82
|
md-sys-color: $sys-color,
|
|
83
|
+
md-ref-palette: (
|
|
84
|
+
neutral-10: map.get($palettes, neutral, 10),
|
|
85
|
+
neutral-variant20: map.get($palettes, neutral-variant, 20),
|
|
86
|
+
),
|
|
349
87
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
350
88
|
// elevation needs to be part of the color dimension.
|
|
351
89
|
md-sys-elevation: m3.md-sys-elevation-values(),
|
|
@@ -354,7 +92,7 @@ $_cached-token-slots: null;
|
|
|
354
92
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
355
93
|
// state to the base dimension.
|
|
356
94
|
md-sys-state: m3.md-sys-state-values(),
|
|
357
|
-
))
|
|
95
|
+
));
|
|
358
96
|
}
|
|
359
97
|
|
|
360
98
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -365,12 +103,8 @@ $_cached-token-slots: null;
|
|
|
365
103
|
/// @param {String|Number} $regular The regular font-weight
|
|
366
104
|
/// @param {String} $system-variables-prefix The prefix of system tokens
|
|
367
105
|
/// @return {Map} A map of namespaced typography tokens
|
|
368
|
-
@function generate-typography-tokens($
|
|
369
|
-
$system-variables-prefix)
|
|
370
|
-
$ref: (
|
|
371
|
-
md-ref-typeface: generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
372
|
-
);
|
|
373
|
-
$sys-typeface: _get-sys-typeface($ref, $system-variables-prefix);
|
|
106
|
+
@function generate-typography-tokens($typography, $system-variables-prefix) {
|
|
107
|
+
$sys-typeface: get-sys-typeface($typography, $system-variables-prefix);
|
|
374
108
|
@return generate-tokens((
|
|
375
109
|
md-sys-typescale: $sys-typeface
|
|
376
110
|
));
|
|
@@ -386,61 +120,3 @@ $system-variables-prefix) {
|
|
|
386
120
|
md-sys-shape: m3.md-sys-shape-values(),
|
|
387
121
|
), $include-non-systemized: true);
|
|
388
122
|
}
|
|
389
|
-
|
|
390
|
-
/// Gets the full set of M3 tokens for the given theme object.
|
|
391
|
-
/// @param {Map} $systems The MDC system tokens
|
|
392
|
-
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
393
|
-
/// @param {Map} $token-slots Possible token slots
|
|
394
|
-
/// @return {Map} Full set of M3 tokens
|
|
395
|
-
@function get-m3-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
396
|
-
$tokens-list: (
|
|
397
|
-
m3-app.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
398
|
-
m3-autocomplete.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
399
|
-
m3-badge.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
400
|
-
m3-bottom-sheet.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
401
|
-
m3-button-toggle.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
402
|
-
m3-button.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
403
|
-
m3-card.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
404
|
-
m3-checkbox.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
405
|
-
m3-chip.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
406
|
-
m3-datepicker.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
407
|
-
m3-dialog.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
408
|
-
m3-divider.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
409
|
-
m3-expansion.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
410
|
-
m3-fab.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
411
|
-
m3-form-field.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
412
|
-
m3-grid-list.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
413
|
-
m3-icon-button.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
414
|
-
m3-icon.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
415
|
-
m3-list.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
416
|
-
m3-menu.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
417
|
-
m3-optgroup.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
418
|
-
m3-option.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
419
|
-
m3-paginator.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
420
|
-
m3-progress-bar.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
421
|
-
m3-progress-spinner.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
422
|
-
m3-pseudo-checkbox.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
423
|
-
m3-radio.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
424
|
-
m3-ripple.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
425
|
-
m3-tabs.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
426
|
-
m3-select.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
427
|
-
m3-sidenav.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
428
|
-
m3-slide-toggle.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
429
|
-
m3-slider.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
430
|
-
m3-snack-bar.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
431
|
-
m3-sort.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
432
|
-
m3-stepper.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
433
|
-
m3-table.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
434
|
-
m3-timepicker.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
435
|
-
m3-toolbar.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
436
|
-
m3-tooltip.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
437
|
-
m3-tree.get-tokens($systems, $exclude-hardcoded, $token-slots),
|
|
438
|
-
);
|
|
439
|
-
|
|
440
|
-
$merged-tokens: ();
|
|
441
|
-
@each $tokens in $tokens-list {
|
|
442
|
-
$merged-tokens: map.deep-merge($merged-tokens, $tokens);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
@return $merged-tokens;
|
|
446
|
-
}
|
|
@@ -1,85 +1,48 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:list';
|
|
3
2
|
@use 'sass:meta';
|
|
3
|
+
@use 'sass:string';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// Tuple example:
|
|
13
|
-
// (
|
|
14
|
-
// (token1: green, token2: 2px),
|
|
15
|
-
// (
|
|
16
|
-
// secondary: (token1: blue),
|
|
17
|
-
// error: (token1: red),
|
|
18
|
-
// )
|
|
19
|
-
// )
|
|
20
|
-
/// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
|
|
21
|
-
/// @param {String|null} $variant The name of the variant the token values are for.
|
|
22
|
-
/// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
|
|
23
|
-
@function namespace($prefix, $values, $slots, $variant: null) {
|
|
24
|
-
$result: ();
|
|
25
|
-
@if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
|
|
26
|
-
$variants: list.nth($values, 2);
|
|
27
|
-
$values: list.nth($values, 1);
|
|
28
|
-
@each $variant, $overrides in $variants {
|
|
29
|
-
|
|
30
|
-
$result: map.merge($result, namespace($prefix, $overrides, $slots, $variant));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
$used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
|
|
34
|
-
$used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
|
|
35
|
-
$prefix: if($variant == null, $prefix, list.append($prefix, $variant));
|
|
36
|
-
@return map.merge($result, ($prefix: $used-m3-tokens));
|
|
5
|
+
// Replaces color tokens in the map with those defined as the variant color.
|
|
6
|
+
@function replace-colors-with-variant($system, $color, $variant) {
|
|
7
|
+
$system: map.set($system, on-#{$color}, map.get($system, on-#{$variant}));
|
|
8
|
+
$system: map.set($system, on-#{$color}-container, map.get($system, on-#{$variant}-container));
|
|
9
|
+
$system: map.set($system, #{$color}, map.get($system, #{$variant}));
|
|
10
|
+
$system: map.set($system, #{$color}-container, map.get($system, #{$variant}-container));
|
|
11
|
+
@return $system;
|
|
37
12
|
}
|
|
38
13
|
|
|
39
|
-
|
|
40
|
-
@function
|
|
41
|
-
|
|
14
|
+
// Gets the theme's system values as a flat map.
|
|
15
|
+
@function get-system($theme) {
|
|
16
|
+
$system: ();
|
|
17
|
+
$system: map.merge($system,
|
|
18
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-color));
|
|
19
|
+
$system: map.merge($system,
|
|
20
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-elevation));
|
|
21
|
+
$system: map.merge($system,
|
|
22
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-shape));
|
|
23
|
+
$system: map.merge($system,
|
|
24
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-state));
|
|
25
|
+
$system: map.merge($system,
|
|
26
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-sys-typescale));
|
|
27
|
+
$system: map.merge($system,
|
|
28
|
+
map.get($theme, _mat-theming-internals-do-not-access, md-ref-palette));
|
|
29
|
+
@return $system;
|
|
42
30
|
}
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
$result: ();
|
|
50
|
-
@each $key in $keys {
|
|
51
|
-
@if map.has-key($map, $key) {
|
|
52
|
-
$result: map.set($result, $key, map.get($map, $key));
|
|
53
|
-
}
|
|
32
|
+
// Returns the color with an opacity value using color-mix. If the color is a variable name, it
|
|
33
|
+
// will wrap it with `var()`.
|
|
34
|
+
@function color-with-opacity($color, $opacity) {
|
|
35
|
+
@if (meta.type-of($color) == string and string.index($color, '--') == 1) {
|
|
36
|
+
$color: var($color);
|
|
54
37
|
}
|
|
55
|
-
@return $result;
|
|
56
|
-
}
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@
|
|
63
|
-
|
|
64
|
-
@each $key, $val in $map {
|
|
65
|
-
@if $val != null {
|
|
66
|
-
$result: map.set($result, $key, $val);
|
|
67
|
-
}
|
|
39
|
+
// Opacity may be a system level value less than 1, instead of the intended
|
|
40
|
+
// whole percentage, e.g. 38%. Remove this support when possible.
|
|
41
|
+
@if (meta.type-of($opacity) == string and string.index($opacity, '--') == 1) {
|
|
42
|
+
$opacity: 'calc(var(#{$opacity}) * 100%)';
|
|
43
|
+
} @else if (meta.type-of($opacity) == number and $opacity < 1) {
|
|
44
|
+
$opacity: '#{$opacity * 100}%';
|
|
68
45
|
}
|
|
69
|
-
@return $result;
|
|
70
|
-
}
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
/// level.
|
|
74
|
-
/// @param {Map} $systems The MDC system tokens
|
|
75
|
-
/// @param {String} $base-name The token base name to get the typography tokens for
|
|
76
|
-
/// @param {String} $typography-level The typography level to base the token values on
|
|
77
|
-
/// @return {Map} A map containing the typography tokens for the given base token name
|
|
78
|
-
@function generate-typography-tokens($systems, $base-name, $typography-level) {
|
|
79
|
-
$result: ();
|
|
80
|
-
@each $prop in (font, line-height, size, tracking, weight) {
|
|
81
|
-
$result: map.set($result, #{$base-name}-#{$prop},
|
|
82
|
-
map.get($systems, md-sys-typescale, #{$typography-level}-#{$prop}));
|
|
83
|
-
}
|
|
84
|
-
@return $result;
|
|
47
|
+
@return color-mix(in srgb, #{$color} #{$opacity}, transparent);
|
|
85
48
|
}
|