-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mat-selection-list defaults to accent color and cannot be set to primary #15234
Comments
Currently the selection list always uses the `accent` color for the underlying pseudo checkbox of list options. In order to make this configurable by the user, we add a `color` input that matches our other usages of the `color` input in order to be consistent. Since we want to allow that a color can be specified for the `<mat-selection-list>` and that it's possible to overwrite the color for an individual list option, we don't use the color mixin as it brings in a lot of overhead and also doesn't make it easy to provide the desired precedence for individual options. Also we **can't** set the color class on the `<mat-selection-list>` as the pseudo checkbox will then ignore the color class set for the individual list option. Closes angular#15234
Currently the selection list always uses the `accent` color for the underlying pseudo checkbox of list options. In order to make this configurable by the user, we add a `color` input that matches our other usages of the `color` input in order to be consistent. Since we want to allow that a color can be specified for the `<mat-selection-list>` and that it's possible to overwrite the color for an individual list option, we don't use the color mixin as it brings in a lot of overhead and also doesn't make it easy to provide the desired precedence for individual options. Also we **can't** set the color class on the `<mat-selection-list>` as the pseudo checkbox will then ignore the color class set for the individual list option. Closes angular#15234
Currently the selection list always uses the `accent` color for the underlying pseudo checkbox of list options. In order to make this configurable by the user, we add a `color` input that matches our other usages of the `color` input in order to be consistent. Since we want to allow that a color can be specified for the `<mat-selection-list>` and that it's possible to overwrite the color for an individual list option, we don't use the color mixin as it brings in a lot of overhead and also doesn't make it easy to provide the desired precedence for individual options. Also we **can't** set the color class on the `<mat-selection-list>` as the pseudo checkbox will then ignore the color class set for the individual list option. Closes angular#15234
Currently the selection list always uses the `accent` color for the underlying pseudo checkbox of list options. In order to make this configurable by the user, we add a `color` input that matches our other usages of the `color` input in order to be consistent. Since we want to allow that a color can be specified for the `<mat-selection-list>` and that it's possible to overwrite the color for an individual list option, we don't use the color mixin as it brings in a lot of overhead and also doesn't make it easy to provide the desired precedence for individual options. Also we **can't** set the color class on the `<mat-selection-list>` as the pseudo checkbox will then ignore the color class set for the individual list option. Closes #15234
When this will be released? BTW |
There is still a problem here. If the parent component has mat-primary class set (like mat-tab-group does by default), then changing color to accent on mat-selection-list or mat-list-option has no effect, since mat-accent is never explicitly set as only primary and warn values are checked:
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
What is the expected behavior?
I should be able to control the color of the checkboxes of the mat-selection-list
What is the current behavior?
The color is set to accent only and does not permit me to change it via a color property. The documentation does not state that the color is set to accent
What are the steps to reproduce?
Provided stackblitz shows the issue.
https://stackblitz.com/edit/angular-material2-issue-fvzopz
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 7.3.2
Node: 11.9.0
OS: win32 x64
Angular: 7.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.13.2
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 7.3.2
@angular-devkit/schematics 7.3.2
@angular/cdk 7.3.2
@angular/cli 7.3.2
@angular/material 7.3.2
@ngtools/webpack 7.3.0
@schematics/angular 7.3.2
@schematics/update 0.13.2
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: