@mixin ch-color-contrast-warn($color1, $color2, $target: 3) {
$contrast: ch-color-contrast($color1, $color2);
@if ($contrast < $target) {
@warn "Contrast ratio of #{$color2} on #{$color1} is pretty bad, wanted a contrast of at least #{$target} but got just #{$contrast}";
}
}
Would have preferred to have it as a function, but functions in Sass needs to return a value and when called, needs to assign that value somewhere.
A mixin on the other hand doesn't need to have any side effects whatsoever.
Perhaps omething like:
With maybe an implementation like:
Would have preferred to have it as a function, but functions in Sass needs to return a value and when called, needs to assign that value somewhere.
A mixin on the other hand doesn't need to have any side effects whatsoever.