Skip to content

Commit f6d1464

Browse files
desig9steinmpavlinov
authored andcommitted
fix(--var function): update the -var function to use 'null' as a default value for fallback param. (#5600)
1 parent c1f71c2 commit f6d1464

File tree

1 file changed

+5
-2
lines changed
  • projects/igniteui-angular/src/lib/core/styles/base/utilities

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,15 @@
349349
/// // }
350350
/// // otherwise, it will return the value for key 'icon-color' in the '$avatar-theme';
351351
/// @returns {String} - The value of the key in the passed map, or the name of key concatenated with the key name.
352-
@function --var($map, $key, $fallback: '') {
352+
@function --var($map, $key, $fallback: null) {
353353
$igx-legacy-support: if(global-variable-exists('igx-legacy-support'), $igx-legacy-support, true);
354354

355355
@if map-has-key($map, $key) {
356356
@if $igx-legacy-support == false {
357-
@return unquote('var(--#{map-get($map, 'name')}-#{$key}, #{$fallback})');
357+
@if not($fallback) {
358+
@return unquote('var(--#{map-get($map, 'name')}-#{$key})')
359+
}
360+
@return unquote('var(--#{map-get($map, 'name')}-#{$key}, #{$fallback})')
358361
} @else {
359362
@return map-get($map, $key);
360363
}

0 commit comments

Comments
 (0)