Commit c31d5249 authored by Mark Otto's avatar Mark Otto
Browse files

add color contrast and map-get functions

parent 516af795
7 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!25326Adjust examples,!23995Add back cursor: pointer for .btn-link,!23178Spinner,!22836v4: Colors redux,!17021v4
Showing with 23 additions and 0 deletions
+23 -0
......@@ -47,3 +47,26 @@
@return $string;
}
// Color contrast
@mixin color-yiq($color) {
$r: red($color);
$g: green($color);
$b: blue($color);
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
@if ($yiq >= 128) {
color: #111;
} @else {
color: #fff;
}
}
// Retreive color Sass maps
@function color($key: "blue") {
@return map-get($colors, $key);
}
@function theme-color($key: "primary") {
@return map-get($theme-colors, $key);
}
Supports Markdown
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