Sha256: 2693516e67fafe5798298f3b4f6a46d158cc655e1f50c68a849c58820c519f0b
Contents?: true
Size: 1.04 KB
Versions: 57
Compression:
Stored size: 1.04 KB
Contents
$contrasted-dark-default: #000 !default; $contrasted-light-default: #fff !default; $contrasted-lightness-threshold: 30% !default; // Returns the `$light` color when the `$color` is dark // and the `$dark` color when the `$color` is light. // The `$threshold` is a percent between `0%` and `100%` and it determines // when the lightness of `$color` changes from "dark" to "light". @function contrast-color( $color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: $contrasted-lightness-threshold ) { @return if(lightness($color) < $threshold, $light, $dark) } // Sets the specified background color and calculates a dark or light contrasted text color. // The arguments are passed through to the [contrast-color function](#function-contrast-color). @mixin contrasted( $background-color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: $contrasted-lightness-threshold ) { background-color: $background-color; color: contrast-color($background-color, $dark, $light, $threshold); }
Version data entries
57 entries across 56 versions & 10 rubygems