Comments on: Help choose the syntax for CSS Nesting https://css-tricks.com/help-choose-the-syntax-for-css-nesting/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Fri, 23 Dec 2022 15:09:00 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Geoff Graham https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798163 Fri, 23 Dec 2022 15:09:00 +0000 https://css-tricks.com/?p=376319#comment-1798163 In reply to M.

You might wanna give Jen’s post a closer read because it covers why we’re unable to use the same syntax as Sass or Less.

]]>
By: M https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798160 Fri, 23 Dec 2022 09:04:12 +0000 https://css-tricks.com/?p=376319#comment-1798160 I don’t understand why this even had to be put up for a vote. Just use the same nesting style as less and sass have been doing for years – it’s what frontenders already know and expect.

I’m glad regular @nest won.

]]>
By: Joy https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798159 Thu, 22 Dec 2022 22:12:51 +0000 https://css-tricks.com/?p=376319#comment-1798159 I also couldn’t see a way to vote.
If I could, I would vote to not have nested CSS at all. Every example is easier to read and copy and debug using the unnested CSS. I say leave the nesting stuff to pre or post processors, so that it’s optional.

]]>
By: Andy https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798154 Thu, 22 Dec 2022 08:00:42 +0000 https://css-tricks.com/?p=376319#comment-1798154 I dont understand why they say: In many of the following examples, the & is optional.
There is no example with “.foo.bar”.
But Option #3 is ok – i think.

]]>
By: Geoff Graham https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798152 Wed, 21 Dec 2022 18:19:47 +0000 https://css-tricks.com/?p=376319#comment-1798152 In reply to Gust van de Wal.

I think the intent is less about developers deciding and more about what Jen says at the end:

There’s a lot that goes into designing a programming language, not just the results of a survey like this. But knowing what web developers think after reading examples will help us with our ongoing discussions.

]]>
By: Gust van de Wal https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798151 Wed, 21 Dec 2022 18:11:25 +0000 https://css-tricks.com/?p=376319#comment-1798151 I see Jen mention the three original options (1, 2 and 3), the third of which was “enclosing nesting statements in brackets”. I don’t see that option being used in this article. What’s up with that? Am I missing something?

I do not believe developers should decide on these things, by the way. And yes, I believe that because of the current winner, option 3. The syntax forces you to use :is() sometimes, which imo is as unrefined as you can get and honestly a total disgrace to the language. Elegance had been thrown out the window, whereas the a:b problem could be solved by looking at what comes after — a semicolon (it’s a rule) or a bracket (it’s a selector and we’re nesting).
But maybe that’s my naivety talking, I haven’t taken part in these discussion before and maybe I’m missing a detail in my example as well.

]]>
By: Berwyn Powell https://css-tricks.com/help-choose-the-syntax-for-css-nesting/#comment-1798149 Wed, 21 Dec 2022 14:05:20 +0000 https://css-tricks.com/?p=376319#comment-1798149 I just tried voting, but can’t see any way to do so, just the results so far. Perhaps it’s been closed? Doesn’t seem like very long to keep the poll open though.

It’s a shame, as I would have gone for option #5, which is currently not the favourite. I like the simplicity of #3 and its similarity to SASS, but the potential for weird bugs and edge cases makes me a little nervous. This is about choosing what’s right for the future of CSS after all.

Option #4 just makes my brain hurt, so I’m glad that’s not the favourite at least.

]]>