3 ms·
Well these all suck. Obviously `@nest always` and `brackets` are the same in disguise, and are here cause they're conceptually cleaner. The problem with both
by d--b 4y ago
Well these all suck.
Obviously `@nest always` and `brackets` are the same in disguise, and are here cause they're conceptually cleaner.
The problem with both of these is that they're unnecessarily verbose.
Why not have a shorter token than `@nest` and something that doesn't want more indenting (like `{}`)? For example `\`? And then if you want to make things a little less verbose, just assume the first character is going to be `&` cause that's going to be 99% of use cases.
And then you get something like this:
foo {
color: blah;
\ h2 { font-weight: bold }
\ h3 { font-weight: bolder }
\ i > & { ... }
}
But no one ever listens to me!
- LocalPCGuy 4y agoIsn't that effectively what you get with the first option (with the `&` character)? You don't need `@nest` unless you want to embed the ampersand as anything other than the first character (which, I'll admit, is one of my major use cases). But given the prevalence of @ elements in CSS already (like @media for example), I'm ok learning/teaching @nest for those specific cases.