Skip to content

Commit e9f95fa

Browse files
authored
Merge pull request #8349 from IgniteUI/simeonoff/css-vars-values
refactor(theme): allow css vars as values in themes
2 parents 255c41f + 4464ecf commit e9f95fa

File tree

1 file changed

+4
-0
lines changed
  • projects/igniteui-angular/src/lib/core/styles/base/utilities

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,13 @@
400400
/// @returns {String} - The value of the key in the passed map, or the name of key concatenated with the key name.
401401
@function --var($map, $key, $fallback: null) {
402402
$igx-legacy-support: if(global-variable-exists('igx-legacy-support'), $igx-legacy-support, false);
403+
$css-var: str-slice(#{map-get($map, $key)}, 1, 3) == 'var';
403404

404405
@if map-has-key($map, $key) {
405406
@if $igx-legacy-support == false {
407+
@if $css-var {
408+
@return map-get($map, $key);
409+
}
406410
@if not($fallback) {
407411
@return var(--#{map-get($map, 'name')}-#{$key})
408412
}

0 commit comments

Comments
 (0)