@angular/material 17.1.1 → 17.2.0-next.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.
- package/_index.scss +4 -4
- package/badge/_badge-theme.scss +30 -11
- package/button/_button-base.scss +50 -10
- package/button/_button-theme.scss +92 -51
- package/button/_fab-theme.scss +82 -15
- package/button/_icon-button-theme.scss +11 -4
- package/button-toggle/_button-toggle-theme.scss +26 -11
- package/checkbox/_checkbox-theme.scss +41 -23
- package/chips/_chips-theme.scss +25 -9
- package/core/_core-theme.scss +85 -38
- package/core/mdc-helpers/_mdc-helpers.scss +0 -8
- package/core/option/_option-theme.scss +24 -10
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +64 -24
- package/core/tokens/_token-utils.scss +22 -0
- package/core/tokens/m2/_index.scss +16 -0
- package/core/tokens/m2/mat/_badge.scss +27 -1
- package/core/tokens/m2/mat/_checkbox.scss +45 -0
- package/core/tokens/m2/mat/_dialog.scss +49 -0
- package/core/tokens/m2/mat/_fab-small.scss +95 -0
- package/core/tokens/m2/mat/_fab.scss +6 -1
- package/core/tokens/m2/mat/_filled-button.scss +17 -2
- package/core/tokens/m2/mat/_icon-button.scss +6 -1
- package/core/tokens/m2/mat/_outlined-button.scss +17 -2
- package/core/tokens/m2/mat/_protected-button.scss +17 -2
- package/core/tokens/m2/mat/_radio.scss +6 -1
- package/core/tokens/m2/mat/_stepper.scss +6 -1
- package/core/tokens/m2/mat/_text-button.scss +20 -2
- package/core/tokens/m2/mdc/_extended-fab.scss +3 -2
- package/core/tokens/m2/mdc/_fab-small.scss +90 -0
- package/core/tokens/m2/mdc/_fab.scss +0 -11
- package/core/tokens/m2/mdc/_icon-button.scss +15 -7
- package/datepicker/_datepicker-theme.scss +25 -9
- package/dialog/_dialog-theme.scss +10 -0
- package/dialog/index.d.ts +28 -9
- package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
- package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
- package/esm2022/autocomplete/autocomplete.mjs +4 -4
- package/esm2022/autocomplete/module.mjs +5 -5
- package/esm2022/badge/badge-module.mjs +5 -5
- package/esm2022/badge/badge.mjs +8 -8
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
- package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
- package/esm2022/button/button-base.mjs +7 -7
- package/esm2022/button/button.mjs +9 -9
- package/esm2022/button/fab.mjs +17 -17
- package/esm2022/button/icon-button.mjs +9 -9
- package/esm2022/button/module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle.mjs +7 -7
- package/esm2022/card/card.mjs +43 -43
- package/esm2022/card/module.mjs +5 -5
- package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
- package/esm2022/checkbox/checkbox.mjs +6 -6
- package/esm2022/checkbox/module.mjs +9 -9
- package/esm2022/chips/chip-action.mjs +4 -4
- package/esm2022/chips/chip-edit-input.mjs +4 -4
- package/esm2022/chips/chip-grid.mjs +4 -4
- package/esm2022/chips/chip-icons.mjs +10 -10
- package/esm2022/chips/chip-input.mjs +4 -4
- package/esm2022/chips/chip-listbox.mjs +4 -4
- package/esm2022/chips/chip-option.mjs +4 -4
- package/esm2022/chips/chip-row.mjs +4 -4
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +4 -4
- package/esm2022/chips/module.mjs +5 -5
- package/esm2022/core/common-behaviors/common-module.mjs +5 -5
- package/esm2022/core/datetime/index.mjs +9 -9
- package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
- package/esm2022/core/error/error-options.mjs +7 -7
- package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
- package/esm2022/core/line/line.mjs +8 -8
- package/esm2022/core/option/index.mjs +5 -5
- package/esm2022/core/option/optgroup.mjs +4 -4
- package/esm2022/core/option/option.mjs +4 -4
- package/esm2022/core/private/ripple-loader.mjs +4 -4
- package/esm2022/core/ripple/index.mjs +5 -5
- package/esm2022/core/ripple/ripple.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +4 -4
- package/esm2022/datepicker/calendar.mjs +7 -7
- package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
- package/esm2022/datepicker/date-range-input.mjs +4 -4
- package/esm2022/datepicker/date-range-picker.mjs +4 -4
- package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
- package/esm2022/datepicker/date-selection-model.mjs +10 -10
- package/esm2022/datepicker/datepicker-actions.mjs +10 -10
- package/esm2022/datepicker/datepicker-base.mjs +7 -7
- package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
- package/esm2022/datepicker/datepicker-input.mjs +4 -4
- package/esm2022/datepicker/datepicker-intl.mjs +4 -4
- package/esm2022/datepicker/datepicker-module.mjs +5 -5
- package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
- package/esm2022/datepicker/datepicker.mjs +4 -4
- package/esm2022/datepicker/month-view.mjs +4 -4
- package/esm2022/datepicker/multi-year-view.mjs +4 -4
- package/esm2022/datepicker/year-view.mjs +4 -4
- package/esm2022/dialog/dialog-config.mjs +1 -3
- package/esm2022/dialog/dialog-container.mjs +16 -5
- package/esm2022/dialog/dialog-content-directives.mjs +49 -31
- package/esm2022/dialog/dialog-ref.mjs +3 -1
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/dialog/module.mjs +5 -5
- package/esm2022/dialog/public-api.mjs +2 -2
- package/esm2022/divider/divider-module.mjs +5 -5
- package/esm2022/divider/divider.mjs +4 -4
- package/esm2022/expansion/accordion.mjs +4 -4
- package/esm2022/expansion/expansion-module.mjs +5 -5
- package/esm2022/expansion/expansion-panel-content.mjs +4 -4
- package/esm2022/expansion/expansion-panel-header.mjs +10 -10
- package/esm2022/expansion/expansion-panel.mjs +7 -7
- package/esm2022/form-field/directives/error.mjs +4 -4
- package/esm2022/form-field/directives/floating-label.mjs +4 -4
- package/esm2022/form-field/directives/hint.mjs +4 -4
- package/esm2022/form-field/directives/label.mjs +4 -4
- package/esm2022/form-field/directives/line-ripple.mjs +4 -4
- package/esm2022/form-field/directives/notched-outline.mjs +4 -4
- package/esm2022/form-field/directives/prefix.mjs +4 -4
- package/esm2022/form-field/directives/suffix.mjs +4 -4
- package/esm2022/form-field/form-field-control.mjs +4 -4
- package/esm2022/form-field/form-field.mjs +4 -4
- package/esm2022/form-field/module.mjs +5 -5
- package/esm2022/grid-list/grid-list-module.mjs +5 -5
- package/esm2022/grid-list/grid-list.mjs +4 -4
- package/esm2022/grid-list/grid-tile.mjs +16 -16
- package/esm2022/icon/icon-module.mjs +5 -5
- package/esm2022/icon/icon-registry.mjs +4 -4
- package/esm2022/icon/icon.mjs +4 -4
- package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
- package/esm2022/input/input.mjs +4 -4
- package/esm2022/input/module.mjs +5 -5
- package/esm2022/list/action-list.mjs +4 -4
- package/esm2022/list/list-base.mjs +7 -7
- package/esm2022/list/list-item-sections.mjs +19 -19
- package/esm2022/list/list-module.mjs +5 -5
- package/esm2022/list/list-option.mjs +4 -4
- package/esm2022/list/list.mjs +7 -7
- package/esm2022/list/nav-list.mjs +4 -4
- package/esm2022/list/selection-list.mjs +4 -4
- package/esm2022/list/subheader.mjs +4 -4
- package/esm2022/menu/menu-content.mjs +4 -4
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu-trigger.mjs +4 -4
- package/esm2022/menu/menu.mjs +4 -4
- package/esm2022/menu/module.mjs +5 -5
- package/esm2022/paginator/module.mjs +5 -5
- package/esm2022/paginator/paginator-intl.mjs +4 -4
- package/esm2022/paginator/paginator.mjs +4 -4
- package/esm2022/progress-bar/module.mjs +5 -5
- package/esm2022/progress-bar/progress-bar.mjs +4 -4
- package/esm2022/progress-spinner/module.mjs +5 -5
- package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
- package/esm2022/radio/module.mjs +5 -5
- package/esm2022/radio/radio.mjs +8 -8
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +7 -7
- package/esm2022/sidenav/drawer.mjs +10 -10
- package/esm2022/sidenav/sidenav-module.mjs +5 -5
- package/esm2022/sidenav/sidenav.mjs +10 -10
- package/esm2022/slide-toggle/module.mjs +9 -9
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
- package/esm2022/slide-toggle/slide-toggle.mjs +4 -4
- package/esm2022/slider/module.mjs +5 -5
- package/esm2022/slider/slider-input.mjs +7 -7
- package/esm2022/slider/slider-thumb.mjs +4 -4
- package/esm2022/slider/slider.mjs +4 -4
- package/esm2022/snack-bar/module.mjs +5 -5
- package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
- package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
- package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
- package/esm2022/snack-bar/snack-bar.mjs +4 -4
- package/esm2022/sort/sort-header-intl.mjs +4 -4
- package/esm2022/sort/sort-header.mjs +4 -4
- package/esm2022/sort/sort-module.mjs +5 -5
- package/esm2022/sort/sort.mjs +4 -4
- package/esm2022/stepper/step-content.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +5 -5
- package/esm2022/stepper/step-label.mjs +4 -4
- package/esm2022/stepper/stepper-button.mjs +7 -7
- package/esm2022/stepper/stepper-icon.mjs +4 -4
- package/esm2022/stepper/stepper-intl.mjs +4 -4
- package/esm2022/stepper/stepper-module.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +7 -7
- package/esm2022/table/cell.mjs +22 -22
- package/esm2022/table/module.mjs +5 -5
- package/esm2022/table/row.mjs +22 -22
- package/esm2022/table/table.mjs +7 -7
- package/esm2022/table/text-column.mjs +4 -4
- package/esm2022/tabs/module.mjs +5 -5
- package/esm2022/tabs/paginated-tab-header.mjs +4 -4
- package/esm2022/tabs/tab-body.mjs +7 -7
- package/esm2022/tabs/tab-content.mjs +4 -4
- package/esm2022/tabs/tab-group.mjs +4 -4
- package/esm2022/tabs/tab-header.mjs +4 -4
- package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
- package/esm2022/tabs/tab-label.mjs +4 -4
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
- package/esm2022/tabs/tab.mjs +4 -4
- package/esm2022/toolbar/toolbar-module.mjs +5 -5
- package/esm2022/toolbar/toolbar.mjs +7 -7
- package/esm2022/tooltip/module.mjs +5 -5
- package/esm2022/tooltip/tooltip.mjs +7 -7
- package/esm2022/tree/node.mjs +10 -10
- package/esm2022/tree/outlet.mjs +4 -4
- package/esm2022/tree/padding.mjs +4 -4
- package/esm2022/tree/toggle.mjs +4 -4
- package/esm2022/tree/tree-module.mjs +5 -5
- package/esm2022/tree/tree.mjs +4 -4
- package/fesm2022/autocomplete.mjs +13 -13
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -11
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +10 -10
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +42 -42
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +16 -16
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +40 -40
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +59 -59
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +82 -82
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +72 -43
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +25 -25
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +34 -34
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list.mjs +49 -49
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +16 -16
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +10 -10
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +7 -7
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +7 -7
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +11 -11
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +10 -10
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +22 -22
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +14 -14
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +16 -16
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +22 -22
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +13 -13
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +32 -32
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +40 -40
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +10 -10
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +10 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +31 -14
- package/icon/_icon-theme.scss +2 -2
- package/package.json +7 -7
- package/paginator/_paginator-theme.scss +10 -16
- 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/_progress-bar-theme.scss +27 -9
- package/progress-spinner/_progress-spinner-theme.scss +38 -17
- package/radio/_radio-theme.scss +34 -18
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-add/index.mjs +2 -2
- package/schematics/ng-add/setup-project.js +7 -75
- package/schematics/ng-add/setup-project.mjs +7 -75
- package/schematics/ng-generate/mdc-migration/index_bundled.js +122 -115
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
- package/select/_select-theme.scss +24 -10
- package/slide-toggle/_slide-toggle-theme.scss +29 -9
- package/slider/_slider-theme.scss +28 -11
- package/stepper/_stepper-theme.scss +28 -7
- package/tabs/_tabs-theme.scss +32 -14
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../core/theming/theming';
|
|
3
2
|
@use '../core/theming/inspection';
|
|
4
3
|
@use '../core/typography/typography';
|
|
@@ -7,6 +6,9 @@
|
|
|
7
6
|
@use '../core/tokens/token-utils';
|
|
8
7
|
@use '../core/style/sass-utils';
|
|
9
8
|
|
|
9
|
+
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
10
|
+
/// for the mat-button-toggle.
|
|
11
|
+
/// @param {Map} $theme The theme to generate base styles for.
|
|
10
12
|
@mixin base($theme) {
|
|
11
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
14
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
@@ -25,9 +27,14 @@
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
/// Outputs color theme styles for the mat-button-toggle.
|
|
31
|
+
/// @param {Map} $theme The theme to generate color styles for.
|
|
32
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
33
|
+
/// $color-variant: The color variant to use for the button toggle: primary, secondary, tertiary,
|
|
34
|
+
/// or error (If not specified, default secondary color will be used).
|
|
35
|
+
@mixin color($theme, $options...) {
|
|
29
36
|
@if inspection.get-theme-version($theme) == 1 {
|
|
30
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
|
|
37
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
|
|
31
38
|
}
|
|
32
39
|
@else {
|
|
33
40
|
@include sass-utils.current-selector-or-root() {
|
|
@@ -39,6 +46,8 @@
|
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
|
|
49
|
+
/// Outputs typography theme styles for the mat-button-toggle.
|
|
50
|
+
/// @param {Map} $theme The theme to generate typography styles for.
|
|
42
51
|
@mixin typography($theme) {
|
|
43
52
|
@if inspection.get-theme-version($theme) == 1 {
|
|
44
53
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
@@ -53,6 +62,8 @@
|
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
|
|
65
|
+
/// Outputs density theme styles for the mat-button-toggle.
|
|
66
|
+
/// @param {Map} $theme The theme to generate density styles for.
|
|
56
67
|
@mixin density($theme) {
|
|
57
68
|
@if inspection.get-theme-version($theme) == 1 {
|
|
58
69
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
|
|
@@ -67,10 +78,15 @@
|
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
|
|
70
|
-
|
|
81
|
+
/// Outputs all (base, color, typography, and density) theme styles for the mat-button-toggle.
|
|
82
|
+
/// @param {Map} $theme The theme to generate styles for.
|
|
83
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
84
|
+
/// $color-variant: The color variant to use for the button toggle: primary, secondary, tertiary,
|
|
85
|
+
/// or error (If not specified, default secondary color will be used).
|
|
86
|
+
@mixin theme($theme, $options...) {
|
|
71
87
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') {
|
|
72
88
|
@if inspection.get-theme-version($theme) == 1 {
|
|
73
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme));
|
|
89
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
74
90
|
}
|
|
75
91
|
@else {
|
|
76
92
|
@include base($theme);
|
|
@@ -87,10 +103,9 @@
|
|
|
87
103
|
}
|
|
88
104
|
}
|
|
89
105
|
|
|
90
|
-
@mixin _theme-from-tokens($tokens) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
106
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
107
|
+
$mat-standard-button-toggle-tokens:
|
|
108
|
+
token-utils.get-tokens-for($tokens, tokens-mat-standard-button-toggle.$prefix, $options...);
|
|
109
|
+
@include token-utils.create-token-values(
|
|
110
|
+
tokens-mat-standard-button-toggle.$prefix, $mat-standard-button-toggle-tokens);
|
|
96
111
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
|
|
3
2
|
@use '@material/form-field/form-field-theme' as mdc-form-field-theme;
|
|
4
3
|
@use '../core/style/sass-utils';
|
|
5
4
|
@use '../core/theming/theming';
|
|
6
5
|
@use '../core/theming/inspection';
|
|
6
|
+
@use '../core/tokens/token-utils';
|
|
7
7
|
@use '../core/typography/typography';
|
|
8
|
-
@use '../core/mdc-helpers/mdc-helpers';
|
|
9
8
|
@use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
|
|
10
9
|
@use '../core/tokens/m2/mdc/form-field' as tokens-mdc-form-field;
|
|
10
|
+
@use '../core/tokens/m2/mat/checkbox' as tokens-mat-checkbox;
|
|
11
11
|
|
|
12
|
+
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
13
|
+
/// for the mat-checkbox.
|
|
14
|
+
/// @param {Map} $theme The theme to generate base styles for.
|
|
12
15
|
@mixin base($theme) {
|
|
13
16
|
@if inspection.get-theme-version($theme) == 1 {
|
|
14
17
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
@@ -16,17 +19,26 @@
|
|
|
16
19
|
@else {
|
|
17
20
|
@include sass-utils.current-selector-or-root() {
|
|
18
21
|
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-unthemable-tokens());
|
|
22
|
+
@include token-utils.create-token-values(
|
|
23
|
+
tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-unthemable-tokens());
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
/// Outputs color theme styles for the mat-checkbox.
|
|
29
|
+
/// @param {Map} $theme The theme to generate color styles for.
|
|
30
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
31
|
+
/// $color-variant: The color variant to use for the checkbox: primary, secondary, tertiary, or
|
|
32
|
+
/// error (If not specified, default primary color will be used).
|
|
33
|
+
@mixin color($theme, $options...) {
|
|
24
34
|
@if inspection.get-theme-version($theme) == 1 {
|
|
25
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
|
|
35
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
|
|
26
36
|
}
|
|
27
37
|
@else {
|
|
28
38
|
@include sass-utils.current-selector-or-root() {
|
|
29
39
|
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme));
|
|
40
|
+
@include token-utils.create-token-values(
|
|
41
|
+
tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-color-tokens($theme));
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
.mat-mdc-checkbox {
|
|
@@ -39,15 +51,12 @@
|
|
|
39
51
|
&.mat-warn {
|
|
40
52
|
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-color-tokens($theme, warn));
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
&.mat-mdc-checkbox-disabled label {
|
|
44
|
-
// MDC should set the disabled color on the label, but doesn't, so we do it here instead.
|
|
45
|
-
color: inspection.get-theme-color($theme, foreground, disabled-text);
|
|
46
|
-
}
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
57
|
|
|
58
|
+
/// Outputs typography theme styles for the mat-checkbox.
|
|
59
|
+
/// @param {Map} $theme The theme to generate typography styles for.
|
|
51
60
|
@mixin typography($theme) {
|
|
52
61
|
@if inspection.get-theme-version($theme) == 1 {
|
|
53
62
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
@@ -55,6 +64,8 @@
|
|
|
55
64
|
@else {
|
|
56
65
|
@include sass-utils.current-selector-or-root() {
|
|
57
66
|
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-typography-tokens($theme));
|
|
67
|
+
@include token-utils.create-token-values(
|
|
68
|
+
tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-typography-tokens($theme));
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
.mat-mdc-checkbox {
|
|
@@ -63,6 +74,8 @@
|
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
|
|
77
|
+
/// Outputs density theme styles for the mat-checkbox.
|
|
78
|
+
/// @param {Map} $theme The theme to generate density styles for.
|
|
66
79
|
@mixin density($theme) {
|
|
67
80
|
$density-scale: inspection.get-theme-density($theme);
|
|
68
81
|
|
|
@@ -72,20 +85,21 @@
|
|
|
72
85
|
@else {
|
|
73
86
|
@include sass-utils.current-selector-or-root() {
|
|
74
87
|
@include mdc-checkbox-theme.theme(tokens-mdc-checkbox.get-density-tokens($theme));
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@include mdc-helpers.if-touch-targets-unsupported($density-scale) {
|
|
78
|
-
.mat-mdc-checkbox-touch-target {
|
|
79
|
-
display: none;
|
|
80
|
-
}
|
|
88
|
+
@include token-utils.create-token-values(
|
|
89
|
+
tokens-mat-checkbox.$prefix, tokens-mat-checkbox.get-density-tokens($theme));
|
|
81
90
|
}
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
|
|
85
|
-
|
|
94
|
+
/// Outputs all (base, color, typography, and density) theme styles for the mat-checkbox.
|
|
95
|
+
/// @param {Map} $theme The theme to generate styles for.
|
|
96
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
97
|
+
/// $color-variant: The color variant to use for the checkbox: primary, secondary, tertiary, or
|
|
98
|
+
/// error (If not specified, default primary color will be used).
|
|
99
|
+
@mixin theme($theme, $options...) {
|
|
86
100
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-checkbox') {
|
|
87
101
|
@if inspection.get-theme-version($theme) == 1 {
|
|
88
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme));
|
|
102
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
89
103
|
}
|
|
90
104
|
@else {
|
|
91
105
|
@include base($theme);
|
|
@@ -102,10 +116,14 @@
|
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
105
|
-
@mixin _theme-from-tokens($tokens) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
120
|
+
$mdc-checkbox-tokens: token-utils.get-tokens-for(
|
|
121
|
+
$tokens, tokens-mdc-checkbox.$prefix, $options...);
|
|
122
|
+
// Don't pass $options here, since the mdc-form-field doesn't support color options,
|
|
123
|
+
// only the mdc-checkbox does.
|
|
124
|
+
$mdc-form-field-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-form-field.$prefix);
|
|
125
|
+
$mat-checkbox-tokens: token-utils.get-tokens-for($tokens, tokens-mat-checkbox.$prefix);
|
|
126
|
+
@include mdc-checkbox-theme.theme($mdc-checkbox-tokens);
|
|
127
|
+
@include mdc-form-field-theme.theme($mdc-form-field-tokens);
|
|
128
|
+
@include token-utils.create-token-values(tokens-mat-checkbox.$prefix, $mat-checkbox-tokens);
|
|
111
129
|
}
|
package/chips/_chips-theme.scss
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use 'sass:color';
|
|
3
2
|
@use '@material/chips/chip-theme' as mdc-chip-theme;
|
|
4
3
|
@use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
|
|
4
|
+
@use '../core/tokens/token-utils';
|
|
5
5
|
@use '../core/theming/theming';
|
|
6
6
|
@use '../core/theming/inspection';
|
|
7
7
|
@use '../core/typography/typography';
|
|
8
8
|
|
|
9
|
+
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
10
|
+
/// for the mat-chips.
|
|
11
|
+
/// @param {Map} $theme The theme to generate base styles for.
|
|
9
12
|
@mixin base($theme) {
|
|
10
13
|
@if inspection.get-theme-version($theme) == 1 {
|
|
11
14
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
@@ -17,9 +20,14 @@
|
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
/// Outputs color theme styles for the mat-chips.
|
|
24
|
+
/// @param {Map} $theme The theme to generate color styles for.
|
|
25
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
26
|
+
/// $color-variant: The color variant to use for the selected chip: primary, secondary, tertiary,
|
|
27
|
+
/// or error (If not specified, default secondary color will be used).
|
|
28
|
+
@mixin color($theme, $options...) {
|
|
21
29
|
@if inspection.get-theme-version($theme) == 1 {
|
|
22
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
|
|
30
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
|
|
23
31
|
}
|
|
24
32
|
@else {
|
|
25
33
|
.mat-mdc-standard-chip {
|
|
@@ -47,6 +55,8 @@
|
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
|
|
58
|
+
/// Outputs typography theme styles for the mat-chips.
|
|
59
|
+
/// @param {Map} $theme The theme to generate typography styles for.
|
|
50
60
|
@mixin typography($theme) {
|
|
51
61
|
@if inspection.get-theme-version($theme) == 1 {
|
|
52
62
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
@@ -60,6 +70,8 @@
|
|
|
60
70
|
}
|
|
61
71
|
}
|
|
62
72
|
|
|
73
|
+
/// Outputs density theme styles for the mat-chips.
|
|
74
|
+
/// @param {Map} $theme The theme to generate density styles for.
|
|
63
75
|
@mixin density($theme) {
|
|
64
76
|
@if inspection.get-theme-version($theme) == 1 {
|
|
65
77
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
|
|
@@ -73,10 +85,15 @@
|
|
|
73
85
|
}
|
|
74
86
|
}
|
|
75
87
|
|
|
76
|
-
|
|
88
|
+
/// Outputs all (base, color, typography, and density) theme styles for the mat-chips.
|
|
89
|
+
/// @param {Map} $theme The theme to generate styles for.
|
|
90
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
91
|
+
/// $color-variant: The color variant to use for the selected chip: primary, secondary, tertiary,
|
|
92
|
+
/// or error (If not specified, default secondary color will be used).
|
|
93
|
+
@mixin theme($theme, $options...) {
|
|
77
94
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') {
|
|
78
95
|
@if inspection.get-theme-version($theme) == 1 {
|
|
79
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme));
|
|
96
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
80
97
|
}
|
|
81
98
|
@else {
|
|
82
99
|
@include base($theme);
|
|
@@ -93,8 +110,7 @@
|
|
|
93
110
|
}
|
|
94
111
|
}
|
|
95
112
|
|
|
96
|
-
@mixin _theme-from-tokens($tokens) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
113
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
114
|
+
$mdc-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-chip.$prefix, $options...);
|
|
115
|
+
@include mdc-chip-theme.theme($mdc-chip-tokens);
|
|
100
116
|
}
|
package/core/_core-theme.scss
CHANGED
|
@@ -10,37 +10,51 @@
|
|
|
10
10
|
@use './typography/typography';
|
|
11
11
|
@use './tokens/token-utils';
|
|
12
12
|
@use './tokens/m2/mat/app' as tokens-mat-app;
|
|
13
|
+
@use './tokens/m2/mat/ripple' as tokens-mat-ripple;
|
|
14
|
+
@use './tokens/m2/mat/option' as tokens-mat-option;
|
|
15
|
+
@use './tokens/m2/mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox;
|
|
16
|
+
@use './tokens/m2/mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox;
|
|
13
17
|
|
|
14
18
|
@mixin base($theme) {
|
|
15
|
-
@
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@
|
|
19
|
-
|
|
19
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
20
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
21
|
+
}
|
|
22
|
+
@else {
|
|
23
|
+
@include ripple-theme.base($theme);
|
|
24
|
+
@include option-theme.base($theme);
|
|
25
|
+
@include optgroup-theme.base($theme);
|
|
26
|
+
@include pseudo-checkbox-theme.base($theme);
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
@mixin color($theme) {
|
|
23
|
-
@
|
|
24
|
-
|
|
25
|
-
@include optgroup-theme.color($theme);
|
|
26
|
-
@include pseudo-checkbox-theme.color($theme);
|
|
27
|
-
@include sass-utils.current-selector-or-root() {
|
|
28
|
-
@include token-utils.create-token-values(tokens-mat-app.$prefix,
|
|
29
|
-
tokens-mat-app.get-color-tokens($theme));
|
|
31
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
32
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
|
|
30
33
|
}
|
|
34
|
+
@else {
|
|
35
|
+
@include ripple-theme.color($theme);
|
|
36
|
+
@include option-theme.color($theme);
|
|
37
|
+
@include optgroup-theme.color($theme);
|
|
38
|
+
@include pseudo-checkbox-theme.color($theme);
|
|
39
|
+
@include sass-utils.current-selector-or-root() {
|
|
40
|
+
@include token-utils.create-token-values(tokens-mat-app.$prefix,
|
|
41
|
+
tokens-mat-app.get-color-tokens($theme));
|
|
42
|
+
}
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
// Provides external CSS classes for each elevation value. Each CSS class is formatted as
|
|
45
|
+
// `mat-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the element is
|
|
46
|
+
// elevated.
|
|
47
|
+
@for $zValue from 0 through 24 {
|
|
48
|
+
$selector: elevation.$prefix + $zValue;
|
|
49
|
+
// We need the `mat-mdc-elevation-specific`, because some MDC mixins
|
|
50
|
+
// come with elevation baked in and we don't have a way of removing it.
|
|
51
|
+
.#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
|
|
52
|
+
@include private.private-theme-elevation($zValue, $theme);
|
|
53
|
+
}
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
|
|
57
|
+
// TODO(crisbeto): move this into the base.
|
|
44
58
|
// Marker that is used to determine whether the user has added a theme to their page.
|
|
45
59
|
@at-root {
|
|
46
60
|
.mat-theme-loaded-marker {
|
|
@@ -50,34 +64,67 @@
|
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
@mixin typography($theme) {
|
|
53
|
-
@
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@
|
|
67
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
68
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
69
|
+
}
|
|
70
|
+
@else {
|
|
71
|
+
@include option-theme.typography($theme);
|
|
72
|
+
@include optgroup-theme.typography($theme);
|
|
73
|
+
@include pseudo-checkbox-theme.typography($theme);
|
|
74
|
+
@include ripple-theme.typography($theme);
|
|
75
|
+
}
|
|
57
76
|
}
|
|
58
77
|
|
|
59
78
|
@mixin density($theme) {
|
|
60
|
-
@
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@
|
|
79
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
80
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
|
|
81
|
+
}
|
|
82
|
+
@else {
|
|
83
|
+
@include option-theme.density($theme);
|
|
84
|
+
@include optgroup-theme.density($theme);
|
|
85
|
+
@include pseudo-checkbox-theme.density($theme);
|
|
86
|
+
@include ripple-theme.density($theme);
|
|
87
|
+
}
|
|
64
88
|
}
|
|
65
89
|
|
|
66
90
|
// Mixin that renders all of the core styles that depend on the theme.
|
|
67
|
-
@mixin theme($theme) {
|
|
91
|
+
@mixin theme($theme, $options...) {
|
|
68
92
|
// Wrap the sub-theme includes in the duplicate theme styles mixin. This ensures that
|
|
69
93
|
// there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then
|
|
70
94
|
// the imported themes (such as `mat-ripple-theme`) should not report again.
|
|
71
95
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
|
|
72
|
-
@
|
|
73
|
-
|
|
74
|
-
@include color($theme);
|
|
75
|
-
}
|
|
76
|
-
@if inspection.theme-has($theme, density) {
|
|
77
|
-
@include density($theme);
|
|
96
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
97
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
78
98
|
}
|
|
79
|
-
@
|
|
80
|
-
@include
|
|
99
|
+
@else {
|
|
100
|
+
@include base($theme);
|
|
101
|
+
@if inspection.theme-has($theme, color) {
|
|
102
|
+
@include color($theme);
|
|
103
|
+
}
|
|
104
|
+
@if inspection.theme-has($theme, density) {
|
|
105
|
+
@include density($theme);
|
|
106
|
+
}
|
|
107
|
+
@if inspection.theme-has($theme, typography) {
|
|
108
|
+
@include typography($theme);
|
|
109
|
+
}
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
112
|
}
|
|
113
|
+
|
|
114
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
115
|
+
$mat-app-tokens: token-utils.get-tokens-for($tokens, tokens-mat-app.$prefix, $options...);
|
|
116
|
+
$mat-ripple-tokens: token-utils.get-tokens-for($tokens, tokens-mat-ripple.$prefix, $options...);
|
|
117
|
+
$mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
|
|
118
|
+
$mat-full-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
|
|
119
|
+
tokens-mat-full-pseudo-checkbox.$prefix, $options...);
|
|
120
|
+
$mat-minimal-pseudo-checkbox-tokens: token-utils.get-tokens-for($tokens,
|
|
121
|
+
tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
|
|
122
|
+
|
|
123
|
+
@include token-utils.create-token-values(tokens-mat-app.$prefix, $mat-app-tokens);
|
|
124
|
+
@include token-utils.create-token-values(tokens-mat-ripple.$prefix, $mat-ripple-tokens);
|
|
125
|
+
@include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
|
|
126
|
+
@include token-utils.create-token-values(tokens-mat-full-pseudo-checkbox.$prefix,
|
|
127
|
+
$mat-full-pseudo-checkbox-tokens);
|
|
128
|
+
@include token-utils.create-token-values(tokens-mat-minimal-pseudo-checkbox.$prefix,
|
|
129
|
+
$mat-minimal-pseudo-checkbox-tokens);
|
|
130
|
+
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
@use '@material/typography' as mdc-typography;
|
|
6
6
|
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
7
7
|
@use '@material/theme/css' as mdc-theme-css;
|
|
8
|
-
@use 'sass:meta';
|
|
9
8
|
|
|
10
9
|
// A set of standard queries to use with MDC's queryable mixins.
|
|
11
10
|
$mdc-base-styles-query: mdc-feature-targeting.without(mdc-feature-targeting.any(color, typography));
|
|
@@ -59,10 +58,3 @@ $mdc-typography-styles-query: typography;
|
|
|
59
58
|
@content;
|
|
60
59
|
mdc-theme-css.$enable-fallback-declarations: $previous-value;
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
// Excludes the passed-in CSS content if the layout is too dense to supports touch targets.
|
|
64
|
-
@mixin if-touch-targets-unsupported($scale) {
|
|
65
|
-
@if ($scale == 'minimum' or (meta.type-of($scale) == 'number' and $scale < -1)) {
|
|
66
|
-
@content;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../tokens/m2/mat/option' as tokens-mat-option;
|
|
3
2
|
@use '../tokens/token-utils';
|
|
4
3
|
@use '../style/sass-utils';
|
|
@@ -6,6 +5,9 @@
|
|
|
6
5
|
@use '../theming/inspection';
|
|
7
6
|
@use '../typography/typography';
|
|
8
7
|
|
|
8
|
+
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
9
|
+
/// for the mat-option.
|
|
10
|
+
/// @param {Map} $theme The theme to generate base styles for.
|
|
9
11
|
@mixin base($theme) {
|
|
10
12
|
@if inspection.get-theme-version($theme) == 1 {
|
|
11
13
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
@@ -13,9 +15,14 @@
|
|
|
13
15
|
@else {}
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
/// Outputs color theme styles for the mat-option.
|
|
19
|
+
/// @param {Map} $theme The theme to generate color styles for.
|
|
20
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
21
|
+
/// $color-variant: The color variant to use for the selected option: primary, secondary,
|
|
22
|
+
/// tertiary, or error (If not specified, default secondary color will be used).
|
|
23
|
+
@mixin color($theme, $options...) {
|
|
17
24
|
@if inspection.get-theme-version($theme) == 1 {
|
|
18
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
|
|
25
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
|
|
19
26
|
}
|
|
20
27
|
@else {
|
|
21
28
|
@include sass-utils.current-selector-or-root() {
|
|
@@ -35,6 +42,8 @@
|
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
|
|
45
|
+
/// Outputs typography theme styles for the mat-option.
|
|
46
|
+
/// @param {Map} $theme The theme to generate typography styles for.
|
|
38
47
|
@mixin typography($theme) {
|
|
39
48
|
@if inspection.get-theme-version($theme) == 1 {
|
|
40
49
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
@@ -47,6 +56,8 @@
|
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
|
|
59
|
+
/// Outputs density theme styles for the mat-option.
|
|
60
|
+
/// @param {Map} $theme The theme to generate density styles for.
|
|
50
61
|
@mixin density($theme) {
|
|
51
62
|
@if inspection.get-theme-version($theme) == 1 {
|
|
52
63
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
|
|
@@ -54,10 +65,15 @@
|
|
|
54
65
|
@else {}
|
|
55
66
|
}
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
/// Outputs all (base, color, typography, and density) theme styles for the mat-option.
|
|
69
|
+
/// @param {Map} $theme The theme to generate styles for.
|
|
70
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
71
|
+
/// $color-variant: The color variant to use for the selected option: primary, secondary,
|
|
72
|
+
/// tertiary, or error (If not specified, default secondary color will be used).
|
|
73
|
+
@mixin theme($theme, $options...) {
|
|
58
74
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-option') {
|
|
59
75
|
@if inspection.get-theme-version($theme) == 1 {
|
|
60
|
-
@include _theme-from-tokens(inspection.get-theme-tokens($theme));
|
|
76
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
61
77
|
}
|
|
62
78
|
@else {
|
|
63
79
|
@include base($theme);
|
|
@@ -74,9 +90,7 @@
|
|
|
74
90
|
}
|
|
75
91
|
}
|
|
76
92
|
|
|
77
|
-
@mixin _theme-from-tokens($tokens) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
tokens-mat-option.$prefix, map.get($tokens, tokens-mat-option.$prefix));
|
|
81
|
-
}
|
|
93
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
94
|
+
$mat-option-tokens: token-utils.get-tokens-for($tokens, tokens-mat-option.$prefix, $options...);
|
|
95
|
+
@include token-utils.create-token-values(tokens-mat-option.$prefix, $mat-option-tokens);
|
|
82
96
|
}
|
|
@@ -14,43 +14,83 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
@mixin _theme-from-tokens($tokens, $options...) {
|
|
18
|
+
$mat-full-pseudo-checkbox-tokens:
|
|
19
|
+
token-utils.get-tokens-for($tokens, tokens-mat-full-pseudo-checkbox.$prefix, $options...);
|
|
20
|
+
$mat-minimal-pseudo-checkbox-tokens:
|
|
21
|
+
token-utils.get-tokens-for($tokens, tokens-mat-minimal-pseudo-checkbox.$prefix, $options...);
|
|
22
|
+
@include token-utils.create-token-values(
|
|
23
|
+
tokens-mat-full-pseudo-checkbox.$prefix, $mat-full-pseudo-checkbox-tokens);
|
|
24
|
+
@include token-utils.create-token-values(
|
|
25
|
+
tokens-mat-minimal-pseudo-checkbox.$prefix, $mat-minimal-pseudo-checkbox-tokens);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// Outputs base theme styles (styles not dependent on the color, typography, or density settings)
|
|
29
|
+
/// for the mat-pseudo-checkbox.
|
|
30
|
+
/// @param {Map} $theme The theme to generate base styles for.
|
|
17
31
|
@mixin base($theme) {}
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
/// Outputs color theme styles for the mat-pseudo-checkbox.
|
|
34
|
+
/// @param {Map} $theme The theme to generate color styles for.
|
|
35
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
36
|
+
/// $color-variant: The color variant to use for the pseudo-checkbox: primary, secondary,
|
|
37
|
+
/// tertiary, or error (If not specified, default primary color will be used).
|
|
38
|
+
@mixin color($theme, $options...) {
|
|
39
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
40
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
|
|
22
41
|
}
|
|
42
|
+
@else {
|
|
43
|
+
.mat-primary {
|
|
44
|
+
@include _palette-styles($theme, primary);
|
|
45
|
+
}
|
|
23
46
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@include _palette-styles($theme, accent);
|
|
30
|
-
.mat-accent {
|
|
47
|
+
// Default to the accent color. Note that the pseudo checkboxes are meant to inherit the
|
|
48
|
+
// theme from their parent, rather than implementing their own theming, which is why we
|
|
49
|
+
// don't attach to the `mat-*` classes. Also note that this needs to be below `.mat-primary`
|
|
50
|
+
// in order to allow for the color to be overwritten if the checkbox is inside a parent that
|
|
51
|
+
// has `mat-accent` and is placed inside another parent that has `mat-primary`.
|
|
31
52
|
@include _palette-styles($theme, accent);
|
|
32
|
-
|
|
53
|
+
.mat-accent {
|
|
54
|
+
@include _palette-styles($theme, accent);
|
|
55
|
+
}
|
|
33
56
|
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
.mat-warn {
|
|
58
|
+
@include _palette-styles($theme, warn);
|
|
59
|
+
}
|
|
36
60
|
}
|
|
37
61
|
}
|
|
38
62
|
|
|
39
|
-
|
|
63
|
+
/// Outputs typography theme styles for the mat-pseudo-checkbox.
|
|
64
|
+
/// @param {Map} $theme The theme to generate typography styles for.
|
|
65
|
+
@mixin typography($theme) {
|
|
66
|
+
}
|
|
40
67
|
|
|
41
|
-
|
|
68
|
+
/// Outputs density theme styles for the mat-pseudo-checkbox.
|
|
69
|
+
/// @param {Map} $theme The theme to generate density styles for.
|
|
70
|
+
@mixin density($theme) {
|
|
71
|
+
}
|
|
42
72
|
|
|
43
|
-
|
|
73
|
+
/// Outputs all (base, color, typography, and density) theme styles for the mat-pseudo-checkbox.
|
|
74
|
+
/// @param {Map} $theme The theme to generate styles for.
|
|
75
|
+
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
76
|
+
/// $color-variant: The color variant to use for the pseudo-checkbox: primary, secondary,
|
|
77
|
+
/// tertiary, or error (If not specified, default primary color will be used).
|
|
78
|
+
@mixin theme($theme, $options...) {
|
|
44
79
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') {
|
|
45
|
-
@
|
|
46
|
-
|
|
47
|
-
@include color($theme);
|
|
48
|
-
}
|
|
49
|
-
@if inspection.theme-has($theme, density) {
|
|
50
|
-
@include density($theme);
|
|
80
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
81
|
+
@include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
|
|
51
82
|
}
|
|
52
|
-
@
|
|
53
|
-
@include
|
|
83
|
+
@else {
|
|
84
|
+
@include base($theme);
|
|
85
|
+
@if inspection.theme-has($theme, color) {
|
|
86
|
+
@include color($theme);
|
|
87
|
+
}
|
|
88
|
+
@if inspection.theme-has($theme, density) {
|
|
89
|
+
@include density($theme);
|
|
90
|
+
}
|
|
91
|
+
@if inspection.theme-has($theme, typography) {
|
|
92
|
+
@include typography($theme);
|
|
93
|
+
}
|
|
54
94
|
}
|
|
55
95
|
}
|
|
56
96
|
}
|