SlexAxton / css-colorguard

Keep a watchful eye on your css colors.
2.44k stars 65 forks source link

Same colors isn't collide #47

Closed Sigiller closed 8 years ago

Sigiller commented 8 years ago

No collides with this colors:

.foo {
  color: #000000;
  background: #000000;
}

But I have collide warning with this:

.foo {
  color: #000;
  background: #000000;
}
ben-eb commented 8 years ago

Duplicate of https://github.com/SlexAxton/css-colorguard/issues/30. 😄

ben-eb commented 8 years ago

The goal of this module is to warn you about similar colours in your stylesheet, not about insufficient contrast. Depending on your CSS, this is actually a legitimate use case, for example as a "spoiler warning" class;

.spoiler {
  color: black;
  background: black;
}

.spoiler:hover {
  color: #fff;
}

This will black out text from the user until they hover over it.

Maybe this is a good rule to add for stylelint though?

Sigiller commented 8 years ago

@ben-eb Thanks you for explanation.