7 ms·
"What’s your opinion on pre-processors like SASS and LESS? Does CSS have anything to learn from them? (...) My own favorites would be nested comments, and sing
by Kartificial 12y ago
"What’s your opinion on pre-processors like SASS and LESS? Does CSS have anything to learn from them?
(...) My own favorites would be nested comments, and single-line comments (starting with //). When CSS turns 50 I’ll tell you why they were not part of CSS from the beginning."
Now, this makes me really wonder why single-line comments weren't part of the spec from the beginning. And I can't wait 30 years... Anyone an idea?
- ggurgone 12y agosingle-line comments are already supported in the way that are invalid css :) so if you comment with // the stuff that follow will be ignored. Again, it is invalid CSS and I am not suggesting that you should use it, just bringing that up :) I personally like how single-comments works on pre-processors. They are ignored at compile time and therefore are a good way to comment on functions, mixins or anything that won't be compiled to raw CSS.
- phoboslab 12y agoBe careful with using // in CSS. It causes some browsers to completely ignore the whole rest of the CSS file after the line you wanted to comment out (iirc IE9 does this). When I want to quickly comment something out (and don't have an editor shortcut handy), I just put an 'x' in front of the property name. I.e.: xbackground-color: #f0f;
- ggurgone 12y agoYeah, well anything invalid :)
- deleted 12y ago[deleted]
- Raphael 12y ago/* single-line comment */