SlexAxton / css-colorguard

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

bug with color name in url, no ignore image name #39

Closed alexander-akait closed 8 years ago

alexander-akait commented 8 years ago
const colorguard = require('colorguard');

colorguard.process('a {\n  background-image: url(../images/white.png);\n  color: #fff;\n}').then((result) => {
    console.log(result);
});
<input css 1>
  line 3  col 3  #fff collides with white  (2:34)

  ✖  1 collision found.
apexskier commented 8 years ago

It looks like this is due to pipetteur parsing colors without respect to where they are located. A rule that would avoid this issue is to not parse colors within url()s. I think that's the only place where you'd see this happen.