Skip to content
Snippets Groups Projects
Commit de3b1a85 authored by khawkins98's avatar khawkins98
Browse files

Manually add back foreground mixin

This seems to have been removed when foundation went to  6.3, and
wasn’t added back.

For:  #84
parent 4bbcadf6
No related branches found
No related tags found
No related merge requests found
......@@ -7,3 +7,27 @@
-webkit-appearance: none;
}
}
// manually add back the foreground mixin
// https://github.com/ebiwd/EBI-Framework/issues/84
// @import 'libraries/foundation-6/scss/util/util/math';
/// Checks the lightness of `$color`, and if it passes the `$threshold` of lightness, it returns the `$yes` color. Otherwise, it returns the `$no` color. Use this function to dynamically output a foreground color based on a given background color.
///
/// @param {Color} $color - Color to check the lightness of.
/// @param {Color} $yes [$black] - Color to return if `$color` is light.
/// @param {Color} $no [$white] - Color to return if `$color` is dark.
/// @param {Percentage} $threshold [60%] - Threshold of lightness to check against.
///
/// @returns {Color} The $yes color or $no color.
@function foreground($color, $yes: $black, $no: $white, $threshold: 60%) {
@if $color == transparent {
$color: $body-background;
}
@if (lightness($color) > $threshold) {
@return $yes;
}
@else {
@return $no;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment