philipwalton / html-inspector

HTML Inspector is a code quality tool to help you and your team write better markup. It's written in JavaScript and runs in the browser, so testing your HTML has never been easier.
2.32k stars 145 forks source link

Pure CSS stylesheets not found / classes not recognized #44

Closed lkraav closed 10 years ago

lkraav commented 10 years ago

"The class 'pure-u-1-3' is used in the HTML but not found in any stylesheet."

But the grid works and everything is fine on the page. Loading HTML Inspector 0.8.0 from cdnjs.

Demo https://c9.io/lkraav/html-inspector-pure-css/workspace/hello-world.html

philipwalton commented 10 years ago

It looks like they're using attribute selectors (instead of classes) in the CSS for some reason:

.pure-g-r [class*="pure-u"] {
  font-family: sans-serif;
}

So, HTML Inspector is correctly telling you that the class is not in the CSS even though a matching rule is. In cases like this you can whitelist those classes to avoid warnings.

lkraav commented 10 years ago

Yes indeed I thought that could be it. What's the reason Inspector cannot recognize selectors?

erikwoods commented 8 years ago

It is unfortunate that we have to write exceptions for attribute selectors. :( I have many.