SlexAxton / css-colorguard

Keep a watchful eye on your css colors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Same colors isn't collide

Sigiller opened this issue · comments

No collides with this colors:

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

But I have collide warning with this:

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

Duplicate of #30. 😄

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?

@ben-eb Thanks you for explanation.