I’m using less file to define styles in my Web Application.
Unfortunately, every time I use the “important” declaration in Visual Studio 2012, for example:
color: #FFFFFF !important;
i get the following Warning:
Validation (CSS 3.0): "important" is not a valid value for the .... property.
But the “!important” declaration is working properly and I need to use it.
What I am doing wrong? Are there some wrong setting in VS options? I’m also using “Web Essentials 2012” extensions for VS 2012.
You are not doing anything wrong. I haven’t tried VS2012, but the HTML5/CSS3 validator in VS2010 was not to be trusted – I can’t remember if this was a MS or third-party add-in, but I remember the developer admitting that this was only experimental.
I notice that you correctly write
!importantbut that your error log writesimportant(without the exclamation point). Could it be that VS2012 for some odd reason skips those? You should consider filing a bug report.!importantis certainly valid, but should be avoided in any case, as it’s hard to override. Therefore, some validators will give you a warning due to them being bad practice. Practising a slightly higher specificity to override styles will save you a lot of headache.TL;DR:
Simply ignore the error and keep rocking on.