]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Add light/dark color functions
authorJeremy Thomas <bbxdesign@gmail.com>
Sun, 13 Oct 2019 09:10:13 +0000 (10:10 +0100)
committerJeremy Thomas <bbxdesign@gmail.com>
Fri, 18 Oct 2019 00:51:42 +0000 (20:51 -0400)
sass/utilities/functions.sass
sass/utilities/initial-variables.sass

index da231bfd85abe5d668a1758b2a8594dc5b0cdb37..661705295b38db5e47b2a689085a5d492b148d04 100644 (file)
     @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
index cca201e887ef5cc751b4cd71b22dc17519731e7c..03bbc128c7ea4abe23ab3996708312a30ea53581 100644 (file)
@@ -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