Skip to content

Commit

Permalink
fix(themes): fix get-value not working in component context (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa authored and yggg committed May 27, 2019
1 parent a17a38c commit 30bc29f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/framework/theme/styles/core/theming/_get-value.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@
$value: ();

// in case of css custom properties - just returns var(--var-name) - the rest is a browser job
@if ($nb-theme-process-mode == null) {
@if ($nb-enable-css-custom-properties == true) {
// there is no way to check if variable exists as current execution context is outside of particular theme
// because we process css in this mode only once! (and not for each theme)
$value: var(--#{$key});
}

// in a preprocess mode (nb-install-global call) get ready value from $nb-processed-theme variable
@if ($nb-theme-process-mode == 'pre-process') {
$value: map-get($nb-processed-theme, $key);
}

// otherwise lazily search for variable value
@if ($nb-theme-process-mode == 'lazy-process') {
$theme: nb-get-registered-theme($nb-theme-name);
$value: nb-deep-find-value($theme, $key, map-get($theme, $key));
} @else {
// in a preprocess mode (nb-install-global call) get ready value from $nb-processed-theme variable
@if ($nb-theme-process-mode == 'pre-process') {
$value: map-get($nb-processed-theme, $key);
}

// otherwise lazily search for variable value
@if ($nb-theme-process-mode == 'lazy-process') {
$theme: nb-get-registered-theme($nb-theme-name);
$value: nb-deep-find-value($theme, $key, map-get($theme, $key));
}
}

@if ($value == null) {
@error 'Nebular Theme: `nb-theme()` cannot find value for key `' + $key + '` for theme `'+ $nb-theme-name +'`';
@warn 'Nebular Theme: `nb-theme()` cannot find value for key `' + $key + '` for theme `'+ $nb-theme-name +'`';
}

@return $value;
Expand Down

0 comments on commit 30bc29f

Please sign in to comment.