From 06959f3f8c857a07a03f2cdb02c216aef1e4f316 Mon Sep 17 00:00:00 2001 From: Simeon Simeonoff Date: Fri, 10 Jan 2025 10:18:22 +0200 Subject: [PATCH] fix(themes): igx-icon gets overridden multiple themes (#15220) --- .../styles/components/chip/_chip-theme.scss | 2 +- .../styles/components/combo/_combo-theme.scss | 4 +-- .../grid/_excel-filtering-theme.scss | 10 +++---- .../styles/components/grid/_grid-theme.scss | 26 ++++++++----------- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss index 6cacc77cb74..bbb6609e09d 100644 --- a/projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss +++ b/projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss @@ -384,7 +384,7 @@ } @if $variant == 'indigo' { - %igx-icon-display { + igx-icon { --size: #{sizable(rem(14px), rem(14px), rem(16px))} } } diff --git a/projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss index 8bfc4c2fab8..941c98d461f 100644 --- a/projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss +++ b/projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss @@ -174,14 +174,14 @@ // The wrapping element here is needed // in order to override the !important rule of .igx-icon--inactive. %igx-combo__case-icon { - .igx-icon { + igx-icon { // Important is needed since the .igx-icon--inactive has !important color: color($color: 'gray', $variant: 600) !important; } } %igx-combo__case-icon--active { - .igx-icon { + igx-icon { color: color($color: 'primary') } } diff --git a/projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss index 6d997143ea6..343bd37fd5b 100644 --- a/projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss +++ b/projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss @@ -99,13 +99,9 @@ } } - igx-icon { - @if $variant == 'indigo' { - --component-size: 2; - } @else { - width: var(--igx-icon-size, #{rem(15px)}); - height: var(--igx-icon-size, #{rem(15px)}); - font-size: var(--igx-icon-size, #{rem(15px)}); + @if $variant != 'indigo' { + igx-icon { + --size: var(--igx-icon-size, #{rem(15px)}); } } } diff --git a/projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss index fccb690fe53..90ce37cda12 100644 --- a/projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss +++ b/projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss @@ -1204,7 +1204,7 @@ } @else { padding-inline: pad-inline(rem(8px), rem(12px), rem(16px)); - %igx-icon-display { + igx-icon { opacity: if($theme-variant == 'light', .75, .85); &:hover { @@ -1458,12 +1458,12 @@ } @else { padding-inline: pad-inline(rem(8px), rem(12px), rem(16px)); - %igx-icon-display { + igx-icon { opacity: if($theme-variant == 'light', .75, .85); } &:hover { - %igx-icon-display { + igx-icon { opacity: 1; } } @@ -2035,13 +2035,10 @@ position: relative; display: flex; - igx-icon { - @if $variant == 'indigo' { - --component-size: 2; - } @else { - width: var(--igx-icon-size, #{rem(15px)}); - height: var(--igx-icon-size, #{rem(15px)}); - font-size: var(--igx-icon-size, #{rem(15px)}); + + @if $variant != 'indigo' { + igx-icon { + --size: var(--igx-icon-size, #{rem(15px)}); } } @@ -2147,7 +2144,7 @@ %grid-excel-icon { color: var-get($theme, 'header-selected-text-color'); - %igx-icon-display { + igx-icon { color: var-get($theme, 'header-selected-text-color'); } @@ -2155,7 +2152,7 @@ &:hover { color: var-get($theme, 'header-selected-text-color'); - %igx-icon-display { + igx-icon { color: var-get($theme, 'header-selected-text-color'); } } @@ -2499,7 +2496,7 @@ } %igx-group-label__icon { - &.igx-icon { + @at-root igx-icon#{&} { --component-size: #{if($variant == 'indigo', 2, 1)}; color: var-get($theme, 'group-label-icon'); @@ -3447,10 +3444,9 @@ } @if $variant == 'indigo' { - %igx-icon-display { + igx-icon { opacity: if($theme-variant == 'light', .75, .85); - &:hover { opacity: 1; cursor: pointer;