Aren't they just using BEM, which is a quite popular css methodology? I don't see how this is a bad thing.
Aren't they just using BEM, which is a quite popular css methodology? I don't see how this is a bad thing.
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/995f8b389a66ab76e...
I dislike BEM because it requires modification of CSS classes to change how something looks - you add and remove classes to your `.login-box` to make it bigger or bluer or wider.
I prefer CSS auto-nesting (using Svelte) or SASS nesting (for older projects) so I can just modify my `.login-box` to add whatever styles it needs and not touch my HTML.
.compose-form .compose-form__modifiers .compose-form__upload-description input::placeholder { opacity: 1; }
.compose-form .compose-form__modifiers .compose-form__upload-description input::placeholder { opacity: 1; }
That looks like BEM, with all the underscores and modifiers.Proper nested SASS would look like:
.compose-form .upload-description input::placeholder { opacity: 1; }
Scoped CSS would look like: .compose-form-abc123 .however-deep-or-shallow-you-want { opacity: 1; }