From b72acf0d7f4c9faead9ff885eb32b174ea4d7df5 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Mon, 16 Apr 2018 14:28:22 +0200 Subject: [PATCH] fix(select,autocomplete): mat-option theme not being applied correctly when nested inside a selector 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); } ``` --- src/lib/core/option/_option-theme.scss | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib/core/option/_option-theme.scss b/src/lib/core/option/_option-theme.scss index 0c423048b005..38c37772f255 100644 --- a/src/lib/core/option/_option-theme.scss +++ b/src/lib/core/option/_option-theme.scss @@ -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); @@ -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) {