@angular/material 18.0.0-next.4 → 18.0.0-next.6
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 +67 -60
- package/autocomplete/_autocomplete-theme.scss +7 -0
- package/autocomplete/index.d.ts +4 -12
- package/badge/_badge-theme.scss +9 -0
- package/bottom-sheet/_bottom-sheet-theme.scss +7 -0
- package/button/_button-theme.scss +25 -0
- package/button/_fab-theme.scss +13 -0
- package/button/_icon-button-theme.scss +8 -0
- package/button-toggle/_button-toggle-theme.scss +12 -0
- package/card/_card-theme.scss +9 -0
- package/checkbox/_checkbox-theme.scss +2 -4
- package/chips/_chips-theme.scss +10 -0
- package/core/_core-theme.scss +17 -0
- package/core/m2/_index.scss +52 -0
- package/core/m2/_theming.scss +295 -0
- package/core/{typography/_property-getters.scss → m2/_typography-utils.scss} +14 -0
- package/core/{typography/_definition.scss → m2/_typography.scss} +1 -1
- package/core/option/_optgroup-theme.scss +7 -0
- package/core/option/_option-theme.scss +9 -0
- package/core/ripple/_ripple-theme.scss +7 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +13 -0
- package/core/style/_sass-utils.scss +14 -1
- package/core/theming/_color-api-backwards-compatibility.scss +128 -0
- package/core/theming/_config-validation.scss +173 -0
- package/core/theming/_definition.scss +113 -0
- package/core/theming/_m2-inspection.scss +23 -22
- package/core/theming/_palettes.scss +947 -0
- package/core/theming/_theming-deprecated.scss +9 -9
- package/core/theming/_theming.scss +73 -339
- package/core/tokens/_custom-tokens.scss +1918 -0
- package/core/tokens/_density.scss +191 -0
- package/core/tokens/_format-tokens.scss +5 -0
- package/core/tokens/_m3-tokens.scss +1252 -0
- package/core/tokens/_token-utils.scss +39 -49
- package/core/tokens/m2/mat/_chip.scss +3 -3
- package/core/tokens/m2/mat/_form-field.scss +3 -3
- package/core/tokens/m2/mdc/_checkbox.scss +3 -2
- package/core/tokens/m2/mdc/_chip.scss +3 -3
- package/core/tokens/m2/mdc/_radio.scss +3 -2
- package/core/typography/_all-typography.scss +3 -2
- package/core/typography/_typography-utils.scss +0 -26
- package/core/typography/_typography.scss +0 -2
- package/core/typography/_versioning.scss +3 -3
- package/datepicker/_datepicker-theme.scss +9 -0
- package/datepicker/index.d.ts +6 -4
- package/dialog/_dialog-theme.scss +8 -0
- package/divider/_divider-theme.scss +7 -0
- package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
- package/esm2022/autocomplete/autocomplete-trigger.mjs +13 -7
- package/esm2022/autocomplete/autocomplete.mjs +7 -36
- package/esm2022/autocomplete/module.mjs +4 -4
- package/esm2022/badge/badge-module.mjs +4 -4
- package/esm2022/badge/badge.mjs +6 -6
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
- package/esm2022/bottom-sheet/bottom-sheet-module.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet.mjs +3 -3
- package/esm2022/button/button-base.mjs +6 -6
- package/esm2022/button/button.mjs +6 -6
- package/esm2022/button/fab.mjs +12 -12
- package/esm2022/button/icon-button.mjs +6 -6
- package/esm2022/button/module.mjs +4 -4
- package/esm2022/button-toggle/button-toggle-module.mjs +4 -4
- package/esm2022/button-toggle/button-toggle.mjs +6 -6
- package/esm2022/card/card.mjs +42 -42
- package/esm2022/card/module.mjs +4 -4
- package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
- package/esm2022/checkbox/checkbox.mjs +3 -3
- package/esm2022/checkbox/module.mjs +8 -8
- package/esm2022/chips/chip-action.mjs +3 -3
- package/esm2022/chips/chip-edit-input.mjs +3 -3
- package/esm2022/chips/chip-grid.mjs +3 -3
- package/esm2022/chips/chip-icons.mjs +9 -9
- package/esm2022/chips/chip-input.mjs +3 -3
- package/esm2022/chips/chip-listbox.mjs +3 -3
- package/esm2022/chips/chip-option.mjs +3 -3
- package/esm2022/chips/chip-row.mjs +3 -3
- package/esm2022/chips/chip-set.mjs +3 -3
- package/esm2022/chips/chip.mjs +3 -3
- package/esm2022/chips/module.mjs +4 -4
- package/esm2022/core/common-behaviors/common-module.mjs +4 -4
- package/esm2022/core/datetime/index.mjs +8 -8
- package/esm2022/core/datetime/native-date-adapter.mjs +3 -3
- package/esm2022/core/error/error-options.mjs +6 -6
- package/esm2022/core/internal-form-field/internal-form-field.mjs +3 -3
- package/esm2022/core/line/line.mjs +7 -7
- package/esm2022/core/option/index.mjs +4 -4
- package/esm2022/core/option/optgroup.mjs +3 -3
- package/esm2022/core/option/option.mjs +3 -3
- package/esm2022/core/private/ripple-loader.mjs +3 -3
- package/esm2022/core/ripple/index.mjs +4 -4
- package/esm2022/core/ripple/ripple.mjs +3 -3
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +3 -3
- package/esm2022/datepicker/calendar.mjs +6 -6
- package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
- package/esm2022/datepicker/date-range-input.mjs +9 -4
- package/esm2022/datepicker/date-range-picker.mjs +3 -3
- package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
- package/esm2022/datepicker/date-selection-model.mjs +9 -9
- package/esm2022/datepicker/datepicker-actions.mjs +9 -9
- package/esm2022/datepicker/datepicker-base.mjs +10 -13
- package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
- package/esm2022/datepicker/datepicker-input.mjs +3 -3
- package/esm2022/datepicker/datepicker-intl.mjs +3 -3
- package/esm2022/datepicker/datepicker-module.mjs +4 -4
- package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
- package/esm2022/datepicker/datepicker.mjs +3 -3
- package/esm2022/datepicker/month-view.mjs +3 -3
- package/esm2022/datepicker/multi-year-view.mjs +3 -3
- package/esm2022/datepicker/year-view.mjs +3 -3
- package/esm2022/dialog/dialog-container.mjs +3 -3
- package/esm2022/dialog/dialog-content-directives.mjs +15 -15
- package/esm2022/dialog/dialog.mjs +3 -3
- package/esm2022/dialog/module.mjs +4 -4
- package/esm2022/divider/divider-module.mjs +4 -4
- package/esm2022/divider/divider.mjs +3 -3
- package/esm2022/expansion/accordion.mjs +3 -3
- package/esm2022/expansion/expansion-module.mjs +4 -4
- package/esm2022/expansion/expansion-panel-content.mjs +3 -3
- package/esm2022/expansion/expansion-panel-header.mjs +9 -9
- package/esm2022/expansion/expansion-panel.mjs +6 -6
- package/esm2022/form-field/directives/error.mjs +3 -3
- package/esm2022/form-field/directives/floating-label.mjs +3 -3
- package/esm2022/form-field/directives/hint.mjs +3 -3
- package/esm2022/form-field/directives/label.mjs +3 -3
- package/esm2022/form-field/directives/line-ripple.mjs +3 -3
- package/esm2022/form-field/directives/notched-outline.mjs +3 -3
- package/esm2022/form-field/directives/prefix.mjs +3 -3
- package/esm2022/form-field/directives/suffix.mjs +3 -3
- package/esm2022/form-field/form-field-control.mjs +4 -4
- package/esm2022/form-field/form-field.mjs +6 -6
- package/esm2022/form-field/module.mjs +4 -4
- package/esm2022/grid-list/grid-list-module.mjs +4 -4
- package/esm2022/grid-list/grid-list.mjs +3 -3
- package/esm2022/grid-list/grid-tile.mjs +15 -15
- package/esm2022/icon/icon-module.mjs +4 -4
- package/esm2022/icon/icon-registry.mjs +3 -3
- package/esm2022/icon/icon.mjs +3 -3
- package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
- package/esm2022/input/input.mjs +3 -3
- package/esm2022/input/module.mjs +4 -4
- package/esm2022/list/action-list.mjs +3 -3
- package/esm2022/list/list-base.mjs +6 -6
- package/esm2022/list/list-item-sections.mjs +18 -18
- package/esm2022/list/list-module.mjs +4 -4
- package/esm2022/list/list-option.mjs +3 -3
- package/esm2022/list/list.mjs +6 -6
- package/esm2022/list/nav-list.mjs +3 -3
- package/esm2022/list/selection-list.mjs +3 -3
- package/esm2022/list/subheader.mjs +3 -3
- package/esm2022/menu/menu-content.mjs +3 -3
- package/esm2022/menu/menu-item.mjs +3 -3
- package/esm2022/menu/menu-trigger.mjs +3 -3
- package/esm2022/menu/menu.mjs +21 -16
- package/esm2022/menu/module.mjs +4 -4
- package/esm2022/paginator/module.mjs +4 -4
- package/esm2022/paginator/paginator-intl.mjs +3 -3
- package/esm2022/paginator/paginator.mjs +3 -3
- package/esm2022/progress-bar/module.mjs +4 -4
- package/esm2022/progress-bar/progress-bar.mjs +5 -5
- package/esm2022/progress-spinner/module.mjs +4 -4
- package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
- package/esm2022/radio/module.mjs +4 -4
- package/esm2022/radio/radio.mjs +6 -6
- package/esm2022/select/module.mjs +4 -4
- package/esm2022/select/select.mjs +12 -7
- package/esm2022/sidenav/drawer.mjs +9 -9
- package/esm2022/sidenav/sidenav-module.mjs +4 -4
- package/esm2022/sidenav/sidenav.mjs +9 -9
- package/esm2022/slide-toggle/module.mjs +8 -8
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
- package/esm2022/slider/module.mjs +4 -4
- package/esm2022/slider/slider-input.mjs +6 -6
- package/esm2022/slider/slider-thumb.mjs +3 -3
- package/esm2022/slider/slider.mjs +3 -3
- package/esm2022/snack-bar/module.mjs +4 -4
- package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
- package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
- package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
- package/esm2022/snack-bar/snack-bar.mjs +3 -3
- package/esm2022/sort/sort-header-intl.mjs +3 -3
- package/esm2022/sort/sort-header.mjs +3 -3
- package/esm2022/sort/sort-module.mjs +4 -4
- package/esm2022/sort/sort.mjs +3 -3
- package/esm2022/stepper/step-content.mjs +3 -3
- package/esm2022/stepper/step-header.mjs +3 -3
- package/esm2022/stepper/step-label.mjs +3 -3
- package/esm2022/stepper/stepper-button.mjs +6 -6
- package/esm2022/stepper/stepper-icon.mjs +3 -3
- package/esm2022/stepper/stepper-intl.mjs +3 -3
- package/esm2022/stepper/stepper-module.mjs +4 -4
- package/esm2022/stepper/stepper.mjs +6 -6
- package/esm2022/table/cell.mjs +21 -21
- package/esm2022/table/module.mjs +4 -4
- package/esm2022/table/row.mjs +21 -21
- package/esm2022/table/table.mjs +6 -6
- package/esm2022/table/text-column.mjs +3 -3
- package/esm2022/tabs/ink-bar.mjs +3 -3
- package/esm2022/tabs/module.mjs +4 -4
- package/esm2022/tabs/paginated-tab-header.mjs +3 -3
- package/esm2022/tabs/tab-body.mjs +6 -6
- package/esm2022/tabs/tab-content.mjs +3 -3
- package/esm2022/tabs/tab-group.mjs +6 -8
- package/esm2022/tabs/tab-header.mjs +3 -3
- package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
- package/esm2022/tabs/tab-label.mjs +3 -3
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +9 -9
- package/esm2022/tabs/tab.mjs +4 -4
- package/esm2022/toolbar/toolbar-module.mjs +4 -4
- package/esm2022/toolbar/toolbar.mjs +6 -6
- package/esm2022/tooltip/module.mjs +4 -4
- package/esm2022/tooltip/tooltip.mjs +6 -6
- package/esm2022/tree/node.mjs +9 -9
- package/esm2022/tree/outlet.mjs +3 -3
- package/esm2022/tree/padding.mjs +3 -3
- package/esm2022/tree/toggle.mjs +3 -3
- package/esm2022/tree/tree-module.mjs +4 -4
- package/esm2022/tree/tree.mjs +3 -3
- package/expansion/_expansion-theme.scss +7 -0
- package/fesm2022/autocomplete.mjs +26 -48
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/button-toggle.mjs +10 -10
- package/fesm2022/button.mjs +34 -34
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/checkbox.mjs +14 -14
- package/fesm2022/chips.mjs +40 -40
- package/fesm2022/core.mjs +59 -59
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +89 -87
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +25 -25
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/expansion.mjs +25 -25
- package/fesm2022/form-field.mjs +36 -36
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/list.mjs +49 -49
- package/fesm2022/menu.mjs +34 -28
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +10 -10
- package/fesm2022/progress-bar.mjs +8 -8
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +7 -7
- package/fesm2022/radio.mjs +10 -10
- package/fesm2022/select.mjs +15 -10
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +22 -22
- package/fesm2022/slide-toggle.mjs +14 -14
- package/fesm2022/slider.mjs +16 -16
- package/fesm2022/snack-bar.mjs +22 -22
- package/fesm2022/sort.mjs +13 -13
- package/fesm2022/stepper.mjs +31 -31
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/tabs.mjs +46 -47
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +10 -10
- package/fesm2022/tooltip.mjs +10 -10
- package/fesm2022/tree.mjs +25 -25
- package/form-field/_form-field-theme.scss +15 -0
- package/form-field/index.d.ts +6 -0
- package/grid-list/_grid-list-theme.scss +7 -0
- package/icon/_icon-theme.scss +9 -0
- package/input/_input-theme.scss +8 -0
- package/list/_list-theme.scss +8 -0
- package/menu/_menu-theme.scss +7 -0
- package/menu/index.d.ts +1 -1
- package/package.json +3 -2
- package/paginator/_paginator-theme.scss +7 -0
- package/progress-bar/_progress-bar-theme.scss +11 -0
- package/progress-spinner/_progress-spinner-theme.scss +11 -0
- package/radio/_radio-theme.scss +10 -0
- package/schematics/collection.json +6 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js +5 -6
- package/schematics/ng-add/theming/create-custom-theme.mjs +5 -6
- package/schematics/ng-generate/m3-theme/index_bundled.js +2682 -0
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +7 -0
- package/schematics/ng-generate/m3-theme/schema.json +56 -0
- package/schematics/ng-update/index_bundled.js +215 -1
- package/schematics/ng-update/index_bundled.js.map +4 -4
- package/select/_select-theme.scss +9 -0
- package/select/index.d.ts +5 -0
- package/sidenav/_sidenav-theme.scss +7 -0
- package/slide-toggle/_slide-toggle-theme.scss +11 -0
- package/slider/_slider-theme.scss +10 -0
- package/snack-bar/_snack-bar-theme.scss +10 -0
- package/sort/_sort-theme.scss +7 -0
- package/stepper/_stepper-theme.scss +9 -0
- package/table/_table-theme.scss +7 -0
- package/tabs/_tabs-theme.scss +20 -0
- package/tabs/index.d.ts +2 -8
- package/toolbar/_toolbar-theme.scss +9 -0
- package/tooltip/_tooltip-theme.scss +8 -0
- package/tree/_tree-theme.scss +7 -0
- /package/core/{theming → m2}/_palette.scss +0 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use '../theming/theming';
|
|
5
|
+
@use './palette';
|
|
6
|
+
|
|
7
|
+
/// Extracts a color from a palette or throws an error if it doesn't exist.
|
|
8
|
+
/// @param {Map} $palette The palette from which to extract a color.
|
|
9
|
+
/// @param {String | Number} $hue The hue for which to get the color.
|
|
10
|
+
@function _get-color-from-palette($palette, $hue) {
|
|
11
|
+
@if map.has-key($palette, $hue) {
|
|
12
|
+
@return map.get($palette, $hue);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@error 'Hue "' + $hue + '" does not exist in palette. Available hues are: ' + map.keys($palette);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// For a given hue in a palette, return the contrast color from the map of contrast palettes.
|
|
19
|
+
/// @param {Map} $palette The palette from which to extract a color.
|
|
20
|
+
/// @param {String | Number} $hue The hue for which to get a contrast color.
|
|
21
|
+
/// @returns {Color} The contrast color for the given palette and hue.
|
|
22
|
+
@function get-contrast-color-from-palette($palette, $hue) {
|
|
23
|
+
@return map.get(map.get($palette, contrast), $hue);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
|
|
28
|
+
/// of the Material Design hues.
|
|
29
|
+
/// @param {Map} $base-palette Map of hue keys to color values for the basis for this palette.
|
|
30
|
+
/// @param {String | Number} $default Default hue for this palette.
|
|
31
|
+
/// @param {String | Number} $lighter "lighter" hue for this palette.
|
|
32
|
+
/// @param {String | Number} $darker "darker" hue for this palette.
|
|
33
|
+
/// @param {String | Number} $text "text" hue for this palette.
|
|
34
|
+
/// @returns {Map} A complete Angular Material theming palette.
|
|
35
|
+
@function define-palette($base-palette, $default: 500, $lighter: 100, $darker: 700,
|
|
36
|
+
$text: $default) {
|
|
37
|
+
$result: map.merge($base-palette, (
|
|
38
|
+
default: _get-color-from-palette($base-palette, $default),
|
|
39
|
+
lighter: _get-color-from-palette($base-palette, $lighter),
|
|
40
|
+
darker: _get-color-from-palette($base-palette, $darker),
|
|
41
|
+
text: _get-color-from-palette($base-palette, $text),
|
|
42
|
+
default-contrast: get-contrast-color-from-palette($base-palette, $default),
|
|
43
|
+
lighter-contrast: get-contrast-color-from-palette($base-palette, $lighter),
|
|
44
|
+
darker-contrast: get-contrast-color-from-palette($base-palette, $darker)
|
|
45
|
+
));
|
|
46
|
+
|
|
47
|
+
// For each hue in the palette, add a "-contrast" color to the map.
|
|
48
|
+
@each $hue, $color in $base-palette {
|
|
49
|
+
$result: map.merge($result, (
|
|
50
|
+
'#{$hue}-contrast': get-contrast-color-from-palette($base-palette, $hue)
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@return $result;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/// Gets a color from a theme palette (the output of mat-palette).
|
|
59
|
+
/// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
|
|
60
|
+
/// hues (default, lighter, darker), or any of the aforementioned suffixed with "-contrast".
|
|
61
|
+
///
|
|
62
|
+
/// @param {Map} $palette The palette from which to extract a color.
|
|
63
|
+
/// @param {String | Number} $hue The hue from the palette to use. If this is a value between 0
|
|
64
|
+
// and 1, it will be treated as opacity.
|
|
65
|
+
/// @param {Number} $opacity The alpha channel value for the color.
|
|
66
|
+
/// @returns {Color} The color for the given palette, hue, and opacity.
|
|
67
|
+
@function get-color-from-palette($palette, $hue: default, $opacity: null) {
|
|
68
|
+
// If hueKey is a number between zero and one, then it actually contains an
|
|
69
|
+
// opacity value, so recall this function with the default hue and that given opacity.
|
|
70
|
+
@if meta.type-of($hue) == number and $hue >= 0 and $hue <= 1 {
|
|
71
|
+
@return get-color-from-palette($palette, default, $hue);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// We cast the $hue to a string, because some hues starting with a number, like `700-contrast`,
|
|
75
|
+
// might be inferred as numbers by Sass. Casting them to string fixes the map lookup.
|
|
76
|
+
$color: if(map.has-key($palette, $hue), map.get($palette, $hue), map.get($palette, $hue + ''));
|
|
77
|
+
|
|
78
|
+
@if (meta.type-of($color) != color) {
|
|
79
|
+
// If the $color resolved to something different from a color (e.g. a CSS variable),
|
|
80
|
+
// we can't apply the opacity anyway so we return the value as is, otherwise Sass can
|
|
81
|
+
// throw an error or output something invalid.
|
|
82
|
+
@return $color;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@return rgba($color, if($opacity == null, opacity($color), $opacity));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Validates the specified theme by ensuring that the optional color config defines
|
|
89
|
+
// a primary, accent and warn palette. Returns the theme if no failures were found.
|
|
90
|
+
@function _mat-validate-theme($theme) {
|
|
91
|
+
@if map.get($theme, color) {
|
|
92
|
+
$color: map.get($theme, color);
|
|
93
|
+
@if not map.get($color, primary) {
|
|
94
|
+
@error 'Theme does not define a valid "primary" palette.';
|
|
95
|
+
}
|
|
96
|
+
@else if not map.get($color, accent) {
|
|
97
|
+
@error 'Theme does not define a valid "accent" palette.';
|
|
98
|
+
}
|
|
99
|
+
@else if not map.get($color, warn) {
|
|
100
|
+
@error 'Theme does not define a valid "warn" palette.';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
@return $theme;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Creates a light-themed color configuration from the specified
|
|
107
|
+
// primary, accent and warn palettes.
|
|
108
|
+
@function _mat-create-light-color-config($primary, $accent, $warn: null) {
|
|
109
|
+
@return (
|
|
110
|
+
primary: $primary,
|
|
111
|
+
accent: $accent,
|
|
112
|
+
warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
|
|
113
|
+
is-dark: false,
|
|
114
|
+
foreground: palette.$light-theme-foreground-palette,
|
|
115
|
+
background: palette.$light-theme-background-palette,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Creates a dark-themed color configuration from the specified
|
|
120
|
+
// primary, accent and warn palettes.
|
|
121
|
+
@function _mat-create-dark-color-config($primary, $accent, $warn: null) {
|
|
122
|
+
@return (
|
|
123
|
+
primary: $primary,
|
|
124
|
+
accent: $accent,
|
|
125
|
+
warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
|
|
126
|
+
is-dark: true,
|
|
127
|
+
foreground: palette.$dark-theme-foreground-palette,
|
|
128
|
+
background: palette.$dark-theme-background-palette,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
|
|
133
|
+
// as it would break existing apps that set the parameter by name.
|
|
134
|
+
|
|
135
|
+
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
136
|
+
/// @param {Map} $primary The theme configuration object.
|
|
137
|
+
/// @returns {Map} A complete Angular Material theme map.
|
|
138
|
+
@function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
139
|
+
// This function creates a container object for the individual component theme mixins. Consumers
|
|
140
|
+
// can construct such an object by calling this function, or by building the object manually.
|
|
141
|
+
// There are two possible ways to invoke this function in order to create such an object:
|
|
142
|
+
//
|
|
143
|
+
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
144
|
+
// theming system. For `color` configurations, the function only expects the palettes
|
|
145
|
+
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
146
|
+
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
147
|
+
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
148
|
+
// as passing in a configuration map because only the `color` system can be configured.
|
|
149
|
+
//
|
|
150
|
+
// If the legacy pattern is used, we generate a container object only with a light-themed
|
|
151
|
+
// configuration for the `color` theming part.
|
|
152
|
+
@if $accent != null {
|
|
153
|
+
@warn theming.$private-legacy-theme-warning;
|
|
154
|
+
$theme: _mat-validate-theme((
|
|
155
|
+
_is-legacy-theme: true,
|
|
156
|
+
color: _mat-create-light-color-config($primary, $accent, $warn),
|
|
157
|
+
));
|
|
158
|
+
|
|
159
|
+
@return _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
160
|
+
}
|
|
161
|
+
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
162
|
+
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
163
|
+
// above, the color shorthand will be expanded to an actual light-themed color configuration.
|
|
164
|
+
$result: $primary;
|
|
165
|
+
@if map.get($primary, color) {
|
|
166
|
+
$color-settings: map.get($primary, color);
|
|
167
|
+
$primary: map.get($color-settings, primary);
|
|
168
|
+
$accent: map.get($color-settings, accent);
|
|
169
|
+
$warn: map.get($color-settings, warn);
|
|
170
|
+
$result: map.merge($result, (color: _mat-create-light-color-config($primary, $accent, $warn)));
|
|
171
|
+
}
|
|
172
|
+
@return _internalize-theme(
|
|
173
|
+
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result)));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
|
|
177
|
+
// as it would break existing apps that set the parameter by name.
|
|
178
|
+
|
|
179
|
+
/// Creates a container object for a dark theme to be given to individual component theme mixins.
|
|
180
|
+
/// @param {Map} $primary The theme configuration object.
|
|
181
|
+
/// @returns {Map} A complete Angular Material theme map.
|
|
182
|
+
@function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
183
|
+
// This function creates a container object for the individual component theme mixins. Consumers
|
|
184
|
+
// can construct such an object by calling this function, or by building the object manually.
|
|
185
|
+
// There are two possible ways to invoke this function in order to create such an object:
|
|
186
|
+
//
|
|
187
|
+
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
188
|
+
// theming system. For `color` configurations, the function only expects the palettes
|
|
189
|
+
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
190
|
+
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
191
|
+
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
192
|
+
// as passing in a configuration map because only the `color` system can be configured.
|
|
193
|
+
//
|
|
194
|
+
// If the legacy pattern is used, we generate a container object only with a dark-themed
|
|
195
|
+
// configuration for the `color` theming part.
|
|
196
|
+
@if $accent != null {
|
|
197
|
+
@warn theming.$private-legacy-theme-warning;
|
|
198
|
+
$theme: _mat-validate-theme((
|
|
199
|
+
_is-legacy-theme: true,
|
|
200
|
+
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
201
|
+
));
|
|
202
|
+
@return _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
203
|
+
}
|
|
204
|
+
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
205
|
+
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
206
|
+
// above, the color shorthand will be expanded to an actual dark-themed color configuration.
|
|
207
|
+
$result: $primary;
|
|
208
|
+
@if map.get($primary, color) {
|
|
209
|
+
$color-settings: map.get($primary, color);
|
|
210
|
+
$primary: map.get($color-settings, primary);
|
|
211
|
+
$accent: map.get($color-settings, accent);
|
|
212
|
+
$warn: map.get($color-settings, warn);
|
|
213
|
+
$result: map.merge($result, (color: _mat-create-dark-color-config($primary, $accent, $warn)));
|
|
214
|
+
}
|
|
215
|
+
@return _internalize-theme(
|
|
216
|
+
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result)));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/// Gets the color configuration from the given theme or configuration.
|
|
220
|
+
/// @param {Map} $theme The theme map returned from `define-light-theme` or `define-dark-theme`.
|
|
221
|
+
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
222
|
+
/// `color` configuration.
|
|
223
|
+
/// @returns {Map} Color configuration for a theme.
|
|
224
|
+
@function get-color-config($theme, $default: null) {
|
|
225
|
+
@return theming.private-get-color-config($theme, $default);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/// Gets the density configuration from the given theme or configuration.
|
|
229
|
+
/// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
|
|
230
|
+
/// `define-dark-theme`.
|
|
231
|
+
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
232
|
+
/// `density` configuration.
|
|
233
|
+
/// @returns {Map} Density configuration for a theme.
|
|
234
|
+
@function get-density-config($theme-or-config, $default: 0) {
|
|
235
|
+
@return theming.private-get-density-config($theme-or-config, $default);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/// Gets the typography configuration from the given theme or configuration.
|
|
239
|
+
/// For backwards compatibility, typography is not included by default.
|
|
240
|
+
/// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
|
|
241
|
+
/// `define-dark-theme`.
|
|
242
|
+
/// @param {Map} $default The default value returned if the given `$theme` does not include a
|
|
243
|
+
/// `typography` configuration.
|
|
244
|
+
/// @returns {Map} Typography configuration for a theme.
|
|
245
|
+
@function get-typography-config($theme-or-config, $default: null) {
|
|
246
|
+
@return theming.private-get-typography-config($theme-or-config, $default);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/// Copies the given theme object and nests it within itself under a secret key and replaces the
|
|
250
|
+
/// original map keys with error values. This allows the inspection API which is aware of the secret
|
|
251
|
+
/// key to access the real values, but attempts to directly access the map will result in errors.
|
|
252
|
+
/// @param {Map} $theme The theme map.
|
|
253
|
+
@function _internalize-theme($theme) {
|
|
254
|
+
@if map.has-key($theme, theming.$private-internal-name) {
|
|
255
|
+
@return $theme;
|
|
256
|
+
}
|
|
257
|
+
$internalized-theme: (
|
|
258
|
+
theming.$private-internal-name: (
|
|
259
|
+
theme-version: 0,
|
|
260
|
+
m2-config: $theme
|
|
261
|
+
)
|
|
262
|
+
);
|
|
263
|
+
@if (theming.$theme-legacy-inspection-api-compatibility) {
|
|
264
|
+
@return map.merge($theme, $internalized-theme);
|
|
265
|
+
}
|
|
266
|
+
$error-theme:
|
|
267
|
+
_replace-values-with-errors($theme, 'Theme may only be accessed via theme inspection API');
|
|
268
|
+
@return map.merge($error-theme, $internalized-theme);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/// Replaces concrete CSS values with errors in a theme object.
|
|
272
|
+
/// Errors are represented as a map `(ERROR: <message>)`. Because maps are not valid CSS values,
|
|
273
|
+
/// the Sass will not compile if the user tries to use any of the error theme values in their CSS.
|
|
274
|
+
/// Users will see a message about `(ERROR: <message>)` not being a valid CSS value. Using the
|
|
275
|
+
/// message, that winds up getting shown, we can help explain to users why they're getting the
|
|
276
|
+
/// error.
|
|
277
|
+
/// @param {*} $value The theme value to replace with errors.
|
|
278
|
+
/// @param {String} $message The error message to sow users.
|
|
279
|
+
/// @return {Map} A version of $value where concrete CSS values have been replaced with errors
|
|
280
|
+
@function _replace-values-with-errors($value, $message) {
|
|
281
|
+
$value-type: meta.type-of($value);
|
|
282
|
+
@if $value-type == 'map' {
|
|
283
|
+
@each $k, $v in $value {
|
|
284
|
+
$value: map.set($value, $k, _replace-values-with-errors($v, $message));
|
|
285
|
+
}
|
|
286
|
+
@return $value;
|
|
287
|
+
}
|
|
288
|
+
@else if $value-type == 'list' and list.length($value) > 0 {
|
|
289
|
+
@for $i from 1 through list.length() {
|
|
290
|
+
$value: list.set-nth($value, $i, _replace-values-with-errors(list.nth($value, $i), $message));
|
|
291
|
+
}
|
|
292
|
+
@return $value;
|
|
293
|
+
}
|
|
294
|
+
@return (ERROR: $message);
|
|
295
|
+
}
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
@use 'sass:meta';
|
|
3
3
|
@use 'sass:string';
|
|
4
4
|
|
|
5
|
+
/// Emits CSS styles for the given typography level.
|
|
6
|
+
/// @param {Map} $config A typography config.
|
|
7
|
+
/// @param {Map} $level A typography level.
|
|
8
|
+
@mixin typography-level($config, $level) {
|
|
9
|
+
// we deliberately do not use the font shorthand here because it overrides
|
|
10
|
+
// certain font properties that can't be configured in the current typography
|
|
11
|
+
// config, e.g. the font-variant-caps or font-feature-settings property
|
|
12
|
+
font-size: font-size($config, $level);
|
|
13
|
+
font-weight: font-weight($config, $level);
|
|
14
|
+
line-height: line-height($config, $level);
|
|
15
|
+
font-family: font-family($config, $level);
|
|
16
|
+
letter-spacing: letter-spacing($config, $level);
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
// Utility for fetching a nested value from a typography config.
|
|
6
20
|
@function _mat-get-type-value($config, $level, $name) {
|
|
7
21
|
@if meta.type-of($config) != 'map' {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
/// @param {Map} $input Configuration for the "input" typographic level.
|
|
49
49
|
/// @returns {Map} A typography config for the application.
|
|
50
50
|
///
|
|
51
|
-
/// @deprecated Use `mat.define-typography-config` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
|
|
51
|
+
/// @deprecated Use `mat.m2-define-typography-config` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
|
|
52
52
|
/// @breaking-change 17.0.0
|
|
53
53
|
@function define-legacy-typography-config(
|
|
54
54
|
$font-family: 'Roboto, "Helvetica Neue", sans-serif',
|
|
@@ -45,6 +45,13 @@
|
|
|
45
45
|
@else {}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
@mixin overrides($tokens: ()) {
|
|
49
|
+
@include token-utils.batch-create-token-values(
|
|
50
|
+
$tokens,
|
|
51
|
+
(prefix: tokens-mat-optgroup.$prefix, tokens: tokens-mat-optgroup.get-token-slots()),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
@mixin theme($theme) {
|
|
49
56
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-optgroup') {
|
|
50
57
|
@if inspection.get-theme-version($theme) == 1 {
|
|
@@ -66,6 +66,15 @@
|
|
|
66
66
|
@else {}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/// Outputs the CSS variable values for the given tokens.
|
|
70
|
+
/// @param {Map} $tokens The token values to emit.
|
|
71
|
+
@mixin overrides($tokens: ()) {
|
|
72
|
+
@include token-utils.batch-create-token-values(
|
|
73
|
+
$tokens,
|
|
74
|
+
(prefix: tokens-mat-option.$prefix, tokens: tokens-mat-option.get-token-slots()),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
69
78
|
/// Outputs all (base, color, typography, and density) theme styles for the mat-option.
|
|
70
79
|
/// @param {Map} $theme The theme to generate styles for.
|
|
71
80
|
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
@mixin overrides($tokens: ()) {
|
|
53
|
+
@include token-utils.batch-create-token-values(
|
|
54
|
+
$tokens,
|
|
55
|
+
(prefix: tokens-mat-ripple.$prefix, tokens: tokens-mat-ripple.get-token-slots()),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
@mixin theme($theme) {
|
|
53
60
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') {
|
|
54
61
|
@if inspection.get-theme-version($theme) == 1 {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
/// @param {Map} $theme The theme to generate base styles for.
|
|
34
34
|
@mixin base($theme) {}
|
|
35
35
|
|
|
36
|
+
/// Outputs the CSS variable values for the given tokens.
|
|
37
|
+
/// @param {Map} $tokens The token values to emit.
|
|
38
|
+
@mixin overrides($tokens: ()) {
|
|
39
|
+
$full-pseudo-checkbox-tokens: tokens-mat-full-pseudo-checkbox.get-token-slots();
|
|
40
|
+
$minimal-pseudo-checkbox-tokens: tokens-mat-minimal-pseudo-checkbox.get-token-slots();
|
|
41
|
+
|
|
42
|
+
@include token-utils.batch-create-token-values(
|
|
43
|
+
$tokens,
|
|
44
|
+
(prefix: tokens-mat-full-pseudo-checkbox.$prefix, tokens: $full-pseudo-checkbox-tokens),
|
|
45
|
+
(prefix: tokens-mat-minimal-pseudo-checkbox.$prefix, tokens: $minimal-pseudo-checkbox-tokens),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
36
49
|
/// Outputs color theme styles for the mat-pseudo-checkbox.
|
|
37
50
|
/// @param {Map} $theme The theme to generate color styles for.
|
|
38
51
|
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
@use 'sass:map';
|
|
4
4
|
@use 'sass:meta';
|
|
5
5
|
|
|
6
|
+
/// Whether our theming API is using --sys- variables for color tokens.
|
|
7
|
+
$use-system-color-variables: false;
|
|
8
|
+
|
|
9
|
+
/// Whether our theming API is using --sys- variables for typography tokens.
|
|
10
|
+
$use-system-typography-variables: false;
|
|
11
|
+
|
|
6
12
|
/// Include content under the current selector (&) or the document root if there is no current
|
|
7
13
|
/// selector.
|
|
8
14
|
/// @param {String} $root [html] The default root selector to use when there is no current selector.
|
|
@@ -58,7 +64,14 @@
|
|
|
58
64
|
/// A version of the Sass `color.change` function that is safe ot use with CSS variables.
|
|
59
65
|
@function safe-color-change($color, $args...) {
|
|
60
66
|
$args: meta.keywords($args);
|
|
61
|
-
@
|
|
67
|
+
@if (meta.type-of($color) == 'color') {
|
|
68
|
+
@return color.change($color, $args...);
|
|
69
|
+
}
|
|
70
|
+
@else if ($color != null and map.get($args, alpha) != null and $use-system-color-variables) {
|
|
71
|
+
$opacity: map.get($args, alpha);
|
|
72
|
+
@return #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)};
|
|
73
|
+
}
|
|
74
|
+
@return $color;
|
|
62
75
|
}
|
|
63
76
|
|
|
64
77
|
/// Gets the given arguments as a map of keywords and validates that only supported arguments were
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@use '../../badge/badge-theme';
|
|
2
|
+
@use '../../button/button-theme';
|
|
3
|
+
@use '../../button/fab-theme';
|
|
4
|
+
@use '../../checkbox/checkbox-theme';
|
|
5
|
+
@use '../../chips/chips-theme';
|
|
6
|
+
@use '../../datepicker/datepicker-theme';
|
|
7
|
+
@use '../../icon/icon-theme';
|
|
8
|
+
@use '../../progress-bar/progress-bar-theme';
|
|
9
|
+
@use '../../progress-spinner/progress-spinner-theme';
|
|
10
|
+
@use '../../radio/radio-theme';
|
|
11
|
+
@use '../../select/select-theme';
|
|
12
|
+
@use '../../slide-toggle/slide-toggle-theme';
|
|
13
|
+
@use '../../slider/slider-theme';
|
|
14
|
+
@use '../../stepper/stepper-theme';
|
|
15
|
+
@use '../../tabs/tabs-theme';
|
|
16
|
+
@use '../../form-field/form-field-theme';
|
|
17
|
+
@use '../option/option-theme';
|
|
18
|
+
@use '../selection/pseudo-checkbox/pseudo-checkbox-theme';
|
|
19
|
+
|
|
20
|
+
// We want to emit only the overrides, because the backwards compatibility styles are usually
|
|
21
|
+
// emitted after all the tokens have been included once already. This allows us to save ~50kb
|
|
22
|
+
// from the bundle.
|
|
23
|
+
$_overrides-only: true;
|
|
24
|
+
|
|
25
|
+
@mixin color-variant-styles($theme, $color-variant) {
|
|
26
|
+
$primary-options: (color-variant: $color-variant, emit-overrides-only: $_overrides-only);
|
|
27
|
+
|
|
28
|
+
// Some components use the secondary color rather than primary color for `.mat-primary`.
|
|
29
|
+
// Those components should use the $secondary-color-variant.
|
|
30
|
+
$secondary-options: (
|
|
31
|
+
color-variant: if($color-variant == primary, secondary, $color-variant),
|
|
32
|
+
emit-overrides-only: $_overrides-only
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
@include option-theme.color($theme, $secondary-options...);
|
|
36
|
+
@include progress-spinner-theme.color($theme, $primary-options...);
|
|
37
|
+
@include pseudo-checkbox-theme.color($theme, $primary-options...);
|
|
38
|
+
@include stepper-theme.color($theme, $primary-options...);
|
|
39
|
+
|
|
40
|
+
&.mat-icon {
|
|
41
|
+
@include icon-theme.color($theme, $primary-options...);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.mat-mdc-checkbox {
|
|
45
|
+
@include checkbox-theme.color($theme, $primary-options...);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.mat-mdc-slider {
|
|
49
|
+
@include slider-theme.color($theme, $primary-options...);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.mat-mdc-tab-group,
|
|
53
|
+
&.mat-mdc-tab-nav-bar {
|
|
54
|
+
@include tabs-theme.color($theme, $primary-options...);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.mat-mdc-slide-toggle {
|
|
58
|
+
@include slide-toggle-theme.color($theme, $primary-options...);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.mat-mdc-form-field {
|
|
62
|
+
@include select-theme.color($theme, $primary-options...);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.mat-mdc-radio-button {
|
|
66
|
+
@include radio-theme.color($theme, $primary-options...);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.mat-mdc-progress-bar {
|
|
70
|
+
@include progress-bar-theme.color($theme, $primary-options...);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.mat-mdc-form-field {
|
|
74
|
+
@include form-field-theme.color($theme, $primary-options...);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.mat-datepicker-content {
|
|
78
|
+
@include datepicker-theme.color($theme, $primary-options...);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.mat-mdc-button-base {
|
|
82
|
+
@include button-theme.color($theme, $primary-options...);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.mat-mdc-standard-chip {
|
|
86
|
+
@include chips-theme.color($theme, $secondary-options...);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mdc-list-item__start,
|
|
90
|
+
.mdc-list-item__end {
|
|
91
|
+
@include checkbox-theme.color($theme, $primary-options...);
|
|
92
|
+
@include radio-theme.color($theme, $primary-options...);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// M3 dropped support for warn/error color FABs.
|
|
96
|
+
@if $color-variant != error {
|
|
97
|
+
&.mat-mdc-fab,
|
|
98
|
+
&.mat-mdc-mini-fab {
|
|
99
|
+
@include fab-theme.color($theme, $primary-options...);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@mixin color-variants-backwards-compatibility($theme) {
|
|
105
|
+
.mat-primary {
|
|
106
|
+
@include color-variant-styles($theme, primary);
|
|
107
|
+
}
|
|
108
|
+
.mat-badge {
|
|
109
|
+
@include badge-theme.color($theme, $color-variant: primary,
|
|
110
|
+
$emit-overrides-only: $_overrides-only);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.mat-accent {
|
|
114
|
+
@include color-variant-styles($theme, tertiary);
|
|
115
|
+
}
|
|
116
|
+
.mat-badge-accent {
|
|
117
|
+
@include badge-theme.color($theme, $color-variant: tertiary,
|
|
118
|
+
$emit-overrides-only: $_overrides-only);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mat-warn {
|
|
122
|
+
@include color-variant-styles($theme, error);
|
|
123
|
+
}
|
|
124
|
+
.mat-badge-warn {
|
|
125
|
+
@include badge-theme.color($theme, $color-variant: error,
|
|
126
|
+
$emit-overrides-only: $_overrides-only);
|
|
127
|
+
}
|
|
128
|
+
}
|