Skip to content

feat(selection-list): support specifying theme color - #15237

Merged
jelbourn merged 1 commit into
angular:masterfrom
devversion:feat/selection-list-support-theme-color
Feb 22, 2019
Merged

feat(selection-list): support specifying theme color#15237
jelbourn merged 1 commit into
angular:masterfrom
devversion:feat/selection-list-support-theme-color

Conversation

@devversion

Copy link
Copy Markdown
Member

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

@devversiondevversion added the target: minor This PR is targeted for the next minor release label Feb 19, 2019
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 19, 2019
Comment threadsrc/lib/list/selection-list.ts
Comment threadsrc/lib/list/selection-list.ts
Comment threadsrc/lib/list/selection-list.ts
Comment threadsrc/lib/list/selection-list.spec.ts Outdated
@devversion
devversionforce-pushed the feat/selection-list-support-theme-color branch from 2315b5c to d57e6acCompareFebruary 19, 2019 20:17
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.
Closesangular#15234
@devversion
devversionforce-pushed the feat/selection-list-support-theme-color branch from d57e6ac to 50fa883CompareFebruary 19, 2019 20:19

@crisbetocrisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbetocrisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Feb 19, 2019

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn
jelbourn merged commit 66d38fc into angular:masterFeb 22, 2019
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 10, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreementtarget: minorThis PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mat-selection-list defaults to accent color and cannot be set to primary

4 participants

@devversion@jelbourn@crisbeto@googlebot