Skip to content

Commit 7917fb2

Browse files
authored
Merge pull request #5985 from IgniteUI/fix-#5977
fix(grid): alter user colors for odd/even rows to avoid translucency
2 parents 3e45a71 + 83ceb01 commit 7917fb2

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

projects/igniteui-angular/src/lib/core/styles/base/utilities/_functions.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
@if type-of($color) == 'color' {
141141
$lightContrast: contrast($color, white);
142142
$darkContrast: contrast($color, black);
143-
143+
144144
@if ($lightContrast > $darkContrast) {
145145
@return white;
146146
} @else {
@@ -224,15 +224,15 @@
224224
/// @returns {Map} - Returns a clean map.
225225
@function map-clean($map) {
226226
$result: ();
227-
227+
228228
@each $key, $value in $map {
229229
@if($value) != null {
230230
$result: map-merge($result, (
231231
#{$key}: $value
232232
));
233233
}
234234
}
235-
235+
236236
@return $result;
237237
}
238238

@@ -355,9 +355,9 @@
355355
@if map-has-key($map, $key) {
356356
@if $igx-legacy-support == false {
357357
@if not($fallback) {
358-
@return unquote('var(--#{map-get($map, 'name')}-#{$key})')
358+
@return var(--#{map-get($map, 'name')}-#{$key})
359359
}
360-
@return unquote('var(--#{map-get($map, 'name')}-#{$key}, #{$fallback})')
360+
@return var(--#{map-get($map, 'name')}-#{$key}, #{$fallback})
361361
} @else {
362362
@return map-get($map, $key);
363363
}
@@ -446,7 +446,7 @@
446446
@if type-of($value) == 'map' {
447447
$result: extend($result, (#{$key}: resolve-value($value, $palette)));
448448
} @else {
449-
$result: extend($result, (#{$key}: #{$value}));
449+
$result: extend($result, (#{$key}: $value));
450450
}
451451
}
452452
@return $result;

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,21 +244,33 @@
244244
$row-odd-background: $content-background;
245245
}
246246

247-
@if not($row-even-background) and $content-background {
248-
$row-even-background: $content-background;
247+
@if $row-odd-background and alpha($row-odd-background) != 1 {
248+
$cbg: if($content-background, $content-background, map-get($theme, 'content-background'));
249+
250+
$row-odd-background: hexrgba($row-odd-background, $cbg);
249251
}
250252

251253
@if not($row-odd-text-color) and $row-odd-background {
252254
$row-odd-text-color: text-contrast($row-odd-background);
253255
}
254256

257+
@if not($row-even-background) and $content-background {
258+
$row-even-background: $content-background;
259+
}
260+
261+
@if $row-even-background and alpha($row-even-background) != 1 {
262+
$cbg: if($content-background, $content-background, map-get($theme, 'content-background'));
263+
264+
$row-even-background: hexrgba($row-even-background, $cbg);
265+
}
266+
255267
@if not($row-even-text-color) and $row-even-background {
256268
$row-even-text-color: text-contrast($row-even-background);
257269
}
258270

259271
@if not($row-hover-background) and $content-background {
260272
@if type-of($content-background) == 'color' {
261-
$row-hover-background: rgba(text-contrast($content-background), .08)
273+
$row-hover-background: hexrgba(rgba(text-contrast($content-background), .08), $content-background)
262274
}
263275
}
264276

0 commit comments

Comments
 (0)