Skip to content

Commit 1facdca

Browse files
simeonoffChronosSFkdinev
authored
fix(themes): passing css variables breaks build (#12563)
Co-authored-by: Stamen Stoychev <[email protected]> Co-authored-by: Konstantin Dinev <[email protected]>
1 parent e983ea7 commit 1facdca

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

projects/igniteui-angular/src/lib/core/styles/components/button/_button-theme.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use 'sass:map';
2+
@use 'sass:meta';
23
@use 'sass:color';
34
@use '../../base' as *;
45
@use '../../themes/schemas' as *;
@@ -114,11 +115,15 @@
114115
}
115116

116117
@if not($hover-background) and $background {
117-
$hover-background: color.scale($background, $lightness: 5%);
118+
@if meta.type-of($background) == 'color' {
119+
$hover-background: color.scale($background, $lightness: 5%);
120+
}
118121
}
119122

120123
@if not($hover-foreground) and $hover-background {
121-
$hover-foreground: text-contrast($hover-background);
124+
@if meta.type-of($hover-background) == 'color' {
125+
$hover-foreground: text-contrast($hover-background);
126+
}
122127
}
123128

124129
@if not($focus-background) and $background {

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,12 @@
393393
}
394394

395395
@if not($filtering-header-background) and $header-background {
396-
@if meta.type-of($header-background) == 'color' and luminance($header-background) < .5 {
397-
$filtering-header-background: to-opaque(color.scale($header-background, $lightness: 5%));
398-
} @else {
399-
$filtering-header-background: to-opaque(color.scale($header-background, $lightness: -5%));
396+
@if meta.type-of($header-background) == 'color' {
397+
@if luminance($header-background) < .5 {
398+
$filtering-header-background: to-opaque(color.scale($header-background, $lightness: 5%));
399+
} @else {
400+
$filtering-header-background: to-opaque(color.scale($header-background, $lightness: -5%));
401+
}
400402
}
401403
}
402404

@@ -405,10 +407,12 @@
405407
}
406408

407409
@if not($filtering-row-background) and $header-background {
408-
@if meta.type-of($header-background) == 'color' and luminance($header-background) < .5 {
409-
$filtering-row-background: to-opaque(color.scale($header-background, $lightness: 5%));
410-
} @else {
411-
$filtering-row-background: to-opaque(color.scale($header-background, $lightness: -5%));
410+
@if meta.type-of($header-background) == 'color' {
411+
@if luminance($header-background) < .5 {
412+
$filtering-row-background: to-opaque(color.scale($header-background, $lightness: 5%));
413+
} @else {
414+
$filtering-row-background: to-opaque(color.scale($header-background, $lightness: -5%));
415+
}
412416
}
413417
}
414418

projects/igniteui-angular/src/lib/core/styles/components/list/_list-theme.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,22 @@
100100
}
101101

102102
@if not($item-background-hover) and $item-background {
103-
@if meta.type-of($item-background) == 'color' and luminance($item-background) < .5 {
104-
$item-background-hover: color.scale($item-background, $lightness: 8%);
105-
} @else {
106-
$item-background-hover: color.scale($item-background, $lightness: -8%);
103+
@if meta.type-of($item-background) == 'color' {
104+
@if luminance($item-background) < .5 {
105+
$item-background-hover: color.scale($item-background, $lightness: 8%);
106+
} @else {
107+
$item-background-hover: color.scale($item-background, $lightness: -8%);
108+
}
107109
}
108110
}
109111

110112
@if not($item-background-active) and $item-background {
111-
@if meta.type-of($item-background) == 'color' and luminance($item-background) < .5 {
112-
$item-background-active: color.scale($item-background, $lightness: 8%);
113-
} @else {
114-
$item-background-active: color.scale($item-background, $lightness: -8%);
113+
@if meta.type-of($item-background) == 'color' {
114+
@if luminance($item-background) < .5 {
115+
$item-background-active: color.scale($item-background, $lightness: 8%);
116+
} @else {
117+
$item-background-active: color.scale($item-background, $lightness: -8%);
118+
}
115119
}
116120
}
117121

0 commit comments

Comments
 (0)