@angular/material 18.1.2 → 18.1.4
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/button/_button-base.scss +5 -5
- package/checkbox/_checkbox-common.scss +9 -11
- package/chips/index.d.ts +3 -8
- package/core/ripple/_ripple.scss +1 -1
- package/core/theming/_definition.scss +2 -0
- package/core/tokens/_m3-tokens.scss +4 -2
- package/core/tokens/_token-definition.scss +266 -0
- package/core/tokens/_token-utils.scss +7 -265
- package/core/tokens/m2/mat/_app.scss +4 -4
- package/core/tokens/m2/mat/_autocomplete.scss +4 -4
- package/core/tokens/m2/mat/_badge.scss +4 -4
- package/core/tokens/m2/mat/_bottom-sheet.scss +4 -4
- package/core/tokens/m2/mat/_card.scss +4 -4
- package/core/tokens/m2/mat/_checkbox.scss +4 -4
- package/core/tokens/m2/mat/_chip.scss +4 -4
- package/core/tokens/m2/mat/_datepicker.scss +4 -4
- package/core/tokens/m2/mat/_dialog.scss +4 -4
- package/core/tokens/m2/mat/_divider.scss +4 -4
- package/core/tokens/m2/mat/_expansion.scss +4 -4
- package/core/tokens/m2/mat/_fab-small.scss +7 -6
- package/core/tokens/m2/mat/_fab.scss +7 -6
- package/core/tokens/m2/mat/_filled-button.scss +7 -6
- package/core/tokens/m2/mat/_form-field.scss +4 -4
- package/core/tokens/m2/mat/_full-pseudo-checkbox.scss +4 -4
- package/core/tokens/m2/mat/_grid-list.scss +4 -4
- package/core/tokens/m2/mat/_icon-button.scss +4 -4
- package/core/tokens/m2/mat/_icon.scss +4 -4
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +4 -4
- package/core/tokens/m2/mat/_list.scss +4 -4
- package/core/tokens/m2/mat/_menu.scss +4 -4
- package/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss +4 -4
- package/core/tokens/m2/mat/_optgroup.scss +4 -4
- package/core/tokens/m2/mat/_option.scss +4 -4
- package/core/tokens/m2/mat/_outlined-button.scss +4 -4
- package/core/tokens/m2/mat/_paginator.scss +4 -4
- package/core/tokens/m2/mat/_protected-button.scss +7 -6
- package/core/tokens/m2/mat/_radio.scss +4 -4
- package/core/tokens/m2/mat/_ripple.scss +4 -4
- package/core/tokens/m2/mat/_select.scss +7 -7
- package/core/tokens/m2/mat/_sidenav.scss +4 -4
- package/core/tokens/m2/mat/_slider.scss +4 -4
- package/core/tokens/m2/mat/_snack-bar.scss +4 -4
- package/core/tokens/m2/mat/_sort.scss +4 -4
- package/core/tokens/m2/mat/_standard-button-toggle.scss +4 -4
- package/core/tokens/m2/mat/_stepper.scss +4 -4
- package/core/tokens/m2/mat/_switch.scss +4 -4
- package/core/tokens/m2/mat/_tab-header-with-background.scss +4 -4
- package/core/tokens/m2/mat/_tab-header.scss +4 -4
- package/core/tokens/m2/mat/_table.scss +4 -4
- package/core/tokens/m2/mat/_text-button.scss +4 -4
- package/core/tokens/m2/mat/_toolbar.scss +4 -4
- package/core/tokens/m2/mat/_tree.scss +4 -4
- package/core/tokens/m2/mdc/_checkbox.scss +6 -6
- package/core/tokens/m2/mdc/_chip.scss +4 -4
- package/core/tokens/m2/mdc/_circular-progress.scss +4 -4
- package/core/tokens/m2/mdc/_dialog.scss +5 -5
- package/core/tokens/m2/mdc/_elevated-card.scss +4 -4
- package/core/tokens/m2/mdc/_extended-fab.scss +4 -4
- package/core/tokens/m2/mdc/_fab-small.scss +4 -4
- package/core/tokens/m2/mdc/_fab.scss +4 -4
- package/core/tokens/m2/mdc/_filled-button.scss +6 -6
- package/core/tokens/m2/mdc/_filled-text-field.scss +7 -7
- package/core/tokens/m2/mdc/_icon-button.scss +4 -4
- package/core/tokens/m2/mdc/_linear-progress.scss +4 -4
- package/core/tokens/m2/mdc/_list.scss +4 -4
- package/core/tokens/m2/mdc/_outlined-button.scss +5 -5
- package/core/tokens/m2/mdc/_outlined-card.scss +4 -4
- package/core/tokens/m2/mdc/_outlined-text-field.scss +7 -7
- package/core/tokens/m2/mdc/_plain-tooltip.scss +4 -4
- package/core/tokens/m2/mdc/_protected-button.scss +6 -6
- package/core/tokens/m2/mdc/_radio.scss +4 -4
- package/core/tokens/m2/mdc/_secondary-navigation-tab.scss +4 -4
- package/core/tokens/m2/mdc/_slider.scss +4 -4
- package/core/tokens/m2/mdc/_snack-bar.scss +4 -4
- package/core/tokens/m2/mdc/_switch.scss +4 -4
- package/core/tokens/m2/mdc/_tab-indicator.scss +4 -4
- package/core/tokens/m2/mdc/_text-button.scss +4 -4
- package/core/tokens/m3/mat/_app.scss +2 -2
- package/core/tokens/m3/mat/_autocomplete.scss +3 -4
- package/core/tokens/m3/mat/_badge.scss +18 -18
- package/core/tokens/m3/mat/_bottom-sheet.scss +4 -4
- package/core/tokens/m3/mat/_card.scss +4 -4
- package/core/tokens/m3/mat/_checkbox.scss +2 -2
- package/core/tokens/m3/mat/_chip.scss +5 -5
- package/core/tokens/m3/mat/_datepicker.scss +7 -7
- package/core/tokens/m3/mat/_dialog.scss +12 -11
- package/core/tokens/m3/mat/_divider.scss +3 -3
- package/core/tokens/m3/mat/_expansion.scss +7 -7
- package/core/tokens/m3/mat/_fab-small.scss +2 -2
- package/core/tokens/m3/mat/_fab.scss +2 -2
- package/core/tokens/m3/mat/_filled-button.scss +5 -5
- package/core/tokens/m3/mat/_form-field.scss +5 -5
- package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +2 -2
- package/core/tokens/m3/mat/_grid-list.scss +2 -2
- package/core/tokens/m3/mat/_icon-button.scss +2 -2
- package/core/tokens/m3/mat/_icon.scss +3 -3
- package/core/tokens/m3/mat/_list.scss +2 -2
- package/core/tokens/m3/mat/_menu.scss +12 -12
- package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +2 -2
- package/core/tokens/m3/mat/_optgroup.scss +3 -3
- package/core/tokens/m3/mat/_option.scss +2 -2
- package/core/tokens/m3/mat/_outlined-button.scss +5 -5
- package/core/tokens/m3/mat/_paginator.scss +3 -3
- package/core/tokens/m3/mat/_protected-button.scss +5 -5
- package/core/tokens/m3/mat/_radio.scss +2 -2
- package/core/tokens/m3/mat/_ripple.scss +2 -2
- package/core/tokens/m3/mat/_select.scss +4 -4
- package/core/tokens/m3/mat/_sidenav.scss +6 -5
- package/core/tokens/m3/mat/_slider.scss +12 -10
- package/core/tokens/m3/mat/_snack-bar.scss +2 -2
- package/core/tokens/m3/mat/_sort.scss +2 -2
- package/core/tokens/m3/mat/_standard-button-toggle.scss +6 -5
- package/core/tokens/m3/mat/_stepper.scss +3 -3
- package/core/tokens/m3/mat/_switch.scss +27 -22
- package/core/tokens/m3/mat/_tab-header.scss +4 -4
- package/core/tokens/m3/mat/_table.scss +7 -6
- package/core/tokens/m3/mat/_text-button.scss +6 -6
- package/core/tokens/m3/mat/_toolbar.scss +3 -3
- package/core/tokens/m3/mat/_tree.scss +2 -2
- package/core/tokens/m3/mdc/_checkbox.scss +10 -8
- package/core/tokens/m3/mdc/_chip.scss +16 -11
- package/core/tokens/m3/mdc/_circular-progress.scss +5 -4
- package/core/tokens/m3/mdc/_dialog.scss +4 -4
- package/core/tokens/m3/mdc/_elevated-card.scss +3 -3
- package/core/tokens/m3/mdc/_extended-fab.scss +9 -5
- package/core/tokens/m3/mdc/_fab-small.scss +8 -5
- package/core/tokens/m3/mdc/_fab.scss +6 -5
- package/core/tokens/m3/mdc/_filled-button.scss +6 -6
- package/core/tokens/m3/mdc/_filled-text-field.scss +7 -6
- package/core/tokens/m3/mdc/_icon-button.scss +10 -8
- package/core/tokens/m3/mdc/_linear-progress.scss +5 -4
- package/core/tokens/m3/mdc/_list.scss +3 -3
- package/core/tokens/m3/mdc/_outlined-button.scss +7 -6
- package/core/tokens/m3/mdc/_outlined-card.scss +3 -3
- package/core/tokens/m3/mdc/_outlined-text-field.scss +7 -6
- package/core/tokens/m3/mdc/_plain-tooltip.scss +3 -3
- package/core/tokens/m3/mdc/_protected-button.scss +6 -6
- package/core/tokens/m3/mdc/_radio.scss +4 -3
- package/core/tokens/m3/mdc/_secondary-navigation-tab.scss +4 -3
- package/core/tokens/m3/mdc/_slider.scss +4 -3
- package/core/tokens/m3/mdc/_snack-bar.scss +3 -3
- package/core/tokens/m3/mdc/_switch.scss +4 -3
- package/core/tokens/m3/mdc/_tab-indicator.scss +5 -4
- package/core/tokens/m3/mdc/_text-button.scss +6 -6
- 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 +7 -7
- 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 +7 -7
- package/esm2022/button/fab.mjs +13 -13
- package/esm2022/button/icon-button.mjs +7 -7
- package/esm2022/button/module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle.mjs +8 -8
- 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 +4 -4
- 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 +6 -6
- package/esm2022/chips/chip-row.mjs +7 -7
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +6 -27
- 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-container.mjs +5 -5
- package/esm2022/dialog/dialog-content-directives.mjs +16 -16
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/dialog/module.mjs +5 -5
- 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 +7 -7
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +7 -7
- package/esm2022/sidenav/drawer.mjs +11 -11
- 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 +6 -6
- 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 +4 -4
- 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/ink-bar.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 +10 -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 +11 -11
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +34 -34
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +14 -14
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +47 -68
- 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 +26 -26
- 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 +10 -10
- 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 -23
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +16 -16
- 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 +31 -31
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +43 -43
- 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/_mdc-text-field-density-overrides.scss +4 -4
- package/form-field/_mdc-text-field-structure.scss +6 -6
- package/package.json +2 -2
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/radio/_radio-common.scss +5 -5
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
- package/schematics/ng-update/index_bundled.js +31 -31
package/button/_button-base.scss
CHANGED
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
// Adds an elevation shadow to a button.
|
|
113
113
|
@mixin mat-private-button-elevation($token-name) {
|
|
114
114
|
// MDC outputs a variable that is the same as the token name, but suffixed with `-shadow`.
|
|
115
|
-
box-shadow:
|
|
115
|
+
box-shadow: token-utils.get-token-variable($token-name + '-shadow');
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
@mixin mat-private-button-touch-target($is-square, $prefix, $slots) {
|
|
@@ -139,14 +139,14 @@
|
|
|
139
139
|
|
|
140
140
|
@mixin mat-private-button-horizontal-layout($prefix, $slots, $has-with-icon-padding) {
|
|
141
141
|
@include token-utils.use-tokens($prefix, $slots) {
|
|
142
|
-
$icon-spacing: token-utils.get-token-variable
|
|
143
|
-
$icon-offset: token-utils.get-token-variable
|
|
144
|
-
$horizontal-padding: token-utils.get-token-variable
|
|
142
|
+
$icon-spacing: token-utils.get-token-variable(icon-spacing, true);
|
|
143
|
+
$icon-offset: token-utils.get-token-variable(icon-offset, true);
|
|
144
|
+
$horizontal-padding: token-utils.get-token-variable(horizontal-padding, true);
|
|
145
145
|
padding: 0 $horizontal-padding;
|
|
146
146
|
|
|
147
147
|
@if ($has-with-icon-padding) {
|
|
148
148
|
$with-icon-horizontal-padding:
|
|
149
|
-
token-utils.get-token-variable
|
|
149
|
+
token-utils.get-token-variable(with-icon-horizontal-padding, true);
|
|
150
150
|
|
|
151
151
|
// stylelint-disable-next-line selector-class-pattern
|
|
152
152
|
&:has(.material-icons, mat-icon, [matButtonIcon]) {
|
|
@@ -31,10 +31,9 @@ $_fallback-size: 40px;
|
|
|
31
31
|
vertical-align: bottom;
|
|
32
32
|
|
|
33
33
|
@include token-utils.use-tokens($prefix, $slots) {
|
|
34
|
-
$layer-size: token-utils.get-token-variable(state-layer-size);
|
|
35
|
-
padding: calc((
|
|
36
|
-
margin: calc((
|
|
37
|
-
var(#{$layer-size}, #{$_fallback-size})) / 2);
|
|
34
|
+
$layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
|
|
35
|
+
padding: calc((#{$layer-size} - #{$_icon-size}) / 2);
|
|
36
|
+
margin: calc((#{$layer-size} - #{$layer-size}) / 2);
|
|
38
37
|
|
|
39
38
|
@if ($include-state-layer-styles) {
|
|
40
39
|
@include _state-layer-styles;
|
|
@@ -51,11 +50,10 @@ $_fallback-size: 40px;
|
|
|
51
50
|
cursor: inherit;
|
|
52
51
|
|
|
53
52
|
@include token-utils.use-tokens($prefix, $slots) {
|
|
54
|
-
$layer-size: token-utils.get-token-variable(state-layer-size);
|
|
55
|
-
$offset: calc((
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
height: var(#{$layer-size}, #{$_fallback-size});
|
|
53
|
+
$layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
|
|
54
|
+
$offset: calc((#{$layer-size} - #{$layer-size}) / 2);
|
|
55
|
+
width: $layer-size;
|
|
56
|
+
height: $layer-size;
|
|
59
57
|
top: $offset;
|
|
60
58
|
right: $offset;
|
|
61
59
|
left: $offset;
|
|
@@ -85,8 +83,8 @@ $_fallback-size: 40px;
|
|
|
85
83
|
border-color $_transition-duration $_exit-curve;
|
|
86
84
|
|
|
87
85
|
@include token-utils.use-tokens($prefix, $slots) {
|
|
88
|
-
$layer-size: token-utils.get-token-variable(state-layer-size);
|
|
89
|
-
$offset: calc((
|
|
86
|
+
$layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
|
|
87
|
+
$offset: calc((#{$layer-size} - #{$_icon-size}) / 2);
|
|
90
88
|
|
|
91
89
|
@include token-utils.create-token-slot(border-color, unselected-icon-color);
|
|
92
90
|
top: $offset;
|
package/chips/index.d.ts
CHANGED
|
@@ -205,8 +205,6 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
|
|
|
205
205
|
disableRipple: boolean;
|
|
206
206
|
/** Whether the chip is disabled. */
|
|
207
207
|
disabled: boolean;
|
|
208
|
-
/** Tab index of the chip. */
|
|
209
|
-
tabIndex: number;
|
|
210
208
|
/** Emitted when a chip is to be removed. */
|
|
211
209
|
readonly removed: EventEmitter<MatChipEvent>;
|
|
212
210
|
/** Emitted when the chip is destroyed. */
|
|
@@ -234,7 +232,7 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
|
|
|
234
232
|
*/
|
|
235
233
|
_rippleLoader: MatRippleLoader;
|
|
236
234
|
protected _injector: Injector;
|
|
237
|
-
constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined
|
|
235
|
+
constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined);
|
|
238
236
|
ngOnInit(): void;
|
|
239
237
|
ngAfterViewInit(): void;
|
|
240
238
|
ngAfterContentInit(): void;
|
|
@@ -260,17 +258,14 @@ export declare class MatChip implements OnInit, AfterViewInit, AfterContentInit,
|
|
|
260
258
|
_getActions(): MatChipAction[];
|
|
261
259
|
/** Handles interactions with the primary action of the chip. */
|
|
262
260
|
_handlePrimaryActionInteraction(): void;
|
|
263
|
-
/** Gets the tabindex of the chip. */
|
|
264
|
-
_getTabIndex(): number | null;
|
|
265
261
|
/** Starts the focus monitoring process on the chip. */
|
|
266
262
|
private _monitorFocus;
|
|
267
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MatChip, [null, null, null, null, null, { optional: true; }, { optional: true; }
|
|
268
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; };
|
|
263
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatChip, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
264
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "removed": "removed"; "destroyed": "destroyed"; }, ["leadingIcon", "trailingIcon", "removeIcon", "_allLeadingIcons", "_allTrailingIcons", "_allRemoveIcons"], ["mat-chip-avatar, [matChipAvatar]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
|
|
269
265
|
static ngAcceptInputType_removable: unknown;
|
|
270
266
|
static ngAcceptInputType_highlighted: unknown;
|
|
271
267
|
static ngAcceptInputType_disableRipple: unknown;
|
|
272
268
|
static ngAcceptInputType_disabled: unknown;
|
|
273
|
-
static ngAcceptInputType_tabIndex: unknown;
|
|
274
269
|
}
|
|
275
270
|
|
|
276
271
|
/**
|
package/core/ripple/_ripple.scss
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
@include token-utils.use-tokens(
|
|
41
41
|
tokens-mat-ripple.$prefix, tokens-mat-ripple.get-token-slots()) {
|
|
42
42
|
// We have to emit a fallback value here, because some internal builds depend on it.
|
|
43
|
-
background-color:
|
|
43
|
+
background-color: token-utils.get-token-variable(color, $fallback: rgba(#000, 0.1));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// In high contrast mode the ripple is opaque, causing it to obstruct the content.
|
|
@@ -55,6 +55,7 @@ $theme-version: 1;
|
|
|
55
55
|
neutral-variant: map.get($primary, neutral-variant),
|
|
56
56
|
error: map.get($primary, error),
|
|
57
57
|
),
|
|
58
|
+
color-system-variables-prefix: $system-variables-prefix,
|
|
58
59
|
color-tokens: m3-tokens.generate-color-tokens(
|
|
59
60
|
$type, $primary, $tertiary, map.get($primary, error), $system-variables-prefix)
|
|
60
61
|
)
|
|
@@ -88,6 +89,7 @@ $theme-version: 1;
|
|
|
88
89
|
medium: $medium,
|
|
89
90
|
regular: $regular,
|
|
90
91
|
),
|
|
92
|
+
typography-system-variables-prefix: $system-variables-prefix,
|
|
91
93
|
typography-tokens: m3-tokens.generate-typography-tokens(
|
|
92
94
|
$brand, $plain, $bold, $medium, $regular, $system-variables-prefix)
|
|
93
95
|
)
|
|
@@ -135,7 +135,8 @@ $_cached-token-slots: null;
|
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
$type: map.get($theme, _mat-theming-internals-do-not-access, theme-type);
|
|
138
|
-
$system-variables-prefix: map.get($theme,
|
|
138
|
+
$system-variables-prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
139
|
+
color-system-variables-prefix) or sys;
|
|
139
140
|
$primary: map.merge(map.get($palettes, primary), $base-palettes);
|
|
140
141
|
$tertiary: map.merge(map.get($palettes, tertiary), $base-palettes);
|
|
141
142
|
$error: map.get($palettes, error);
|
|
@@ -160,7 +161,8 @@ $_cached-token-slots: null;
|
|
|
160
161
|
$bold: map.get($font-definition, bold);
|
|
161
162
|
$medium: map.get($font-definition, medium);
|
|
162
163
|
$regular: map.get($font-definition, regular);
|
|
163
|
-
$system-variables-prefix: map.get($theme,
|
|
164
|
+
$system-variables-prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
165
|
+
typography-system-variables-prefix) or sys;
|
|
164
166
|
$ref: (
|
|
165
167
|
md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
166
168
|
);
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use 'sass:list';
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use 'sass:math';
|
|
6
|
+
@use '../m2/palette' as m2-palette;
|
|
7
|
+
@use '../m2/theming' as m2-theming;
|
|
8
|
+
@use '../m2/typography' as m2-typography;
|
|
9
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
10
|
+
|
|
11
|
+
// Indicates whether we're building internally. Used for backwards compatibility.
|
|
12
|
+
$private-is-internal-build: false;
|
|
13
|
+
|
|
14
|
+
$_placeholder-color-palette: m2-theming.define-palette(m2-palette.$red-palette);
|
|
15
|
+
|
|
16
|
+
// Placeholder color config that can be passed to token getter functions when generating token
|
|
17
|
+
// slots.
|
|
18
|
+
$placeholder-color-config: (
|
|
19
|
+
primary: $_placeholder-color-palette,
|
|
20
|
+
accent: $_placeholder-color-palette,
|
|
21
|
+
warn: $_placeholder-color-palette,
|
|
22
|
+
is-dark: false,
|
|
23
|
+
foreground: m2-palette.$light-theme-foreground-palette,
|
|
24
|
+
background: m2-palette.$light-theme-background-palette,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
$_placeholder-typography-level-config: m2-typography.typography-config-level-from-mdc(body1);
|
|
28
|
+
|
|
29
|
+
// Placeholder typography config that can be passed to token getter functions when generating token
|
|
30
|
+
// slots.
|
|
31
|
+
$placeholder-typography-config: (
|
|
32
|
+
font-family: 'Roboto, sans-serif',
|
|
33
|
+
headline-1: $_placeholder-typography-level-config,
|
|
34
|
+
headline-2: $_placeholder-typography-level-config,
|
|
35
|
+
headline-3: $_placeholder-typography-level-config,
|
|
36
|
+
headline-4: $_placeholder-typography-level-config,
|
|
37
|
+
headline-5: $_placeholder-typography-level-config,
|
|
38
|
+
headline-6: $_placeholder-typography-level-config,
|
|
39
|
+
subtitle-1: $_placeholder-typography-level-config,
|
|
40
|
+
subtitle-2: $_placeholder-typography-level-config,
|
|
41
|
+
body-1: $_placeholder-typography-level-config,
|
|
42
|
+
body-2: $_placeholder-typography-level-config,
|
|
43
|
+
caption: $_placeholder-typography-level-config,
|
|
44
|
+
button: $_placeholder-typography-level-config,
|
|
45
|
+
overline: $_placeholder-typography-level-config,
|
|
46
|
+
subheading-1: $_placeholder-typography-level-config,
|
|
47
|
+
title: $_placeholder-typography-level-config,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// Placeholder density config that can be passed to token getter functions when generating token
|
|
51
|
+
// slots.
|
|
52
|
+
$placeholder-density-config: 0;
|
|
53
|
+
|
|
54
|
+
$_tokens: null;
|
|
55
|
+
$_component-prefix: null;
|
|
56
|
+
$_system-fallbacks: null;
|
|
57
|
+
|
|
58
|
+
/// Gets all the MDC token values for a specific component. This function serves as single
|
|
59
|
+
/// point at which we directly reference a specific version of the MDC tokens.
|
|
60
|
+
/// @param {String} $component Name of the component for which to get the tokens
|
|
61
|
+
/// @param {Map} $systems The MDC system tokens
|
|
62
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
63
|
+
/// @return {List} Map of token names to values
|
|
64
|
+
@function get-mdc-tokens($component, $systems, $exclude-hardcoded) {
|
|
65
|
+
$full-name: 'md-comp-' + $component + '-values';
|
|
66
|
+
$fn: meta.get-function($name: $full-name, $module: 'm3-token-definitions');
|
|
67
|
+
@return meta.call($fn, $systems, $exclude-hardcoded);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
|
|
71
|
+
/// @param {List} $prefix The token prefix for the given tokens.
|
|
72
|
+
/// @param {Map|(Map, Map)} $values A map of M3 token values for the given prefix.
|
|
73
|
+
/// This param may also be a tuple of maps, the first one representing the default M3 token values,
|
|
74
|
+
// and the second containing overrides for different color variants.
|
|
75
|
+
// Single map example:
|
|
76
|
+
// (token1: green, token2: 2px)
|
|
77
|
+
// Tuple example:
|
|
78
|
+
// (
|
|
79
|
+
// (token1: green, token2: 2px),
|
|
80
|
+
// (
|
|
81
|
+
// secondary: (token1: blue),
|
|
82
|
+
// error: (token1: red),
|
|
83
|
+
// )
|
|
84
|
+
// )
|
|
85
|
+
/// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
|
|
86
|
+
/// @param {String|null} $variant The name of the variant the token values are for.
|
|
87
|
+
/// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
|
|
88
|
+
@function namespace-tokens($prefix, $values, $slots, $variant: null) {
|
|
89
|
+
$result: ();
|
|
90
|
+
@if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
|
|
91
|
+
$variants: list.nth($values, 2);
|
|
92
|
+
$values: list.nth($values, 1);
|
|
93
|
+
@each $variant, $overrides in $variants {
|
|
94
|
+
$result: map.merge($result, namespace-tokens($prefix, $overrides, $slots, $variant));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
$used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
|
|
98
|
+
$used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
|
|
99
|
+
$prefix: if($variant == null, $prefix, list.append($prefix, $variant));
|
|
100
|
+
@return map.merge($result, ($prefix: $used-m3-tokens));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Hardcode the given value, or null if hardcoded values are excluded.
|
|
104
|
+
@function hardcode($value, $exclude-hardcoded) {
|
|
105
|
+
@return if($exclude-hardcoded, null, $value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// Sets all of the standard typography tokens for the given token base name to the given typography
|
|
109
|
+
/// level.
|
|
110
|
+
/// @param {Map} $systems The MDC system tokens
|
|
111
|
+
/// @param {String} $base-name The token base name to get the typography tokens for
|
|
112
|
+
/// @param {String} $typography-level The typography level to base the token values on
|
|
113
|
+
/// @return {Map} A map containing the typography tokens for the given base token name
|
|
114
|
+
@function generate-typography-tokens($systems, $base-name, $typography-level) {
|
|
115
|
+
$result: ();
|
|
116
|
+
@each $prop in (font, line-height, size, tracking, weight) {
|
|
117
|
+
$result: map.set($result, #{$base-name}-#{$prop},
|
|
118
|
+
map.get($systems, md-sys-typescale, #{$typography-level}-#{$prop}));
|
|
119
|
+
}
|
|
120
|
+
@return $result;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/// Maps the values in a map to new values using the given mapping function
|
|
124
|
+
/// @param {Map} $map The maps whose values will be mapped to new values.
|
|
125
|
+
/// @param {Function} $fn The value mapping function.
|
|
126
|
+
/// @param {Map} A new map with its values updated using the mapping function.
|
|
127
|
+
@function map-values($map, $fn) {
|
|
128
|
+
$result: ();
|
|
129
|
+
@each $key, $value in $map {
|
|
130
|
+
$result: map.set($result, $key, meta.call($fn, $value));
|
|
131
|
+
}
|
|
132
|
+
@return $result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/// Renames the keys in a map
|
|
136
|
+
/// @param {Map} $map The map whose keys should be renamed
|
|
137
|
+
/// @param {Map} $rename-keys A map of original key to renamed key to apply to $map
|
|
138
|
+
/// @return {Map} The result of applying the given key renames to the given map.
|
|
139
|
+
@function rename-map-keys($map, $rename-keys) {
|
|
140
|
+
$result: $map;
|
|
141
|
+
@each $old-key-name, $new-key-name in $rename-keys {
|
|
142
|
+
@if map.has-key($map, $old-key-name) {
|
|
143
|
+
$result: map.set($result, $new-key-name, map.get($map, $old-key-name));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
@return $result;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/// At the time of writing, some color tokens (e.g. disabled state) are defined as a solid color
|
|
150
|
+
/// token and a separate opacity token. This function applies the opacity to the color and drops the
|
|
151
|
+
/// opacity key from the map. Can be removed once b/213331407 is resolved.
|
|
152
|
+
/// @param {Map} $tokens The map of tokens currently being generated
|
|
153
|
+
/// @param {Map} $all-tokens A map of all tokens, including hardcoded values
|
|
154
|
+
/// @param {List} $pairs Pairs of color token names and their opacities. Should be in the shape of
|
|
155
|
+
/// `((color: 'color-key', opacity: 'opacity-key'))`.
|
|
156
|
+
/// @return {Map} The initial tokens with the combined color values.
|
|
157
|
+
@function combine-color-tokens($tokens, $opacity-lookup, $pairs) {
|
|
158
|
+
$result: $tokens;
|
|
159
|
+
|
|
160
|
+
@each $pair in $pairs {
|
|
161
|
+
$color-key: map.get($pair, color);
|
|
162
|
+
$opacity-key: map.get($pair, opacity);
|
|
163
|
+
$color: map.get($tokens, $color-key);
|
|
164
|
+
$opacity: map.get($opacity-lookup, $opacity-key);
|
|
165
|
+
|
|
166
|
+
@if(meta.type-of($color) == 'color') {
|
|
167
|
+
$result: map.remove($result, $opacity-key);
|
|
168
|
+
$result: map.set($result, $color-key, rgba($color, $opacity));
|
|
169
|
+
}
|
|
170
|
+
@else if($color != null) {
|
|
171
|
+
$result: map.remove($result, $opacity-key);
|
|
172
|
+
$combined-color: #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)};
|
|
173
|
+
$result: map.set($result, $color-key, $combined-color);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@return $result;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
|
|
181
|
+
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
|
|
182
|
+
/// backwards compatibility.
|
|
183
|
+
/// @param {Color} $value Color for which we're calculating the contrast tone.
|
|
184
|
+
/// @param {Boolean} $is-dark Whether the current theme is dark.
|
|
185
|
+
/// @return {Map} Either `dark` or `light`.
|
|
186
|
+
@function contrast-tone($value, $is-dark) {
|
|
187
|
+
@if ($value == 'dark') {
|
|
188
|
+
@return 'light';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@if ($value == 'light') {
|
|
192
|
+
@return 'dark';
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Fallback if the app is using a non-color palette (e.g. CSS variable based).
|
|
196
|
+
@if (meta.type-of($value) != 'color') {
|
|
197
|
+
@return if($is-dark, 'light', 'dark');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
$minimum-contrast: 3.1;
|
|
201
|
+
$light-contrast: _contrast($value, #fff);
|
|
202
|
+
$dark-contrast: _contrast($value, rgba(0, 0, 0, 0.87));
|
|
203
|
+
|
|
204
|
+
@if ($light-contrast < $minimum-contrast) and ($dark-contrast > $light-contrast) {
|
|
205
|
+
@return 'dark';
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@return 'light';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@function _linear-channel-value($channel-value) {
|
|
212
|
+
$normalized-channel-value: math.div($channel-value, 255);
|
|
213
|
+
|
|
214
|
+
@if ($normalized-channel-value < 0.03928) {
|
|
215
|
+
@return math.div($normalized-channel-value, 12.92);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@return math.pow(math.div($normalized-channel-value + 0.055, 1.055), 2.4);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Calculate the luminance for a color.
|
|
222
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
223
|
+
@function _luminance($color) {
|
|
224
|
+
$red: _linear-channel-value(color.red($color));
|
|
225
|
+
$green: _linear-channel-value(color.green($color));
|
|
226
|
+
$blue: _linear-channel-value(color.blue($color));
|
|
227
|
+
|
|
228
|
+
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Calculate the contrast ratio between two colors.
|
|
232
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
233
|
+
@function _contrast($back, $front) {
|
|
234
|
+
$back-lum: _luminance($back) + 0.05;
|
|
235
|
+
$fore-lum: _luminance($front) + 0.05;
|
|
236
|
+
|
|
237
|
+
@return math.div(math.max($back-lum, $fore-lum), math.min($back-lum, $fore-lum));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/// Picks a submap containing only the given keys out the given map.
|
|
241
|
+
/// @param {Map} $map The map to pick from.
|
|
242
|
+
/// @param {List} $keys The map keys to pick.
|
|
243
|
+
/// @return {Map} A submap containing only the given keys.
|
|
244
|
+
@function _pick($map, $keys) {
|
|
245
|
+
$result: ();
|
|
246
|
+
@each $key in $keys {
|
|
247
|
+
@if map.has-key($map, $key) {
|
|
248
|
+
$result: map.set($result, $key, map.get($map, $key));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
@return $result;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
/// Filters keys with a null value out of the map.
|
|
256
|
+
/// @param {Map} $map The map to filter.
|
|
257
|
+
/// @return {Map} The given map with all of the null keys filtered out.
|
|
258
|
+
@function _filter-nulls($map) {
|
|
259
|
+
$result: ();
|
|
260
|
+
@each $key, $val in $map {
|
|
261
|
+
@if $val != null {
|
|
262
|
+
$result: map.set($result, $key, $val);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
@return $result;
|
|
266
|
+
}
|