@angular/material 17.1.0 → 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 -180
- package/badge/index.d.ts +11 -1
- 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/index.d.ts +7 -4
- 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/_form-field.scss +15 -0
- 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/_filled-text-field.scss +8 -8
- package/core/tokens/m2/mdc/_icon-button.scss +15 -7
- package/core/tokens/m2/mdc/_outlined-text-field.scss +6 -6
- package/core/tokens/m2/mdc/_switch.scss +12 -3
- 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 +9 -7
- package/esm2022/badge/badge.mjs +32 -6
- package/esm2022/badge/public-api.mjs +2 -2
- 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 +10 -11
- package/esm2022/button/fab.mjs +18 -19
- package/esm2022/button/icon-button.mjs +10 -11
- 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 +7 -8
- 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 +5 -6
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +5 -6
- package/esm2022/chips/module.mjs +5 -5
- package/esm2022/core/common-behaviors/common-module.mjs +5 -5
- package/esm2022/core/common-behaviors/error-state.mjs +2 -4
- 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 +5 -6
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +5 -6
- 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 +17 -7
- 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 +11 -12
- package/esm2022/expansion/expansion-panel.mjs +8 -9
- 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 +7 -8
- 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 +8 -9
- 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 +8 -9
- 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 +5 -6
- package/esm2022/progress-spinner/module.mjs +5 -5
- package/esm2022/progress-spinner/progress-spinner.mjs +5 -6
- package/esm2022/radio/module.mjs +5 -5
- package/esm2022/radio/radio.mjs +9 -10
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +7 -7
- package/esm2022/sidenav/drawer.mjs +11 -12
- 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 +7 -8
- 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 +5 -6
- 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 +5 -6
- package/esm2022/tabs/tab-body.mjs +7 -7
- package/esm2022/tabs/tab-content.mjs +4 -4
- package/esm2022/tabs/tab-group.mjs +5 -6
- package/esm2022/tabs/tab-header.mjs +5 -6
- 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 +11 -12
- 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 +8 -9
- 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 +38 -10
- 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 +43 -44
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +17 -18
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +41 -42
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +62 -65
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +82 -82
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +74 -46
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +26 -27
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +37 -38
- 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 +51 -52
- 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 +8 -9
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +8 -9
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +12 -13
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +10 -10
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +23 -24
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +17 -18
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +17 -18
- 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 +41 -42
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +10 -10
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +11 -12
- 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 +36 -16
- package/slider/_slider-theme.scss +28 -11
- package/stepper/_stepper-theme.scss +28 -7
- package/tabs/_tabs-theme.scss +32 -14
package/core/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare interface CanUpdateErrorState {
|
|
|
77
77
|
/** Whether the component is in an error state. */
|
|
78
78
|
errorState: boolean;
|
|
79
79
|
/** An object used to control the error state of the component. */
|
|
80
|
-
errorStateMatcher:
|
|
80
|
+
errorStateMatcher: ErrorStateMatcher_2;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
declare type CanUpdateErrorStateCtor = _Constructor<CanUpdateErrorState> & _AbstractConstructor<CanUpdateErrorState>;
|
|
@@ -314,6 +314,9 @@ export declare class ErrorStateMatcher {
|
|
|
314
314
|
static ɵprov: i0.ɵɵInjectableDeclaration<ErrorStateMatcher>;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
declare interface ErrorStateMatcher_2 extends ErrorStateMatcher {
|
|
318
|
+
}
|
|
319
|
+
|
|
317
320
|
/**
|
|
318
321
|
* Class that tracks the error state of a component.
|
|
319
322
|
* @docs-private
|
|
@@ -327,8 +330,8 @@ export declare class _ErrorStateTracker {
|
|
|
327
330
|
/** Whether the tracker is currently in an error state. */
|
|
328
331
|
errorState: boolean;
|
|
329
332
|
/** User-defined matcher for the error state. */
|
|
330
|
-
matcher:
|
|
331
|
-
constructor(_defaultMatcher:
|
|
333
|
+
matcher: ErrorStateMatcher_2;
|
|
334
|
+
constructor(_defaultMatcher: ErrorStateMatcher_2 | null, ngControl: NgControl | null, _parentFormGroup: FormGroupDirective | null, _parentForm: NgForm | null, _stateChanges: Subject<void>);
|
|
332
335
|
/** Updates the error state based on the provided error state matcher. */
|
|
333
336
|
updateErrorState(): void;
|
|
334
337
|
}
|
|
@@ -359,7 +362,7 @@ declare interface HasElementRef {
|
|
|
359
362
|
declare interface HasErrorState {
|
|
360
363
|
_parentFormGroup: FormGroupDirective;
|
|
361
364
|
_parentForm: NgForm;
|
|
362
|
-
_defaultErrorStateMatcher:
|
|
365
|
+
_defaultErrorStateMatcher: ErrorStateMatcher_2;
|
|
363
366
|
ngControl: NgControl;
|
|
364
367
|
stateChanges: Subject<void>;
|
|
365
368
|
}
|
|
@@ -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
|
}
|
|
@@ -110,6 +110,28 @@ $_component-prefix: null;
|
|
|
110
110
|
@return mdc-custom-properties.create-varname('#{$_component-prefix}-#{$token}');
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
// TODO(crisbeto): should be able to replace the usages of `get-token-variable` with this.
|
|
114
|
+
// Returns a `var()` reference to a specific token. Intended for declarations
|
|
115
|
+
// where the token has to be referenced as a part of a larger expression.
|
|
116
|
+
@function get-token-variable-reference($token, $emit-fallback: false) {
|
|
117
|
+
@if $_component-prefix == null or $_tokens == null {
|
|
118
|
+
@error '`get-token-variable-reference` must be used within `use-tokens`';
|
|
119
|
+
}
|
|
120
|
+
@if not map.has-key($_tokens, $token) {
|
|
121
|
+
@error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
$var: get-token-variable($token);
|
|
125
|
+
$fallback: if($emit-fallback, map.get($_tokens, $token), null);
|
|
126
|
+
|
|
127
|
+
@if ($fallback != null) {
|
|
128
|
+
@return var($var, $fallback);
|
|
129
|
+
}
|
|
130
|
+
@else {
|
|
131
|
+
@return var($var);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
113
135
|
@mixin create-token-values($prefix, $tokens) {
|
|
114
136
|
@include _configure-token-prefix($prefix...) {
|
|
115
137
|
@include mdc-keys.declare-custom-properties($tokens, $_component-prefix);
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use 'sass:meta';
|
|
3
3
|
@use '../../style/sass-utils';
|
|
4
|
+
@use './mat/app' as tokens-mat-app;
|
|
4
5
|
@use './mat/autocomplete' as tokens-mat-autocomplete;
|
|
5
6
|
@use './mat/badge' as tokens-mat-badge;
|
|
6
7
|
@use './mat/text-button' as tokens-mat-text-button;
|
|
7
8
|
@use './mat/protected-button' as tokens-mat-protected-button;
|
|
8
9
|
@use './mat/filled-button' as tokens-mat-filled-button;
|
|
9
10
|
@use './mat/outlined-button' as tokens-mat-outlined-button;
|
|
11
|
+
@use './mat/dialog' as tokens-mat-dialog;
|
|
10
12
|
@use './mat/bottom-sheet' as tokens-mat-bottom-sheet;
|
|
11
13
|
@use './mat/card' as tokens-mat-card;
|
|
12
14
|
@use './mat/datepicker' as tokens-mat-datepicker;
|
|
13
15
|
@use './mat/divider' as tokens-mat-divider;
|
|
14
16
|
@use './mat/expansion' as tokens-mat-expansion;
|
|
15
17
|
@use './mat/fab' as tokens-mat-fab;
|
|
18
|
+
@use './mat/fab-small' as tokens-mat-fab-small;
|
|
16
19
|
@use './mat/form-field' as tokens-mat-form-field;
|
|
17
20
|
@use './mat/grid-list' as tokens-mat-grid-list;
|
|
18
21
|
@use './mat/icon' as tokens-mat-icon;
|
|
@@ -21,6 +24,9 @@
|
|
|
21
24
|
@use './mat/option' as tokens-mat-option;
|
|
22
25
|
@use './mat/optgroup' as tokens-mat-optgroup;
|
|
23
26
|
@use './mat/paginator' as tokens-mat-paginator;
|
|
27
|
+
@use './mat/checkbox' as tokens-mat-checkbox;
|
|
28
|
+
@use './mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox;
|
|
29
|
+
@use './mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox;
|
|
24
30
|
@use './mat/radio' as tokens-mat-radio;
|
|
25
31
|
@use './mat/ripple' as tokens-mat-ripple;
|
|
26
32
|
@use './mat/select' as tokens-mat-select;
|
|
@@ -46,6 +52,8 @@
|
|
|
46
52
|
@use './mdc/elevated-card' as tokens-mdc-elevated-card;
|
|
47
53
|
@use './mdc/extended-fab' as tokens-mdc-extended-fab;
|
|
48
54
|
@use './mdc/fab' as tokens-mdc-fab;
|
|
55
|
+
@use './mdc/fab-small' as tokens-mdc-fab-small;
|
|
56
|
+
@use './mdc/form-field' as tokens-mdc-form-field;
|
|
49
57
|
@use './mdc/filled-text-field' as tokens-mdc-filled-text-field;
|
|
50
58
|
@use './mdc/icon-button' as tokens-mdc-icon-button;
|
|
51
59
|
@use './mdc/linear-progress' as tokens-mdc-linear-progress;
|
|
@@ -103,15 +111,18 @@
|
|
|
103
111
|
/// )
|
|
104
112
|
@function m2-tokens-from-theme($theme) {
|
|
105
113
|
@return sass-utils.deep-merge-all(
|
|
114
|
+
_get-tokens-for-module($theme, tokens-mat-app),
|
|
106
115
|
_get-tokens-for-module($theme, tokens-mat-autocomplete),
|
|
107
116
|
_get-tokens-for-module($theme, tokens-mat-badge),
|
|
108
117
|
_get-tokens-for-module($theme, tokens-mat-bottom-sheet),
|
|
109
118
|
_get-tokens-for-module($theme, tokens-mat-button-toggle),
|
|
110
119
|
_get-tokens-for-module($theme, tokens-mat-card),
|
|
111
120
|
_get-tokens-for-module($theme, tokens-mat-datepicker),
|
|
121
|
+
_get-tokens-for-module($theme, tokens-mat-dialog),
|
|
112
122
|
_get-tokens-for-module($theme, tokens-mat-divider),
|
|
113
123
|
_get-tokens-for-module($theme, tokens-mat-expansion),
|
|
114
124
|
_get-tokens-for-module($theme, tokens-mat-fab),
|
|
125
|
+
_get-tokens-for-module($theme, tokens-mat-fab-small),
|
|
115
126
|
_get-tokens-for-module($theme, tokens-mat-filled-button),
|
|
116
127
|
_get-tokens-for-module($theme, tokens-mat-form-field),
|
|
117
128
|
_get-tokens-for-module($theme, tokens-mat-grid-list),
|
|
@@ -122,6 +133,9 @@
|
|
|
122
133
|
_get-tokens-for-module($theme, tokens-mat-option),
|
|
123
134
|
_get-tokens-for-module($theme, tokens-mat-outlined-button),
|
|
124
135
|
_get-tokens-for-module($theme, tokens-mat-paginator),
|
|
136
|
+
_get-tokens-for-module($theme, tokens-mat-checkbox),
|
|
137
|
+
_get-tokens-for-module($theme, tokens-mat-full-pseudo-checkbox),
|
|
138
|
+
_get-tokens-for-module($theme, tokens-mat-minimal-pseudo-checkbox),
|
|
125
139
|
_get-tokens-for-module($theme, tokens-mat-protected-button),
|
|
126
140
|
_get-tokens-for-module($theme, tokens-mat-radio),
|
|
127
141
|
_get-tokens-for-module($theme, tokens-mat-ripple),
|
|
@@ -144,8 +158,10 @@
|
|
|
144
158
|
_get-tokens-for-module($theme, tokens-mdc-elevated-card),
|
|
145
159
|
_get-tokens-for-module($theme, tokens-mdc-extended-fab),
|
|
146
160
|
_get-tokens-for-module($theme, tokens-mdc-fab),
|
|
161
|
+
_get-tokens-for-module($theme, tokens-mdc-fab-small),
|
|
147
162
|
_get-tokens-for-module($theme, tokens-mdc-filled-button),
|
|
148
163
|
_get-tokens-for-module($theme, tokens-mdc-filled-text-field),
|
|
164
|
+
_get-tokens-for-module($theme, tokens-mdc-form-field),
|
|
149
165
|
_get-tokens-for-module($theme, tokens-mdc-icon-button),
|
|
150
166
|
_get-tokens-for-module($theme, tokens-mdc-linear-progress),
|
|
151
167
|
_get-tokens-for-module($theme, tokens-mdc-list),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use 'sass:meta';
|
|
2
2
|
@use 'sass:map';
|
|
3
|
+
@use 'sass:math';
|
|
3
4
|
@use 'sass:color';
|
|
4
5
|
@use '../../token-utils';
|
|
5
6
|
@use '../../../theming/inspection';
|
|
@@ -11,7 +12,32 @@ $prefix: (mat, badge);
|
|
|
11
12
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
13
|
// but may be in a future version of the theming API.
|
|
13
14
|
@function get-unthemable-tokens() {
|
|
14
|
-
|
|
15
|
+
$default-size: 22px;
|
|
16
|
+
$small-size: $default-size - 6;
|
|
17
|
+
$large-size: $default-size + 6;
|
|
18
|
+
|
|
19
|
+
@return (
|
|
20
|
+
container-shape: 50%,
|
|
21
|
+
container-size: unset,
|
|
22
|
+
small-size-container-size: unset,
|
|
23
|
+
large-size-container-size: unset,
|
|
24
|
+
|
|
25
|
+
legacy-container-size: $default-size,
|
|
26
|
+
legacy-small-size-container-size: $small-size,
|
|
27
|
+
legacy-large-size-container-size: $large-size,
|
|
28
|
+
|
|
29
|
+
container-offset: math.div($default-size, -2) 0,
|
|
30
|
+
small-size-container-offset: math.div($small-size, -2) 0,
|
|
31
|
+
large-size-container-offset: math.div($large-size, -2) 0,
|
|
32
|
+
|
|
33
|
+
container-overlap-offset: math.div($default-size, -2),
|
|
34
|
+
small-size-container-overlap-offset: math.div($small-size, -2),
|
|
35
|
+
large-size-container-overlap-offset: math.div($large-size, -2),
|
|
36
|
+
|
|
37
|
+
container-padding: 0,
|
|
38
|
+
small-size-container-padding: 0,
|
|
39
|
+
large-size-container-padding: 0,
|
|
40
|
+
);
|
|
15
41
|
}
|
|
16
42
|
|
|
17
43
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
@use '../../../theming/theming';
|
|
3
|
+
@use '../../../theming/inspection';
|
|
4
|
+
@use '../../../style/sass-utils';
|
|
5
|
+
|
|
6
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
7
|
+
$prefix: (mat, checkbox);
|
|
8
|
+
|
|
9
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
10
|
+
// but may be in a future version of the theming API.
|
|
11
|
+
@function get-unthemable-tokens() {
|
|
12
|
+
@return ();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
16
|
+
@function get-color-tokens($theme) {
|
|
17
|
+
@return (
|
|
18
|
+
disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
23
|
+
@function get-typography-tokens($theme) {
|
|
24
|
+
@return ();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
28
|
+
@function get-density-tokens($theme) {
|
|
29
|
+
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
30
|
+
|
|
31
|
+
@return (
|
|
32
|
+
touch-target-display: if($density-scale < -1, none, block),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
37
|
+
// This is used to create token slots.
|
|
38
|
+
@function get-token-slots() {
|
|
39
|
+
@return sass-utils.deep-merge-all(
|
|
40
|
+
get-unthemable-tokens(),
|
|
41
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
42
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
43
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
@use '../../../style/sass-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mat, dialog);
|
|
6
|
+
|
|
7
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
8
|
+
// but may be in a future version of the theming API.
|
|
9
|
+
@function get-unthemable-tokens() {
|
|
10
|
+
@return (
|
|
11
|
+
container-max-width: 80vw,
|
|
12
|
+
container-small-max-width: 80vw,
|
|
13
|
+
container-min-width: 0,
|
|
14
|
+
actions-alignment: start,
|
|
15
|
+
actions-padding: 8px,
|
|
16
|
+
content-padding: 20px 24px,
|
|
17
|
+
with-actions-content-padding: 20px 24px,
|
|
18
|
+
|
|
19
|
+
// Note: the CSS class is `title` while the M2 tokens call it `subhead`.
|
|
20
|
+
// M3 calls it `headline` which is what we're aligning with.
|
|
21
|
+
headline-padding: 0 24px 9px,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
26
|
+
@function get-color-tokens($theme) {
|
|
27
|
+
@return ();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
31
|
+
@function get-typography-tokens($theme) {
|
|
32
|
+
@return ();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
36
|
+
@function get-density-tokens($theme) {
|
|
37
|
+
@return ();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
41
|
+
// This is used to create token slots.
|
|
42
|
+
@function get-token-slots() {
|
|
43
|
+
@return sass-utils.deep-merge-all(
|
|
44
|
+
get-unthemable-tokens(),
|
|
45
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
46
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
47
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/theming';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
@use '../../../mdc-helpers/mdc-helpers';
|
|
8
|
+
|
|
9
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
10
|
+
$prefix: (mat, fab-small);
|
|
11
|
+
|
|
12
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
13
|
+
// but may be in a future version of the theming API.
|
|
14
|
+
@function get-unthemable-tokens() {
|
|
15
|
+
@return ();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
+
@function get-color-tokens($theme) {
|
|
20
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
21
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
22
|
+
$ripple-opacities: if($is-dark,
|
|
23
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
24
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
@return (
|
|
28
|
+
// Color of icons and text projected into a FAB.
|
|
29
|
+
foreground-color: inspection.get-theme-color($theme, foreground, base),
|
|
30
|
+
|
|
31
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
32
|
+
state-layer-color: $on-surface,
|
|
33
|
+
|
|
34
|
+
// Color of the element that shows the hover, focus and pressed states while disabled.
|
|
35
|
+
disabled-state-layer-color: $on-surface,
|
|
36
|
+
|
|
37
|
+
// Color of the ripple element.
|
|
38
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
39
|
+
|
|
40
|
+
// Opacity of the ripple when the button is hovered.
|
|
41
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
42
|
+
|
|
43
|
+
// Opacity of the ripple when the button is focused.
|
|
44
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
45
|
+
|
|
46
|
+
// Opacity of the ripple when the button is pressed.
|
|
47
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
48
|
+
|
|
49
|
+
// MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
|
|
50
|
+
// Background color of the container when the FAB is disabled.
|
|
51
|
+
disabled-state-container-color: rgba($on-surface, 0.12),
|
|
52
|
+
|
|
53
|
+
// Color of the icons and projected text when the FAB is disabled.
|
|
54
|
+
disabled-state-foreground-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Generates the mapping for the properties that change based on the FAB palette color.
|
|
59
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
60
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
61
|
+
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
62
|
+
$contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
|
|
63
|
+
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
64
|
+
|
|
65
|
+
@return (
|
|
66
|
+
foreground-color: $color,
|
|
67
|
+
state-layer-color: $color,
|
|
68
|
+
ripple-color: rgba($color, 0.1),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
73
|
+
@function get-typography-tokens($theme) {
|
|
74
|
+
@return ();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
78
|
+
@function get-density-tokens($theme) {
|
|
79
|
+
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
80
|
+
|
|
81
|
+
@return (
|
|
82
|
+
touch-target-display: if($density-scale < -1, none, block),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
87
|
+
// This is used to create token slots.
|
|
88
|
+
@function get-token-slots() {
|
|
89
|
+
@return sass-utils.deep-merge-all(
|
|
90
|
+
get-unthemable-tokens(),
|
|
91
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
92
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
93
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
3
|
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/theming';
|
|
4
5
|
@use '../../../theming/inspection';
|
|
5
6
|
@use '../../../style/sass-utils';
|
|
6
7
|
@use '../../../mdc-helpers/mdc-helpers';
|
|
@@ -75,7 +76,11 @@ $prefix: (mat, fab);
|
|
|
75
76
|
|
|
76
77
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
77
78
|
@function get-density-tokens($theme) {
|
|
78
|
-
|
|
79
|
+
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
80
|
+
|
|
81
|
+
@return (
|
|
82
|
+
touch-target-display: if($density-scale < -1, none, block),
|
|
83
|
+
);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
3
|
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/theming';
|
|
4
5
|
@use '../../../theming/inspection';
|
|
5
6
|
@use '../../../style/sass-utils';
|
|
6
7
|
@use '../../../mdc-helpers/mdc-helpers';
|
|
@@ -11,7 +12,17 @@ $prefix: (mat, filled-button);
|
|
|
11
12
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
13
|
// but may be in a future version of the theming API.
|
|
13
14
|
@function get-unthemable-tokens() {
|
|
14
|
-
@return (
|
|
15
|
+
@return (
|
|
16
|
+
// Start/end padding of the button.
|
|
17
|
+
horizontal-padding: 16px,
|
|
18
|
+
|
|
19
|
+
// Space between the icon and the button's main content.
|
|
20
|
+
icon-spacing: 8px,
|
|
21
|
+
|
|
22
|
+
// Amount by which to offset the icon so that its presence
|
|
23
|
+
// doesn't increase throw off the horizontal padding.
|
|
24
|
+
icon-offset: -4px,
|
|
25
|
+
);
|
|
15
26
|
}
|
|
16
27
|
|
|
17
28
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
@@ -64,7 +75,11 @@ $prefix: (mat, filled-button);
|
|
|
64
75
|
|
|
65
76
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
66
77
|
@function get-density-tokens($theme) {
|
|
67
|
-
|
|
78
|
+
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
|
|
79
|
+
|
|
80
|
+
@return (
|
|
81
|
+
touch-target-display: if($density-scale < -1, none, block),
|
|
82
|
+
);
|
|
68
83
|
}
|
|
69
84
|
|
|
70
85
|
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
@@ -39,6 +39,21 @@ $prefix: (mat, form-field);
|
|
|
39
39
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/system-color
|
|
40
40
|
select-disabled-option-text-color: if($is-dark, palette.$dark-disabled-text, GrayText),
|
|
41
41
|
|
|
42
|
+
// These tokens are necessary for M3. MDC has them built in already, but:
|
|
43
|
+
// 1. They are too specific, breaking a lot of internal clients.
|
|
44
|
+
// 2. The larger selectors result in a larger bundle.
|
|
45
|
+
// Note: MDC has tokens for all the various states of the icons. Some of them are ommitted,
|
|
46
|
+
// because they resolve to the same value (e.g. focus and base states for the leading icon
|
|
47
|
+
// are the same).
|
|
48
|
+
leading-icon-color: unset,
|
|
49
|
+
disabled-leading-icon-color: unset,
|
|
50
|
+
|
|
51
|
+
trailing-icon-color: unset,
|
|
52
|
+
disabled-trailing-icon-color: unset,
|
|
53
|
+
error-focus-trailing-icon-color: unset,
|
|
54
|
+
error-hover-trailing-icon-color: unset,
|
|
55
|
+
error-trailing-icon-color: unset,
|
|
56
|
+
|
|
42
57
|
// These values are taken from the MDC select implementation:
|
|
43
58
|
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-select/_select-theme.scss
|
|
44
59
|
enabled-select-arrow-color: rgba($on-surface, 0.54),
|