URLs in CSS: How to make IDEA resolve them correctly

My CSS files are not in a web resource directory, but under a source root, because a servlet dynamically merges and minifies them (or not, depending on a debug request param).
Unfortunately now all references like
    background-image: url(../images/tall-grid3-hrow-over.gif);
are highlighted as an error ("cannot resolve file") that cannot even be suppressed.
I could only turn off the complete "Invalid CSS element" inspection, but that is much too valuable for other cases.

I just hate that red rectangle and stripes in the right gutter.
Is there any way I can make IDEA resolve the references correctly (or at least turn this specific error to info level)?

Comment actions Permalink

It is possible to change Severity level for CSS / "Invalid CSS element" inspection. See attached image.

Comment actions Permalink

I would rather not do that,  because I want the inspection to clearly scream about goodies like this,  that I find frequently in legacy code:
text-align: middle;

Shouldn't the Web Context settings be taken into account?
For JSP files I can specifiy a context by clicking on hector.
There  is also the Web Context settings in the peroject settings, but I don't  understand where to configure a new context - all I get to choose from  right now are "/" and "Clear".

Comment actions Permalink

That makes sense.
Stephen, please file an issue in the http://youtrack.jetbrains.net/issues/IDEA#newissue=yes (select subsystem: CSS Editing).


Please sign in to leave a comment.