- commit
- c24daebe76b56cae1eb510e8cd1307e01e09e949
- parent
- 583363b545b02d5b42a6beb3f229c9ac6b8b3ab5
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2017-05-30 22:46
contrast: allow compliance levels as threshold
Diffstat
| M | sass/contrast.scss | 9 | +++++++++ |
1 files changed, 9 insertions, 0 deletions
diff --git a/sass/contrast.scss b/sass/contrast.scss
@@ -126,7 +126,16 @@ $planifolia-contrast-light-default: white !default; 126 126 /// @param {color} $color1 background color 127 127 /// @param {color} $color2 foreground color 128 128 /// @param {number} $threshold [4.5] -1 129 /// (can also be 'AA', 'AALG', 'AAA', or 'AAALG') 129 130 @function contrast-check($color1, $color2, $threshold: 4.5) { -1 131 @if ($threshold == 'AA' or $threshold == 'AAALG') { -1 132 $threshold: 4.5; -1 133 } @elseif ($threshold == 'AALG') { -1 134 $threshold: 3; -1 135 } @elseif ($threshold == 'AAA') { -1 136 $threshold: 7; -1 137 } -1 138 130 139 $contrast: contrast($color1, $color2); 131 140 @if $contrast < $threshold { 132 141 @warn 'contrast #{$contrast} between #{$color1} and #{$color2} too low!';