-
Notifications
You must be signed in to change notification settings - Fork 6.8k
bug(MatSlideToggle): MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS doesn't provide ability to set default color #22012
Copy link
Copy link
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-togglefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
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
Reactions are currently unavailable
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-togglefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues