Skip to content

Commit 25857c4

Browse files
authored
Merge pull request #10924 from nextcloud/bugfix/10901/theming-bugfix-primary
Fix SCSS variable management with the theming app
2 parents cdc4eee + a791bdb commit 25857c4

7 files changed

Lines changed: 13 additions & 8 deletions

File tree

apps/accessibility/lib/Controller/AccessibilityController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ public function getCss(): DataDisplayResponse {
149149
try {
150150
$css .= $scss->compile(
151151
$imports .
152-
'@import "variables.scss";' .
153152
$this->getInjectedVariables() .
153+
'@import "variables.scss";' .
154154
'@import "css-variables.scss";'
155155
);
156156
} catch (ParserException $e) {

apps/theming/css/theming.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
@include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
7272
}
7373
}
74+
#body-user {
75+
.primary {
76+
border: 1px solid transparent;
77+
}
78+
}
7479
} @else {
7580
#appmenu:not(.inverted) svg {
7681
filter: none;

apps/theming/lib/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function invertTextColor($color) {
7979
public function elementColor($color) {
8080
$l = $this->calculateLuminance($color);
8181
if($l>0.8) {
82-
return '#555555';
82+
return '#dddddd';
8383
}
8484
return $color;
8585
}

apps/theming/tests/CapabilitiesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function dataGetCapabilities() {
7474
'slogan' => 'slogan',
7575
'color' => '#FFFFFF',
7676
'color-text' => '#000000',
77-
'color-element' => '#555555',
77+
'color-element' => '#dddddd',
7878
'logo' => 'http://absolute/logo',
7979
'background' => 'http://absolute/background',
8080
'background-plain' => false,

apps/theming/tests/UtilTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testElementColorDefault() {
105105

106106
public function testElementColorOnBrightBackground() {
107107
$elementColor = $this->util->elementColor('#ffffff');
108-
$this->assertEquals('#555555', $elementColor);
108+
$this->assertEquals('#dddddd', $elementColor);
109109
}
110110

111111
public function testGenerateRadioButtonWhite() {

core/css/variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ $color-main-background: #fff !default;
3838
$color-background-dark: nc-darken($color-main-background, 7%) !default;
3939
$color-background-darker: nc-darken($color-main-background, 14%) !default;
4040

41-
$color-primary: #0082c9;
42-
$color-primary-text: #ffffff;
41+
$color-primary: #0082c9 !default;
42+
$color-primary-text: #ffffff !default;
4343
// do not use nc-darken/lighten in case of overriding because
4444
// primary-text is independent of color-main-text
4545
$color-primary-text-dark: darken($color-primary-text, 7%) !default;

lib/private/Template/SCSSCacher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ private function cache(string $path, string $fileNameCSS, string $fileNameSCSS,
284284
try {
285285
$compiledScss = $scss->compile(
286286
'$webroot: \'' . $this->getRoutePrefix() . '\';' .
287+
$this->getInjectedVariables() .
287288
'@import "variables.scss";' .
288289
'@import "functions.scss";' .
289-
$this->getInjectedVariables() .
290290
'@import "' . $fileNameSCSS . '";');
291291
} catch (ParserException $e) {
292292
$this->logger->error($e, ['app' => 'core']);
@@ -349,7 +349,7 @@ private function getInjectedVariables(): string {
349349
}
350350
$variables = '';
351351
foreach ($this->defaults->getScssVariables() as $key => $value) {
352-
$variables .= '$' . $key . ': ' . $value . ';';
352+
$variables .= '$' . $key . ': ' . $value . ' !default;';
353353
}
354354

355355
// check for valid variables / otherwise fall back to defaults

0 commit comments

Comments
 (0)