From: Jeremy Thomas Date: Sun, 13 Oct 2019 09:10:13 +0000 (+0100) Subject: Add light/dark color functions X-Git-Tag: 0.8.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5131f2ab04bb8d709ac7e3df7a7c9edd01cbc9f3;p=thirdparty%2Fbulma.git Add light/dark color functions --- diff --git a/sass/utilities/functions.sass b/sass/utilities/functions.sass index da231bfd8..661705295 100644 --- a/sass/utilities/functions.sass +++ b/sass/utilities/functions.sass @@ -65,3 +65,19 @@ @return rgba(#000, 0.7) @else @return #fff + +@function findLightColor($color) + @if type-of($color) == 'color' + $l: 96% + @if lightness($color) > 96% + $l: lightness($color) + @return change-color($color, $lightness: $l) + @return $background + +@function findDarkColor($color) + @if type-of($color) == 'color' + $l: 29% + @if lightness($color) < 29% + $l: lightness($color) + @return change-color($color, $lightness: $l) + @return $text-strong diff --git a/sass/utilities/initial-variables.sass b/sass/utilities/initial-variables.sass index cca201e88..03bbc128c 100644 --- a/sass/utilities/initial-variables.sass +++ b/sass/utilities/initial-variables.sass @@ -16,7 +16,7 @@ $white-bis: hsl(0, 0%, 98%) !default $white: hsl(0, 0%, 100%) !default $orange: hsl(14, 100%, 53%) !default -$yellow: hsl(48, 100%, 53%) !default +$yellow: hsl(48, 100%, 67%) !default $green: hsl(141, 53%, 53%) !default $turquoise: hsl(171, 100%, 41%) !default $cyan: hsl(204, 71%, 53%) !default