summaryrefslogtreecommitdiffstats
path: root/WebContent/VAADIN
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-11-07 13:53:45 +0200
committerVaadin Code Review <review@vaadin.com>2015-05-05 07:14:56 +0000
commitef2c0154e7b78b702520970d2c38f452620f9158 (patch)
treeceb9b517d1aa4524c450eba56d54144c629cb77f /WebContent/VAADIN
parent8b93cba4dec9cc04adc8776d116042755d18fe1e (diff)
downloadvaadin-framework-ef2c0154e7b78b702520970d2c38f452620f9158.tar.gz
vaadin-framework-ef2c0154e7b78b702520970d2c38f452620f9158.zip
Provide variable for default contrast value in valo-font-color (#14793).
Change-Id: Ida9552b02cb515fab6fb078a93f9f5c2f6d55014
Diffstat (limited to 'WebContent/VAADIN')
-rw-r--r--WebContent/VAADIN/themes/tests-valo-contrast/_variables.scss3
-rw-r--r--WebContent/VAADIN/themes/tests-valo-contrast/styles.scss6
-rw-r--r--WebContent/VAADIN/themes/valo/util/_color.scss10
3 files changed, 18 insertions, 1 deletions
diff --git a/WebContent/VAADIN/themes/tests-valo-contrast/_variables.scss b/WebContent/VAADIN/themes/tests-valo-contrast/_variables.scss
new file mode 100644
index 0000000000..962bc8f299
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-contrast/_variables.scss
@@ -0,0 +1,3 @@
+$v-font-color-contrast: 0.1;
+
+@import "../valo/valo";
diff --git a/WebContent/VAADIN/themes/tests-valo-contrast/styles.scss b/WebContent/VAADIN/themes/tests-valo-contrast/styles.scss
new file mode 100644
index 0000000000..231a9de50d
--- /dev/null
+++ b/WebContent/VAADIN/themes/tests-valo-contrast/styles.scss
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-contrast {
+ @include valotest;
+}
diff --git a/WebContent/VAADIN/themes/valo/util/_color.scss b/WebContent/VAADIN/themes/valo/util/_color.scss
index 37612fd48d..e4aab4596d 100644
--- a/WebContent/VAADIN/themes/valo/util/_color.scss
+++ b/WebContent/VAADIN/themes/valo/util/_color.scss
@@ -32,6 +32,14 @@ $v-luminance-threshold: 150 !default;
/**
+ * Contrast default value for valo-font-color function.
+ *
+ * @group color
+ * @type number
+ */
+$v-font-color-contrast: 0.72 !default;
+
+/**
* Checks whether the color is considered dark or light, according to it's luminance and saturation.
*
* @group color
@@ -80,7 +88,7 @@ $v-luminance-threshold: 150 !default;
*
* @return {color} a suitable font color for the given background color
*/
-@function valo-font-color ($bg-color, $contrast: 0.72) {
+@function valo-font-color ($bg-color, $contrast: $v-font-color-contrast) {
@if type-of($bg-color) == color {
@if is-dark-color($bg-color) {
@return scale-color($bg-color, $lightness: min(100%, 100% * $contrast), $saturation: max(-100%, -50% * $contrast));