Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-04 19:35:56 +0300
committerJulius Härtl <jus@bitgrid.net>2018-01-08 12:31:34 +0300
commite4f9c75a050a861550885af0eb33ead9e8778859 (patch)
tree302b80792a5ff2cd225f3cee3d8bb43e2c844320 /apps/theming/css
parentecf885046459253fbe4599600db241b9e36fa61a (diff)
Adjust theming color calculations using sRGB luma
based on https://robots.thoughtbot.com/closer-look-color-lightness Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/css')
-rw-r--r--apps/theming/css/theming.scss15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss
index 4474c232d94..58bc1f5464e 100644
--- a/apps/theming/css/theming.scss
+++ b/apps/theming/css/theming.scss
@@ -1,3 +1,12 @@
+/** Calculate luma as it is also used in OCA\Theming\Util::calculateLuma */
+@function luma($c) {
+ $-local-red: red(rgba($c, 1.0));
+ $-local-green: green(rgba($c, 1.0));
+ $-local-blue: blue(rgba($c, 1.0));
+
+ @return (0.2126 * $-local-red + 0.7152 * $-local-green + 0.0722 * $-local-blue) / 255;
+}
+
.nc-theming-main-background {
background-color: $color-primary;
}
@@ -10,7 +19,7 @@
color: $color-primary-text;
}
-@if (lightness($color-primary) > 55) {
+@if (luma($color-primary) > 0.6) {
.searchbox input[type="search"] {
background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center;
}
@@ -90,8 +99,8 @@ input.primary,
color: $color-primary-text;
}
-@if (lightness($color-primary) > 50) {
- #body-login #submit-icon.icon-confirm-white {
+@if (luma($color-primary) > 0.6) {
+ #body-login #submit-wrapper .icon-confirm-white {
background-image: url('../../../core/img/actions/confirm.svg');
}
}