@angular/material 20.0.0-rc.1 → 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 +9 -35
- package/badge/_m2-badge.scss +32 -35
- package/badge/_m3-badge.scss +31 -32
- 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/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/_color-api-backwards-compatibility.scss +46 -29
- package/core/theming/_definition.scss +6 -0
- package/core/theming/_inspection.scss +0 -25
- package/core/tokens/_m3-system.scss +19 -68
- package/core/tokens/_m3-tokens.scss +0 -128
- package/core/tokens/_m3-utils.scss +11 -83
- package/core/tokens/_token-utils.scss +52 -246
- package/core/tokens/m3/_index.scss +1 -0
- 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 +19 -23
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +20 -20
- 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-CF0eSYO4.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-CbAHLQL5.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-sL9_TuE-.mjs → form-field-Cdw3iYrm.mjs} +33 -33
- 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-BASP1JI8.mjs → icon-button-D5zzuoJc.mjs} +9 -9
- package/fesm2022/icon-button-D5zzuoJc.mjs.map +1 -0
- package/fesm2022/{icon-registry-DVLYRZv3.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-BNtCg9r0.mjs → index-CrjYeoWX.mjs} +9 -9
- package/fesm2022/index-CrjYeoWX.mjs.map +1 -0
- package/fesm2022/{index-DxCSjCL3.mjs → index-DTIUI_kX.mjs} +7 -7
- 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-_OHaksOO.mjs → internal-form-field-B9_shC5z.mjs} +4 -4
- package/fesm2022/internal-form-field-B9_shC5z.mjs.map +1 -0
- package/fesm2022/{line-CtAKiRo6.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-DToxyW7l.mjs → module-CVpKZX1V.mjs} +7 -7
- package/fesm2022/module-CVpKZX1V.mjs.map +1 -0
- package/fesm2022/{module-ChwDH6BC.mjs → module-CdXqcjot.mjs} +28 -28
- package/fesm2022/module-CdXqcjot.mjs.map +1 -0
- package/fesm2022/{module-m5vWw9-5.mjs → module-CwYXiMoV.mjs} +12 -12
- package/fesm2022/module-CwYXiMoV.mjs.map +1 -0
- package/fesm2022/{module-DqTK2swA.mjs → module-r2U_2G3G.mjs} +17 -17
- package/fesm2022/module-r2U_2G3G.mjs.map +1 -0
- package/fesm2022/{option-hkPAbXDN.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-Ddidc23S.mjs → pseudo-checkbox-DQugCpur.mjs} +4 -4
- package/fesm2022/pseudo-checkbox-DQugCpur.mjs.map +1 -0
- package/fesm2022/{pseudo-checkbox-module--am9-RIA.mjs → pseudo-checkbox-module-BXWS_-PP.mjs} +7 -7
- 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-DUGA2BAa.mjs → ripple-BtLhcfGO.mjs} +7 -7
- package/fesm2022/ripple-BtLhcfGO.mjs.map +1 -0
- package/fesm2022/{ripple-loader-Xy4bv6Xh.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-DA18Hchc.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/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/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/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/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.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-update/index_bundled.js +2 -0
- 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/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/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/fesm2022/common-module-CF0eSYO4.mjs.map +0 -1
- package/fesm2022/error-options-CbAHLQL5.mjs.map +0 -1
- package/fesm2022/form-field-sL9_TuE-.mjs.map +0 -1
- package/fesm2022/icon-button-BASP1JI8.mjs.map +0 -1
- package/fesm2022/icon-registry-DVLYRZv3.mjs.map +0 -1
- package/fesm2022/index-BNtCg9r0.mjs.map +0 -1
- package/fesm2022/index-DxCSjCL3.mjs.map +0 -1
- package/fesm2022/internal-form-field-_OHaksOO.mjs.map +0 -1
- package/fesm2022/line-CtAKiRo6.mjs.map +0 -1
- package/fesm2022/module-ChwDH6BC.mjs.map +0 -1
- package/fesm2022/module-DToxyW7l.mjs.map +0 -1
- package/fesm2022/module-DqTK2swA.mjs.map +0 -1
- package/fesm2022/module-m5vWw9-5.mjs.map +0 -1
- package/fesm2022/option-hkPAbXDN.mjs.map +0 -1
- package/fesm2022/pseudo-checkbox-Ddidc23S.mjs.map +0 -1
- package/fesm2022/pseudo-checkbox-module--am9-RIA.mjs.map +0 -1
- package/fesm2022/ripple-DUGA2BAa.mjs.map +0 -1
- package/fesm2022/ripple-loader-Xy4bv6Xh.mjs.map +0 -1
- package/fesm2022/structural-styles-DA18Hchc.mjs.map +0 -1
- package/schematics/tsconfig.json +0 -26
|
@@ -1,55 +1,8 @@
|
|
|
1
|
-
@use '../style/elevation';
|
|
2
1
|
@use '../style/sass-utils';
|
|
3
|
-
@use './m3-system';
|
|
4
2
|
@use 'sass:list';
|
|
5
|
-
@use 'sass:meta';
|
|
6
3
|
@use 'sass:map';
|
|
7
4
|
@use 'sass:string';
|
|
8
5
|
|
|
9
|
-
$_tokens: null;
|
|
10
|
-
$_component-prefix: null;
|
|
11
|
-
$_system-fallbacks: m3-system.create-system-fallbacks();
|
|
12
|
-
$_direct-system-fallbacks: ();
|
|
13
|
-
|
|
14
|
-
// Sets the token prefix and map to use when creating token slots.
|
|
15
|
-
@mixin use-tokens($prefix, $tokens, $direct-system-fallbacks: null) {
|
|
16
|
-
$_component-prefix: $prefix !global;
|
|
17
|
-
$_tokens: $tokens !global;
|
|
18
|
-
|
|
19
|
-
// Direct system fallbacks are a map of base, color, typography, and density tokens. To simplify
|
|
20
|
-
// lookup, flatten these token groups into a single map.
|
|
21
|
-
@if $direct-system-fallbacks {
|
|
22
|
-
$_direct-system-fallbacks: () !global;
|
|
23
|
-
@each $tokens in map.values($direct-system-fallbacks) {
|
|
24
|
-
@each $token, $value in $tokens {
|
|
25
|
-
$_direct-system-fallbacks: map.set($_direct-system-fallbacks, $token, $value) !global;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@content;
|
|
31
|
-
|
|
32
|
-
$_component-prefix: null !global;
|
|
33
|
-
$_tokens: null !global;
|
|
34
|
-
$_direct-system-fallbacks: () !global;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Combines a prefix and a string to generate a CSS variable name for a token.
|
|
38
|
-
@function _create-var-name($prefix, $token) {
|
|
39
|
-
@if $prefix == null or $token == null {
|
|
40
|
-
@error 'Must specify both prefix and name when generating token';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
$string-prefix: '';
|
|
44
|
-
|
|
45
|
-
// Prefixes are lists so we need to combine them.
|
|
46
|
-
@each $part in $prefix {
|
|
47
|
-
$string-prefix: if($string-prefix == '', $part, '#{$string-prefix}-#{$part}');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@return string.unquote('--#{$string-prefix}-#{$token}');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
6
|
// Creates a CSS variable, including the fallback if provided.
|
|
54
7
|
@function _create-var($name, $fallback: null) {
|
|
55
8
|
@if ($fallback) {
|
|
@@ -59,194 +12,98 @@ $_direct-system-fallbacks: ();
|
|
|
59
12
|
}
|
|
60
13
|
}
|
|
61
14
|
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
15
|
+
// Returns a list of overrides for the given M3 get-tokens mixin and prefix. Each token has its
|
|
16
|
+
// prefix removed since the overrides API expects its absence. The returned map includes "all" for
|
|
17
|
+
// all override tokens, and also the subsets with keys base, color, typography, and density.
|
|
18
|
+
@function get-overrides($tokens, $prefix) {
|
|
19
|
+
$base: remove-token-prefixes(map.get($tokens, base), $prefix);
|
|
20
|
+
$color: remove-token-prefixes(map.get($tokens, color), $prefix);
|
|
21
|
+
$typography: remove-token-prefixes(map.get($tokens, typography), $prefix);
|
|
22
|
+
$density: remove-token-prefixes(map.get($tokens, density), $prefix);
|
|
23
|
+
$all: ();
|
|
24
|
+
@each $map in ($base, $color, $typography, $density) {
|
|
25
|
+
$all: map.merge($all, $map);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@return (
|
|
29
|
+
all: $all,
|
|
30
|
+
base: $base,
|
|
31
|
+
color: $color,
|
|
32
|
+
typography: $typography,
|
|
33
|
+
density: $density,
|
|
34
|
+
);
|
|
67
35
|
}
|
|
68
36
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@
|
|
73
|
-
|
|
37
|
+
// Removes a prefix from each component token in the provided map of prefixed tokens.
|
|
38
|
+
@function remove-token-prefixes($prefixed-tokens: (), $prefix) {
|
|
39
|
+
$tokens: ();
|
|
40
|
+
@each $prefixed-token, $value in $prefixed-tokens {
|
|
41
|
+
$token: string.slice($prefixed-token, string.length($prefix) + 2);
|
|
42
|
+
$tokens: map.set($tokens, $token, $value);
|
|
74
43
|
}
|
|
75
|
-
@
|
|
76
|
-
@error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@return true;
|
|
44
|
+
@return $tokens;
|
|
80
45
|
}
|
|
81
46
|
|
|
82
47
|
// Returns the token slot value.
|
|
83
48
|
// Accepts an optional fallback parameter to include in the CSS variable.
|
|
84
49
|
// If $fallback is `true`, then use the tokens map to get the fallback.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// involving tokens. `create-token-slot` should be used when outputting tokens.
|
|
93
|
-
@function get-token-variable-name($token) {
|
|
94
|
-
$_assert: _assert-use-tokens($token);
|
|
95
|
-
@return _create-var-name($_component-prefix, $token);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Gets the token's fallback value. Prefers adding a system-level fallback if one exists, otherwise
|
|
99
|
-
// use the provided fallback.
|
|
100
|
-
@function _get-token-fallback($token, $fallback: null) {
|
|
101
|
-
// If the $fallback is `true`, this is the component's signal to use the current token map value
|
|
102
|
-
@if ($fallback == true) {
|
|
103
|
-
$fallback: map.get($_tokens, $token);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
$direct-sys-fallback: map.get($_direct-system-fallbacks, $token);
|
|
107
|
-
@if ($direct-sys-fallback) {
|
|
108
|
-
@if (sass-utils.is-css-var-name($direct-sys-fallback)) {
|
|
109
|
-
@return _create-var($direct-sys-fallback, $fallback);
|
|
50
|
+
@function slot($token, $fallbacks, $fallback: null) {
|
|
51
|
+
// Fallbacks are a map of base, color, typography, and density tokens. To simplify
|
|
52
|
+
// lookup, flatten these token groups into a single map.
|
|
53
|
+
$fallbacks-flattened: ();
|
|
54
|
+
@each $tokens in map.values($fallbacks) {
|
|
55
|
+
@each $token, $value in $tokens {
|
|
56
|
+
$fallbacks-flattened: map.set($fallbacks-flattened, $token, $value);
|
|
110
57
|
}
|
|
111
|
-
@return $direct-sys-fallback;
|
|
112
58
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
$sys-fallback: map.get($_system-fallbacks, $_component-prefix, $token);
|
|
117
|
-
@if (not $sys-fallback) {
|
|
118
|
-
@return $fallback;
|
|
59
|
+
@if not map.has-key($fallbacks-flattened, $token) {
|
|
60
|
+
@error 'Token #{$token} does not exist. Configured tokens are:' +
|
|
61
|
+
#{map.keys($fallbacks-flattened)};
|
|
119
62
|
}
|
|
120
63
|
|
|
64
|
+
$sys-fallback: map.get($fallbacks-flattened, $token);
|
|
121
65
|
@if (sass-utils.is-css-var-name($sys-fallback)) {
|
|
122
|
-
|
|
66
|
+
$sys-fallback: _create-var($sys-fallback, $fallback);
|
|
123
67
|
}
|
|
124
68
|
|
|
125
|
-
@return $sys-fallback;
|
|
69
|
+
@return _create-var(--mat-#{$token}, $sys-fallback);
|
|
126
70
|
}
|
|
127
71
|
|
|
128
|
-
// Outputs a map of tokens
|
|
129
|
-
@mixin create-token-values($
|
|
130
|
-
@include _create-token-values-internal($
|
|
72
|
+
// Outputs a map of tokens.
|
|
73
|
+
@mixin create-token-values($tokens) {
|
|
74
|
+
@include _create-token-values-internal($tokens, false);
|
|
131
75
|
}
|
|
132
76
|
|
|
133
77
|
// Outputs a map of tokens under a specific prefix in scenarios where tokens may be mixed with
|
|
134
78
|
// other declarations (e.g. M2 themes). Used to avoid https://sass-lang.com/documentation/breaking-changes/mixed-decls/
|
|
135
|
-
@mixin create-token-values-mixed($
|
|
136
|
-
@include _create-token-values-internal($
|
|
79
|
+
@mixin create-token-values-mixed($tokens) {
|
|
80
|
+
@include _create-token-values-internal($tokens, true);
|
|
137
81
|
}
|
|
138
82
|
|
|
139
|
-
@mixin _create-token-values-internal($
|
|
83
|
+
@mixin _create-token-values-internal($tokens, $in-place) {
|
|
140
84
|
@if ($tokens != null) {
|
|
141
85
|
@if ($in-place) {
|
|
142
86
|
& {
|
|
143
87
|
@each $key, $value in $tokens {
|
|
144
88
|
@if $value != null {
|
|
145
|
-
|
|
89
|
+
--mat-#{$key}: #{$value};
|
|
146
90
|
}
|
|
147
91
|
}
|
|
148
92
|
}
|
|
149
93
|
} @else {
|
|
150
94
|
@each $key, $value in $tokens {
|
|
151
95
|
@if $value != null {
|
|
152
|
-
|
|
96
|
+
--mat-#{$key}: #{$value};
|
|
153
97
|
}
|
|
154
98
|
}
|
|
155
99
|
}
|
|
156
100
|
}
|
|
157
101
|
}
|
|
158
102
|
|
|
159
|
-
@mixin define-css-var($prefix, $key, $value) {
|
|
160
|
-
$name: _create-var-name($prefix, $key);
|
|
161
|
-
#{$name}: #{$value};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// MDC doesn't currently handle elevation tokens properly. As a temporary workaround we can combine
|
|
165
|
-
// the elevation and shadow-color tokens into a full box-shadow and use it as the value for the
|
|
166
|
-
// elevation token.
|
|
167
|
-
@function resolve-elevation($tokens, $elevation-token, $shadow-color-token) {
|
|
168
|
-
$elevation: map.get($tokens, $elevation-token);
|
|
169
|
-
$shadow-color: map.get($tokens, $shadow-color-token);
|
|
170
|
-
@return map.merge(
|
|
171
|
-
$tokens,
|
|
172
|
-
(
|
|
173
|
-
$elevation-token: elevation.get-box-shadow($elevation, $shadow-color),
|
|
174
|
-
$shadow-color-token: null,
|
|
175
|
-
)
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/// Checks whether a list starts wih a given prefix
|
|
180
|
-
/// @param {List} $list The list value to check the prefix of.
|
|
181
|
-
/// @param {List} $prefix The prefix to check.
|
|
182
|
-
/// @return {Boolean} Whether the list starts with the prefix.
|
|
183
|
-
@function _is-prefix($list, $prefix) {
|
|
184
|
-
@for $i from 1 through list.length($prefix) {
|
|
185
|
-
@if list.nth($list, $i) != list.nth($prefix, $i) {
|
|
186
|
-
@return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
@return true;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/// Gets the supported color variants in the given token set for the given prefix.
|
|
193
|
-
/// @param {Map} $tokens The full token map.
|
|
194
|
-
/// @param {List} $prefix The component prefix to get color variants for.
|
|
195
|
-
/// @return {List} The supported color variants.
|
|
196
|
-
@function _supported-color-variants($tokens, $prefix) {
|
|
197
|
-
$result: ();
|
|
198
|
-
@each $namespace in map.keys($tokens) {
|
|
199
|
-
@if list.length($prefix) == list.length($namespace) - 1 and _is-prefix($namespace, $prefix) {
|
|
200
|
-
$result: list.append($result, list.nth($namespace, list.length($namespace)), comma);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
@return $result;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/// Gets the token values for the given components prefix with the given options.
|
|
207
|
-
/// @param {Map} $tokens The full token map.
|
|
208
|
-
/// @param {List} $prefix The component prefix to get the token values for.
|
|
209
|
-
/// @param {ArgList} Any additional options
|
|
210
|
-
/// Currently the additional supported options are:
|
|
211
|
-
// - $color-variant - The color variant to use for the component
|
|
212
|
-
// - $emit-overrides-only - Whether to emit *only* the overrides for the
|
|
213
|
-
// specific color variant, or all color styles. Defaults to false.
|
|
214
|
-
/// @throws If given options are invalid
|
|
215
|
-
/// @return {Map} The token values for the requested component.
|
|
216
|
-
@function get-tokens-for($tokens, $prefix, $options...) {
|
|
217
|
-
$options: sass-utils.validate-keyword-args($options, (color-variant, emit-overrides-only));
|
|
218
|
-
@if $tokens == () {
|
|
219
|
-
@return ();
|
|
220
|
-
}
|
|
221
|
-
$values: map.get($tokens, $prefix);
|
|
222
|
-
@if ($values == null) {
|
|
223
|
-
@return ();
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
$color-variant: map.get($options, color-variant);
|
|
227
|
-
$emit-overrides-only: map.get($options, emit-overrides-only);
|
|
228
|
-
@if $color-variant == null {
|
|
229
|
-
@return $values;
|
|
230
|
-
}
|
|
231
|
-
$overrides: map.get($tokens, list.append($prefix, $color-variant));
|
|
232
|
-
@if $overrides == null {
|
|
233
|
-
$variants: _supported-color-variants($tokens, $prefix);
|
|
234
|
-
$secondary-message: if(
|
|
235
|
-
$variants == (),
|
|
236
|
-
'Mixin does not support color variants',
|
|
237
|
-
'Supported color variants are: #{$variants}'
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
@error 'Invalid color variant: #{$color-variant}. #{$secondary-message}.';
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
@return if($emit-overrides-only, $overrides, map.merge($values, $overrides));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
103
|
/// Emits new token values for the given token overrides.
|
|
247
104
|
/// Verifies that the overrides passed in are valid tokens.
|
|
248
105
|
/// New token values are emitted under the current selector or root.
|
|
249
|
-
@mixin batch-create-token-values($overrides: (), $namespace-configs
|
|
106
|
+
@mixin batch-create-token-values($overrides: (), $namespace-configs) {
|
|
250
107
|
@include sass-utils.current-selector-or-root() {
|
|
251
108
|
$prefixed-name-data: ();
|
|
252
109
|
$all-names: ();
|
|
@@ -254,7 +111,7 @@ $_direct-system-fallbacks: ();
|
|
|
254
111
|
@each $config in $namespace-configs {
|
|
255
112
|
$namespace: map.get($config, namespace);
|
|
256
113
|
$prefix: if(map.has-key($config, prefix), map.get($config, prefix), '');
|
|
257
|
-
$tokens:
|
|
114
|
+
$tokens: map.get(map.get($config, tokens), all);
|
|
258
115
|
@each $name, $value in $tokens {
|
|
259
116
|
$prefixed-name: $prefix + $name;
|
|
260
117
|
$all-names: list.append($all-names, $prefixed-name, $separator: comma);
|
|
@@ -267,62 +124,11 @@ $_direct-system-fallbacks: ();
|
|
|
267
124
|
$data: map.get($prefixed-name-data, $name);
|
|
268
125
|
$namespace: list.nth($data, 1);
|
|
269
126
|
$name: list.nth($data, 2);
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
(
|
|
273
|
-
$name: $value,
|
|
274
|
-
)
|
|
275
|
-
);
|
|
127
|
+
$prefixed-name: $namespace + '-' + $name;
|
|
128
|
+
@include create-token-values(($prefixed-name: $value));
|
|
276
129
|
} @else {
|
|
277
130
|
@error #{'Invalid token name `'}#{$name}#{'`. '}#{'Valid tokens are: '}#{$all-names};
|
|
278
131
|
}
|
|
279
132
|
}
|
|
280
133
|
}
|
|
281
134
|
}
|
|
282
|
-
|
|
283
|
-
/// Filters keys with a null value out of the map.
|
|
284
|
-
/// @param {Map} $map The map to filter.
|
|
285
|
-
/// @return {Map} The given map with all of the null keys filtered out.
|
|
286
|
-
@function _filter-nulls($map) {
|
|
287
|
-
$result: ();
|
|
288
|
-
@each $key, $val in $map {
|
|
289
|
-
@if $val != null {
|
|
290
|
-
$result: map.set($result, $key, $val);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
@return $result;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
|
|
297
|
-
/// @param {List} $prefix The token prefix for the given tokens.
|
|
298
|
-
/// @param {Map|(Map, Map)} $values A map of M3 token values for the given prefix.
|
|
299
|
-
/// This param may also be a tuple of maps, the first one representing the default M3 token values,
|
|
300
|
-
// and the second containing overrides for different color variants.
|
|
301
|
-
// Single map example:
|
|
302
|
-
// (token1: green, token2: 2px)
|
|
303
|
-
// Tuple example:
|
|
304
|
-
// (
|
|
305
|
-
// (token1: green, token2: 2px),
|
|
306
|
-
// (
|
|
307
|
-
// secondary: (token1: blue),
|
|
308
|
-
// error: (token1: red),
|
|
309
|
-
// )
|
|
310
|
-
// )
|
|
311
|
-
/// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
|
|
312
|
-
/// @param {String|null} $variant The name of the variant the token values are for.
|
|
313
|
-
/// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
|
|
314
|
-
@function namespace-tokens($prefix, $values, $slots, $variant: null) {
|
|
315
|
-
$result: ();
|
|
316
|
-
@if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
|
|
317
|
-
$variants: list.nth($values, 2);
|
|
318
|
-
$values: list.nth($values, 1);
|
|
319
|
-
@each $variant, $overrides in $variants {
|
|
320
|
-
|
|
321
|
-
$result: map.merge($result, namespace-tokens($prefix, $overrides, $slots, $variant));
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
$used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
|
|
325
|
-
$used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
|
|
326
|
-
$prefix: if($variant == null, $prefix, list.append($prefix, $variant));
|
|
327
|
-
@return map.merge($result, ($prefix: $used-m3-tokens));
|
|
328
|
-
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@use '../../theming/palettes';
|
|
2
|
+
@use './md-sys-color';
|
|
3
|
+
@use './md-sys-elevation';
|
|
4
|
+
@use './md-sys-shape';
|
|
5
|
+
@use './md-sys-state';
|
|
6
|
+
@use './md-sys-typescale';
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
|
|
9
|
+
// Return a new map where the values are the same as the provided map's
|
|
10
|
+
// keys, prefixed with "--mat-sys-". For example:
|
|
11
|
+
// (key1: '', key2: '') --> (key1: --mat-sys-key1, key2: --mat-sys-key2)
|
|
12
|
+
@function _create-system-app-vars-map($map) {
|
|
13
|
+
$new-map: ();
|
|
14
|
+
@each $key, $value in $map {
|
|
15
|
+
$new-map: map.set($new-map, $key, --mat-sys-#{$key});
|
|
16
|
+
}
|
|
17
|
+
@return $new-map;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Map key used to store internals of theme config.
|
|
21
|
+
$internals: _mat-theming-internals-do-not-access;
|
|
22
|
+
|
|
23
|
+
$placeholder-palettes: md-sys-color.md-sys-color-values-light(palettes.$blue-palette);
|
|
24
|
+
$placeholder-palettes: map.set($placeholder-palettes, primary, palettes.$blue-palette);
|
|
25
|
+
$app-vars: (
|
|
26
|
+
'md-sys-color': _create-system-app-vars-map(
|
|
27
|
+
md-sys-color.md-sys-color-values-light($placeholder-palettes)),
|
|
28
|
+
'md-sys-typescale': _create-system-app-vars-map(md-sys-typescale.md-sys-typescale-values((
|
|
29
|
+
brand: (Roboto),
|
|
30
|
+
plain: (Roboto),
|
|
31
|
+
bold: 700,
|
|
32
|
+
medium: 500,
|
|
33
|
+
regular: 400
|
|
34
|
+
))),
|
|
35
|
+
'md-sys-elevation': _create-system-app-vars-map(md-sys-elevation.md-sys-elevation-values()),
|
|
36
|
+
'md-sys-state': _create-system-app-vars-map(md-sys-state.md-sys-state-values()),
|
|
37
|
+
'md-sys-shape': _create-system-app-vars-map(md-sys-shape.md-sys-shape-values()),
|
|
38
|
+
// Add a subset of palette-specific colors used by components instead of system values
|
|
39
|
+
'md-ref-palette': _create-system-app-vars-map(
|
|
40
|
+
(
|
|
41
|
+
neutral10: '', // Form field native select option text color
|
|
42
|
+
neutral-variant20: '', // Sidenav scrim (container background shadow when opened),
|
|
43
|
+
)
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
$sys-theme: ($internals: $app-vars);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use './m2-datepicker';
|
|
4
|
+
@use './m3-datepicker';
|
|
4
5
|
@use '../core/theming/theming';
|
|
5
6
|
@use '../core/theming/inspection';
|
|
6
|
-
@use '../core/theming/validation';
|
|
7
7
|
@use '../core/tokens/token-utils';
|
|
8
8
|
@use '../core/style/sass-utils';
|
|
9
9
|
@use '../core/typography/typography';
|
|
@@ -26,8 +26,7 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
26
26
|
$palette-name
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
@include token-utils.create-token-values-mixed(
|
|
30
|
-
m2-datepicker.$prefix, map.merge($calendar-tokens, $range-tokens));
|
|
29
|
+
@include token-utils.create-token-values-mixed(map.merge($calendar-tokens, $range-tokens));
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
@@ -35,27 +34,24 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
35
34
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
36
35
|
@mixin base($theme) {
|
|
37
36
|
@if inspection.get-theme-version($theme) == 1 {
|
|
38
|
-
@include
|
|
37
|
+
@include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), base));
|
|
39
38
|
} @else {
|
|
40
39
|
@include sass-utils.current-selector-or-root() {
|
|
41
|
-
@include token-utils.create-token-values-mixed(
|
|
42
|
-
m2-datepicker.$prefix, m2-datepicker.get-unthemable-tokens());
|
|
40
|
+
@include token-utils.create-token-values-mixed(m2-datepicker.get-unthemable-tokens());
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
/// Outputs color theme styles for the mat-datepicker.
|
|
48
46
|
/// @param {Map} $theme The theme to generate color styles for.
|
|
49
|
-
/// @param {
|
|
50
|
-
|
|
51
|
-
/// or error (If not specified, default primary color will be used).
|
|
52
|
-
@mixin color($theme, $options...) {
|
|
47
|
+
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
48
|
+
@mixin color($theme, $color-variant: null) {
|
|
53
49
|
@if inspection.get-theme-version($theme) == 1 {
|
|
54
|
-
@include
|
|
50
|
+
@include token-utils.create-token-values(
|
|
51
|
+
map.get(m3-datepicker.get-tokens($theme, $color-variant), color));
|
|
55
52
|
} @else {
|
|
56
53
|
@include sass-utils.current-selector-or-root() {
|
|
57
|
-
@include token-utils.create-token-values-mixed(
|
|
58
|
-
m2-datepicker.$prefix, m2-datepicker.get-color-tokens($theme));
|
|
54
|
+
@include token-utils.create-token-values-mixed(m2-datepicker.get-color-tokens($theme));
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
.mat-datepicker-content {
|
|
@@ -71,12 +67,12 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
71
67
|
.mat-datepicker-toggle-active {
|
|
72
68
|
&.mat-accent {
|
|
73
69
|
$accent-tokens: m2-datepicker.private-get-toggle-color-palette-color-tokens($theme, accent);
|
|
74
|
-
@include token-utils.create-token-values-mixed(
|
|
70
|
+
@include token-utils.create-token-values-mixed($accent-tokens);
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
&.mat-warn {
|
|
78
74
|
$warn-tokens: m2-datepicker.private-get-toggle-color-palette-color-tokens($theme, warn);
|
|
79
|
-
@include token-utils.create-token-values-mixed(
|
|
75
|
+
@include token-utils.create-token-values-mixed($warn-tokens);
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
}
|
|
@@ -86,13 +82,10 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
86
82
|
/// @param {Map} $theme The theme to generate typography styles for.
|
|
87
83
|
@mixin typography($theme) {
|
|
88
84
|
@if inspection.get-theme-version($theme) == 1 {
|
|
89
|
-
@include
|
|
85
|
+
@include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), typography));
|
|
90
86
|
} @else {
|
|
91
87
|
@include sass-utils.current-selector-or-root() {
|
|
92
|
-
@include token-utils.create-token-values-mixed(
|
|
93
|
-
m2-datepicker.$prefix,
|
|
94
|
-
m2-datepicker.get-typography-tokens($theme)
|
|
95
|
-
);
|
|
88
|
+
@include token-utils.create-token-values-mixed(m2-datepicker.get-typography-tokens($theme));
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
}
|
|
@@ -112,7 +105,7 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
112
105
|
);
|
|
113
106
|
|
|
114
107
|
@include sass-utils.current-selector-or-root() {
|
|
115
|
-
@include token-utils.create-token-values-mixed(
|
|
108
|
+
@include token-utils.create-token-values-mixed($tokens);
|
|
116
109
|
}
|
|
117
110
|
}
|
|
118
111
|
|
|
@@ -120,7 +113,7 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
120
113
|
/// @param {Map} $theme The theme to generate density styles for.
|
|
121
114
|
@mixin density($theme) {
|
|
122
115
|
@if inspection.get-theme-version($theme) == 1 {
|
|
123
|
-
|
|
116
|
+
@include token-utils.create-token-values(map.get(m3-datepicker.get-tokens($theme), density));
|
|
124
117
|
} @else {
|
|
125
118
|
// TODO(crisbeto): move this into the structural styles
|
|
126
119
|
// once the icon button density is switched to tokens.
|
|
@@ -137,8 +130,8 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
137
130
|
@function _define-overrides() {
|
|
138
131
|
@return (
|
|
139
132
|
(
|
|
140
|
-
namespace:
|
|
141
|
-
tokens:
|
|
133
|
+
namespace: datepicker,
|
|
134
|
+
tokens: token-utils.get-overrides(m3-datepicker.get-tokens(), datepicker)
|
|
142
135
|
),
|
|
143
136
|
);
|
|
144
137
|
}
|
|
@@ -146,18 +139,19 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
146
139
|
/// Outputs the CSS variable values for the given tokens.
|
|
147
140
|
/// @param {Map} $tokens The token values to emit.
|
|
148
141
|
@mixin overrides($tokens: ()) {
|
|
149
|
-
|
|
142
|
+
@include token-utils.batch-create-token-values($tokens, _define-overrides());
|
|
150
143
|
}
|
|
151
144
|
|
|
152
145
|
/// Outputs all (base, color, typography, and density) theme styles for the mat-datepicker.
|
|
153
146
|
/// @param {Map} $theme The theme to generate styles for.
|
|
154
|
-
/// @param {
|
|
155
|
-
|
|
156
|
-
/// or error (If not specified, default primary color will be used).
|
|
157
|
-
@mixin theme($theme, $options...) {
|
|
147
|
+
/// @param {String} $color-variant The color variant to use for the component (M3 only)
|
|
148
|
+
@mixin theme($theme, $color-variant: null) {
|
|
158
149
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-datepicker') {
|
|
159
150
|
@if inspection.get-theme-version($theme) == 1 {
|
|
160
|
-
@include
|
|
151
|
+
@include base($theme);
|
|
152
|
+
@include color($theme, $color-variant);
|
|
153
|
+
@include density($theme);
|
|
154
|
+
@include typography($theme);
|
|
161
155
|
} @else {
|
|
162
156
|
@include base($theme);
|
|
163
157
|
@if inspection.theme-has($theme, color) {
|
|
@@ -172,12 +166,3 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
168
|
}
|
|
175
|
-
|
|
176
|
-
@mixin _theme-from-tokens($tokens, $options...) {
|
|
177
|
-
@include validation.selector-defined(
|
|
178
|
-
'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
|
|
179
|
-
);
|
|
180
|
-
$mat-datepicker-tokens: token-utils.get-tokens-for(
|
|
181
|
-
$tokens, m2-datepicker.$prefix, $options...);
|
|
182
|
-
@include token-utils.create-token-values(m2-datepicker.$prefix, $mat-datepicker-tokens);
|
|
183
|
-
}
|