Skip to content

Commit

Permalink
Move SCSS variable fetching before the variables.scss to properly cal…
Browse files Browse the repository at this point in the history
…culate color values

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Aug 29, 2018
1 parent 27141a9 commit e8938df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public function getCss(): DataDisplayResponse {
try {
$css .= $scss->compile(
$imports .
'@import "variables.scss";' .
$this->getInjectedVariables() .
'@import "variables.scss";' .
'@import "css-variables.scss";'
);
} catch (ParserException $e) {
Expand Down
4 changes: 2 additions & 2 deletions core/css/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ $color-main-background: #fff !default;
$color-background-dark: nc-darken($color-main-background, 7%) !default;
$color-background-darker: nc-darken($color-main-background, 14%) !default;

$color-primary: #0082c9;
$color-primary-text: #ffffff;
$color-primary: #0082c9 !default;
$color-primary-text: #ffffff !default;
// do not use nc-darken/lighten in case of overriding because
// primary-text is independent of color-main-text
$color-primary-text-dark: darken($color-primary-text, 7%) !default;
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Template/SCSSCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ private function cache(string $path, string $fileNameCSS, string $fileNameSCSS,
try {
$compiledScss = $scss->compile(
'$webroot: \'' . $this->getRoutePrefix() . '\';' .
$this->getInjectedVariables() .
'@import "variables.scss";' .
'@import "functions.scss";' .
$this->getInjectedVariables() .
'@import "' . $fileNameSCSS . '";');
} catch (ParserException $e) {
$this->logger->error($e, ['app' => 'core']);
Expand Down Expand Up @@ -349,7 +349,7 @@ private function getInjectedVariables(): string {
}
$variables = '';
foreach ($this->defaults->getScssVariables() as $key => $value) {
$variables .= '$' . $key . ': ' . $value . ';';
$variables .= '$' . $key . ': ' . $value . ' !default;';
}

// check for valid variables / otherwise fall back to defaults
Expand Down

0 comments on commit e8938df

Please sign in to comment.