From e8938df1986c4b52fc1f5c9afe4cc4078ea86e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 29 Aug 2018 16:46:12 +0200 Subject: [PATCH 1/4] Move SCSS variable fetching before the variables.scss to properly calculate color values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/accessibility/lib/Controller/AccessibilityController.php | 2 +- core/css/variables.scss | 4 ++-- lib/private/Template/SCSSCacher.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/accessibility/lib/Controller/AccessibilityController.php b/apps/accessibility/lib/Controller/AccessibilityController.php index 0a1d091d1c50f..8f1ffa452afbb 100644 --- a/apps/accessibility/lib/Controller/AccessibilityController.php +++ b/apps/accessibility/lib/Controller/AccessibilityController.php @@ -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) { diff --git a/core/css/variables.scss b/core/css/variables.scss index b6bffea97394c..34a105fccc9df 100644 --- a/core/css/variables.scss +++ b/core/css/variables.scss @@ -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; diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index 19734355d26f3..c4f89a9c63cf1 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -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']); @@ -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 From 2bdc3b1d27d69390d21959e166816e5732f0551b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 29 Aug 2018 16:46:37 +0200 Subject: [PATCH 2/4] Remove border from primary button when color is bright MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/css/theming.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss index 9e55680470ccc..4a5b0e1aa2706 100644 --- a/apps/theming/css/theming.scss +++ b/apps/theming/css/theming.scss @@ -71,6 +71,11 @@ @include icon-color('checkbox-mark', 'actions', $color-white, 1, true); } } + #body-user { + .primary { + border: 1px solid transparent; + } + } } @else { #appmenu:not(.inverted) svg { filter: none; From 5bae5bf3ebd6001a8ddbf988714e6bf90d48d692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 29 Aug 2018 16:46:54 +0200 Subject: [PATCH 3/4] Make the default element color for bright theming colors lighter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/lib/Util.php | 2 +- apps/theming/tests/UtilTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php index b72cc5b899606..b17382334d0f2 100644 --- a/apps/theming/lib/Util.php +++ b/apps/theming/lib/Util.php @@ -79,7 +79,7 @@ public function invertTextColor($color) { public function elementColor($color) { $l = $this->calculateLuminance($color); if($l>0.8) { - return '#555555'; + return '#dddddd'; } return $color; } diff --git a/apps/theming/tests/UtilTest.php b/apps/theming/tests/UtilTest.php index 247bcbae0b2ed..61d1dc483015b 100644 --- a/apps/theming/tests/UtilTest.php +++ b/apps/theming/tests/UtilTest.php @@ -105,7 +105,7 @@ public function testElementColorDefault() { public function testElementColorOnBrightBackground() { $elementColor = $this->util->elementColor('#ffffff'); - $this->assertEquals('#555555', $elementColor); + $this->assertEquals('#dddddd', $elementColor); } public function testGenerateRadioButtonWhite() { From a791bdb3abed1fe2ab1e705ede04fdb644e2d98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 30 Aug 2018 14:45:06 +0200 Subject: [PATCH 4/4] Fix capabilities test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/tests/CapabilitiesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/theming/tests/CapabilitiesTest.php b/apps/theming/tests/CapabilitiesTest.php index 31e0ae799704a..775b588c78162 100644 --- a/apps/theming/tests/CapabilitiesTest.php +++ b/apps/theming/tests/CapabilitiesTest.php @@ -74,7 +74,7 @@ public function dataGetCapabilities() { 'slogan' => 'slogan', 'color' => '#FFFFFF', 'color-text' => '#000000', - 'color-element' => '#555555', + 'color-element' => '#dddddd', 'logo' => 'http://absolute/logo', 'background' => 'http://absolute/background', 'background-plain' => false,