3 ms·
Isn't stuff like leaving out comments kind of redundant if you use Sass or Less? Just use one of those and have them auto strip out CSS comments. That way, th
by CM30 11y ago
Isn't stuff like leaving out comments kind of redundant if you use Sass or Less?
Just use one of those and have them auto strip out CSS comments. That way, the developers can figure out how stuff works from the well formatted .scss files and get the performance benefits from the minified .css ones.
Also, was kind of surprised to see no mention of CSS preprocessors in this guide.
- grvcoelho 11y agoAbout comments: your CSS shouldn't need it! About preprocessors: the styleguide was created to be preprocessor-agnostic. Also, I suggest using Postcss instead.
- CM30 11y agoThanks for the explanation about preprocessors and such. But CSS not needing comments? That's a nice thought, but it kind of becomes awkward in a large organisation with a massive development team. Like the kind you need to develop the large applications mentioned in the post title. I mean sure, it would be ideal if your CSS was so easy to read that any future developer could figure out what everything referred to in an instant. But for something like say, Facebook, or Google, or Amazon, it seems rather unlikely that someone new to the team can figure out why every single CSS rule was implemented in the way it was or where each class refers to without some sort of help. Strip out comments, and what's left? Someone walking them through the entire CSS structure of the site? A couple of days in the web inspector? An actual manual?
- grvcoelho 11y agoThe only case I think it's okay to use comments is for browser-specific hacks or a set of rules that is hard to understand. But I would avoid these cases if I could!