Skip to content

Commit

Permalink
fix(select,autocomplete): mat-option theme not being applied correctl…
Browse files Browse the repository at this point in the history
…y when nested inside a selector (#10889)

Fixes the theme for the individual `mat-option` instances producing the wrong selector when it's nested inside a selector, e.g.

```scss
.dark-theme {
  @include angular-material-theme($dark-theme);
}
```
  • Loading branch information
crisbeto authored and mmalerba committed Apr 18, 2018
1 parent d2b183e commit 1a60a7a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/lib/core/option/_option-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
background: mat-color($background, hover);
}

.mat-primary &.mat-selected:not(.mat-option-disabled) {
color: mat-color($primary);
}

.mat-accent &.mat-selected:not(.mat-option-disabled) {
color: mat-color($accent);
}

.mat-warn &.mat-selected:not(.mat-option-disabled) {
color: mat-color($warn);
}

// In multiple mode there is a checkbox to show that the option is selected.
&.mat-selected:not(.mat-option-multiple):not(.mat-option-disabled) {
background: mat-color($background, hover);
Expand All @@ -43,6 +31,18 @@
color: mat-color($foreground, hint-text);
}
}

.mat-primary .mat-option.mat-selected:not(.mat-option-disabled) {
color: mat-color($primary);
}

.mat-accent .mat-option.mat-selected:not(.mat-option-disabled) {
color: mat-color($accent);
}

.mat-warn .mat-option.mat-selected:not(.mat-option-disabled) {
color: mat-color($warn);
}
}

@mixin mat-option-typography($config) {
Expand Down

0 comments on commit 1a60a7a

Please sign in to comment.