less.ruby icon indicating copy to clipboard operation
less.ruby copied to clipboard

Comment in property name causes syntax error

Open rmunch opened this issue 11 years ago • 1 comments

Although this is probably not great CSS, I came across a third-party library that less is chocking on because the library uses a workaround for IE5:

.test { display/*/: none; / Hide for IE5 */ }

The problem is with the /**/ in the property name.

If this is invalid CSS, I can file a bug with the library's maintainer. Thanks!

rmunch avatar Sep 14 '12 21:09 rmunch

It's not valid CSS. It's commenting out the value. Also, if it's only for IE5, you should consider removing it completely.

It should be:

.test { display: none; /* Hide for IE5 */ }

hemmendinger avatar Sep 23 '12 15:09 hemmendinger

I don't think it's considered valid CSS. From the W3C:

Comments begin with the characters "/" and end with the characters "/". They may occur anywhere outside other tokens

The "other tokens" would consist of the colon and semicolon. Essentially, anywhere outside of a CSS rule.

mindfullsilence avatar May 30 '13 02:05 mindfullsilence