Eclipse: ignore warning "Undefined CSS class"

I use Spring and found this answer to a similar question, however, it is not at all satisfactory, since it requires a change in the project structure: Get Eclipse to recognize CSS included through the context in the Spring MVC project

So the question is, is it possible to somehow force Eclipse to ignore the warning "Undefined CSS class".

It's not just Spring, I may have some CSS classes that I use in JavaScript that are not in the CSS spreadsheet or for any other reason. A warning is displayed on every html element that uses the css class that it cannot find, for example:

<div class="js-something">Something</div> 

This class will not be defined in the .css file, as it is used only in JavaScript. Same thing with Spring, where .css is related to:

 <link href="<c:url value='/css/style.css'/>" rel="stylesheet" type="text/css" /> 

Or in an AngularJS project where html files are added using ng-include. This warning is really not very useful, perhaps by default it should even be turned off. I looked through all the Eclipse settings, but could not find a way to ignore such warnings. Can someone help me get rid of them?

+8
eclipse css validation warnings
source share
1 answer

Ok, I found it. Oddly enough, in the "Check" section, if you are editing the project settings, but not in the general preferences, why I could not find it when searching for preferences using the "Check".

In the project settings : web resources → validation → CSS

In general preferences : Web → HTML Files → Web Resources → CSS

Finally, my designs are no longer riddled with yellow markers.

+22
source share

All Articles