-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Closed
bug(MatSlideToggle): MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS doesn't provide ability to set default color#22012
#22047 (+3)
Copy link
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/slide-togglefeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix
Description
Reproduction
There is no way to set default color for MatSlideToggle component at application level.
Expected Behavior
It would be great to have ability to set default color in the same way as it is implemented for MatCheckBox or MatRadioButton:
providers: [
{ provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
{ provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
],
Actual Behavior
MatSlideToggleDefaultOptions has no color
property. 'accent' value is hardcoded, please checkout slide-toggle.ts#75
mixinTabIndex(mixinColor(mixinDisableRipple(mixinDisabled(MatSlideToggleBase)), 'accent')); |
Environment
- CDK/Material: ^11.2.0
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/slide-togglefeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix