2 ms·
I'm not saying using BEM is a bad thing. Not at all, I'm using it too and like how it plays with Sass/scss. e.g. I do like how Sass makes it easier to write BE
by redmaniack 8y ago
I'm not saying using BEM is a bad thing. Not at all, I'm using it too and like how it plays with Sass/scss.
e.g. I do like how Sass makes it easier to write BEM-like code similar to the below:
// style.scss
.btn {
...
&--success {
... .
}
}
// style.css
.btn {...}
.btn-success {...}
But when abusing Sass nesting and choosing a weak naming convention, the resulted CSS selectors can go wild. Here's an example:
https://github.com/tootsuite/mastodon/blob/995f8b389a66ab76ec92d9a240de376f1fc13a38/app/javascript/styles/contrast/diff.scss https://github.com/tootsuite/mastodon/blob/995f8b389a66ab76e...
- JeremyBanks 8y agoIs output verbosity a problem? Narrower selectors are easier to reason about and faster to process, and compression should take care of most of the size difference, since it's so repetitive.