From 66e98b7125c87706782b8247b8e0329473dbeb5a Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sat, 11 Jul 2020 10:59:50 -0400 Subject: reorganized assets and CSS, added a post --- public/css/_sass/utilities/functions.sass | 62 ------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 public/css/_sass/utilities/functions.sass (limited to 'public/css/_sass/utilities/functions.sass') diff --git a/public/css/_sass/utilities/functions.sass b/public/css/_sass/utilities/functions.sass deleted file mode 100644 index acd3e83..0000000 --- a/public/css/_sass/utilities/functions.sass +++ /dev/null @@ -1,62 +0,0 @@ -@function mergeColorMaps($bulma-colors, $custom-colors) - // we return at least bulma hardcoded colors - $merged-colors: $bulma-colors - - // we want a map as input - @if type-of($custom-colors) == 'map' - @each $name, $components in $custom-colors - // color name should be a string and colors pair a list with at least one element - @if type-of($name) == 'string' and (type-of($components) == 'list' or type-of($components) == 'color') and length($components) >= 1 - $color-base: null - - // the param can either be a single color - // or a list of 2 colors - @if type-of($components) == 'color' - $color-base: $components - @else if type-of($components) == 'list' - $color-base: nth($components, 1) - - $color-invert: null - // is an inverted color provided in the list - @if length($components) > 1 - $color-invert: nth($components, 2) - - // we only want a color as base color - @if type-of($color-base) == 'color' - // if inverted color is not provided or is not a color we compute it - @if type-of($color-invert) != 'color' - $color-invert: findColorInvert($color-base) - - // we merge this colors elements as map with bulma colors (we can override them this way, no multiple definition for the same name) - $merged-colors: map_merge($merged-colors, ($name: ($color-base, $color-invert))) - - @return $merged-colors - -@function powerNumber($number, $exp) - $value: 1 - @if $exp > 0 - @for $i from 1 through $exp - $value: $value * $number - @else if $exp < 0 - @for $i from 1 through -$exp - $value: $value / $number - @return $value - -@function colorLuminance($color) - $color-rgb: ('red': red($color),'green': green($color),'blue': blue($color)) - @each $name, $value in $color-rgb - $adjusted: 0 - $value: $value / 255 - @if $value < 0.03928 - $value: $value / 12.92 - @else - $value: ($value + .055) / 1.055 - $value: powerNumber($value, 2) - $color-rgb: map-merge($color-rgb, ($name: $value)) - @return (map-get($color-rgb, 'red') * .2126) + (map-get($color-rgb, 'green') * .7152) + (map-get($color-rgb, 'blue') * .0722) - -@function findColorInvert($color) - @if (colorLuminance($color) > 0.55) - @return rgba(#000, 0.7) - @else - @return #fff -- cgit v1.2.3