Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into adding some kind of simple warning funcitonality #6

Open
voxpelli opened this issue Jan 27, 2017 · 0 comments
Open

Look into adding some kind of simple warning funcitonality #6

voxpelli opened this issue Jan 27, 2017 · 0 comments

Comments

@voxpelli
Copy link
Owner

Perhaps omething like:

@include ch-color-contrast-warn($baseColor, $topColor);

With maybe an implementation like:

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant