Re: [csswg-drafts] [css-nesting-1] Syntax Invites Errors (#7834)

The CSS Working Group just discussed `nesting syntax`, and agreed to the following:

* `RESOLVED: We're taking option 3 over option 1`
* `RESOLVED: change the spec to reflect option 3`

<details><summary>The full IRC log of that discussion</summary>
&lt;astearns> topic: nesting syntax<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/7834<br>
&lt;ydaniv> astearns: who wants to present summary<br>
&lt;ydaniv> TabAtkins: we've got 4 options covering all the posibilites<br>
&lt;fantasai> Summary of Options -> https://github.com/w3c/csswg-drafts/blob/main/css-nesting-1/proposals.md<br>
&lt;ydaniv> ... option 1: either start with @nest or &amp;<br>
&lt;ydaniv> ... option 2: you have a parser switch and afterwards only declaration switch<br>
&lt;fantasai> s/only declaration switch/only style rules, so they're unambiguous and don't need special prefixing/<br>
&lt;ydaniv> ... option 3: your selector has to start with anything but an ident<br>
&lt;ydaniv> ... in a rare case where you do need to start with ident you can either use an &amp; or wrap it up with :is() or :where()<br>
&lt;ydaniv> ... option 4: what FRemy presented either as separate block or separate block following an &amp;<br>
&lt;ydaniv> astearns: we've had a poll. I wonder whether there's another combination of starting with 1 and relaxing later to 3.<br>
&lt;ydaniv> TabAtkins: not sure it's a good idea to change syntax<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to respond to astearns<br>
&lt;fremy> q?<br>
&lt;fantasai> -> https://github.com/w3c/csswg-drafts/blob/main/css-nesting-1/proposals.md#twitter-polls<br>
&lt;ydaniv> fantasai: lea did a couple of twitter polls which are also helpful<br>
&lt;ydaniv> ... we have a significant majority that ppl perfer &amp; at all time<br>
&lt;ydaniv> ... we have a large number of authors who are not going to be satisfied with option 1<br>
&lt;argyle> q+<br>
&lt;fantasai> s/perfer &amp; at all time/prefer not requiring &amp; at all times/<br>
&lt;jensimmons> q+<br>
&lt;astearns> ack argyle<br>
&lt;ydaniv> adam: there are many other projects with different syntax who are using different syntax and are not considered in the polls<br>
&lt;TabAtkins> (Tho note there are even larger ecosystems that are using nesting syntaxes without a required &amp; prefix.)<br>
&lt;lea> q+ to say "authors are not complaining" is not equivalent to "authors are satisfied"<br>
&lt;astearns> ack jensimmons<br>
&lt;ydaniv> ... just wanna make sure they're included in this conversation<br>
&lt;fremy> q+<br>
&lt;jensimmons> Meet is broken<br>
&lt;astearns> ack lea<br>
&lt;Zakim> lea, you wanted to say "authors are not complaining" is not equivalent to "authors are satisfied"<br>
&lt;astearns> q+ jensimmons<br>
&lt;ydaniv> lea: authors are not complaining, they just accept it is what it is. But I have seen authors complaining that current syntax is too noisy<br>
&lt;argyle> var(--foo) got the same response<br>
&lt;ydaniv> ... this is why we brought this up<br>
&lt;ydaniv> ... they really need nesting, but that it could be better<br>
&lt;emeyer> q+<br>
&lt;astearns> ack jensimmons<br>
&lt;fantasai> s/that it could be better/but they will use what they have, even if it could be better/<br>
&lt;ydaniv> jensimmons: I really like option 4 the best. It's really simple. Other options are really complicated. I feel like CSS should be fun and simpe<br>
&lt;florian> +1 to jensimmons<br>
&lt;astearns> ack fremy<br>
&lt;ydaniv> ... option 4 captures that<br>
&lt;ydaniv> fremy: I agree with what lea said. At the end of the day you have to ship something.<br>
&lt;argyle> q+<br>
&lt;ydaniv> ... ppl use what they have<br>
&lt;ydaniv> ... I would not object to option 3. It's not the best I think. I like 4 better.<br>
&lt;fremy> https://github.com/w3c/csswg-drafts/issues/7834#issuecomment-1292196313<br>
&lt;ydaniv> ... one point I want to highlight, option 4 is the least complexity<br>
&lt;ydaniv> ... we define 3 different syntaxes for nesting. It may change...<br>
&lt;jensimmons> q+<br>
&lt;TabAtkins> q+<br>
&lt;ydaniv> ... You have to consistently switch between syntaxes. I think this is a big weakness<br>
&lt;flackr> q+<br>
&lt;astearns> ack emeyer<br>
&lt;ydaniv> ... why add ambiguity when we can keep it simple. But if other ppl prefer other options and are comfortable with tradeoffs then we might as well do it<br>
&lt;ydaniv> ericmeyer: I like option 4. Makes the most sense as an author.<br>
&lt;astearns> ack argyle<br>
&lt;lea> q?<br>
&lt;ydaniv> argyle: may pick whatever syntax via any tool they choose.<br>
&lt;miriam> q+<br>
&lt;ydaniv> ... when you reason option 1 has the least things to remember. The least ambiguous<br>
&lt;ydaniv> ... feels like a win win win across the board<br>
&lt;fantasai> Option 4 is the most unambiguous, and quite likely the easiest to implement.<br>
&lt;fantasai> Whether it's the best, idk, but it's the most unambiguous<br>
&lt;lea> Not sure where it's founded that other options would take longer to implement. We only have one data point here.<br>
&lt;ydaniv> ... you don't have to remember what you can/can't use. Not need to teach what's an ident<br>
&lt;ydaniv> ... all options eventually rely on &amp;<br>
&lt;ydaniv> fremy: not true, option 4 does not<br>
&lt;astearns> ack jensimmons<br>
&lt;ydaniv> jensimmons: I don't really like the idea of us coming up with syntax now and changing later.<br>
&lt;TabAtkins> Big +1 to jen's point - adding new *functionality* later is fine, adding new syntaxes for no new functionality is bad.<br>
&lt;fantasai> +1<br>
&lt;ydaniv> ... as someone who's taught authors, I don't think it'll go well if we change syntax 3 yrs down the road<br>
&lt;ydaniv> ... our best shot is now<br>
&lt;lea> +1<br>
&lt;ydaniv> ... we should plan on our very best solution and be done with it<br>
&lt;ydaniv> ... I also believe strongly that nesting is important for ppl to code better and easier<br>
&lt;ydaniv> ... if they have to remember many rule with a lot of mental complexity it's an overhead<br>
&lt;ydaniv> ... not assume that using other tools is something everyone will be okay with<br>
&lt;fantasai> jensimmons: I want nesting to be easy and fast to use, I want it to be elegant, and if there's a bug it's a typo and not because you're using the wrong variant of syntax<br>
&lt;bramus> q+<br>
&lt;ydaniv> ... option 4 we haven't talked much about before. I haven't heard others talking about it much<br>
&lt;astearns> ack TabAtkins<br>
&lt;ydaniv> TabAtkins: I'd like to say what I don't like about option 4<br>
&lt;ydaniv> .... I'm very strongly opposed to 4. 1. it is not nested, feels unnatural<br>
&lt;bramus> +1<br>
&lt;JakeA> +1 to the it's-not-actually-nested issue<br>
&lt;ydaniv> ... the idea that it's chained after and not inside the block<br>
&lt;bramus> authors already know how to nest, from at-rules, markup, etc.<br>
&lt;ydaniv> ... option 4 is the only that's not compatibe with current state. It doesn't mix with the rest.<br>
&lt;florian> q?<br>
&lt;florian> q+ to respond to tab's argument 1 and 2<br>
&lt;fantasai> wrt style attributes, we could just allow the rule block to be placed inside the style attr, if we don't want to add a new attribute. This has the same parsing properties.<br>
&lt;ydaniv> ... if you want nest existing rules into other rules you have to go to bottom and add there<br>
&lt;lea> +1 to everything TabAtkins is saying<br>
&lt;ydaniv> ... in general having things in a sibling-wise way is not a greay idea<br>
&lt;florian> q-<br>
&lt;ydaniv> ... in parent-child relationship things are always nested. other options do that, 4 does not<br>
&lt;ydaniv> ... I also want to stress that this is harder to parse<br>
&lt;fantasai> s/is harder/is not harder/<br>
&lt;ydaniv> ... 1 &amp; 3 are identical. 2 is a bit harder<br>
&lt;ydaniv> ... 4 isn't difficult in any way, simply new<br>
&lt;fremy> q!<br>
&lt;astearns> ack florian<br>
&lt;astearns> ack fla<br>
&lt;ydaniv> flackr: we mentioned in option 3 that it's possible to relax further.<br>
&lt;astearns> q+<br>
&lt;ydaniv> ... it may be, but not a good idea<br>
&lt;ydaniv> TabAtkins: not a good idea ^_^<br>
&lt;astearns> ack miriam<br>
&lt;fantasai> s/good idea/possible idea/<br>
&lt;fantasai> TabAtkins: Selectors just have fundamentally infinite overlap with property:value delcarations<br>
&lt;ydaniv> miriam: I agree generally with what Tab said. option 4 is weird. It's all trade offs. 3 is the one I voted for.<br>
&lt;ydaniv> ... there's one rule to learn, always start with a symbol<br>
&lt;ydaniv> ... I like the idea that both allow for forgiving parsing<br>
&lt;astearns> ack bramus<br>
&lt;astearns> ack dbaron<br>
&lt;ydaniv> bramus: I think nesting without nesting is also inventing wierd things<br>
&lt;ydaniv> dbaron: I think that 4.iii variant is somewhat different than others. Having look at it more, looks like you have a selector and bunch of things after it<br>
&lt;ydaniv> ... after looking it while doesn't feel like a nested rule<br>
&lt;ydaniv> astearns: I was on the queue to say something similar<br>
&lt;dbaron> s/a nested/an un-nested/<br>
&lt;fantasai> -> https://github.com/w3c/csswg-drafts/issues/7834#issuecomment-1282700284<br>
&lt;fantasai> Conceptually, style rules would now have three parts:<br>
&lt;fantasai>     a selector<br>
&lt;fantasai>     a declaration block<br>
&lt;fantasai>     a style rule block (optional)<br>
&lt;TabAtkins> that extra indent is very significant!<br>
&lt;ydaniv> ... we also had another similar proposal of nesting a new block inside<br>
&lt;astearns> q?<br>
&lt;astearns> ack astearns<br>
&lt;ydaniv> ... which gets rid of the weirdness<br>
&lt;astearns> ack fantasai<br>
&lt;ydaniv> fantasai: my suggestion we have a lot of options<br>
&lt;ydaniv>  ... pick between 1 or 3 and then continue<br>
&lt;ydaniv> astearns: we're not picking a winner, we're choosing which avenue to take<br>
&lt;ydaniv> TabAtkins: I suggest we take binding votes<br>
&lt;bramus> +1 on binding vote<br>
&lt;ydaniv> fantasai: I think the problem is that ppl are trying to implement and we should be trying to resolve today<br>
&lt;ydaniv> ... suggest polling between 1 and 3<br>
&lt;fantasai> POLL: Option 1 vs Option 3<br>
&lt;TabAtkins> 3<br>
&lt;lea> 3<br>
&lt;fantasai> 3<br>
&lt;argyle> 1<br>
&lt;oriol> 1<br>
&lt;miriam> 3<br>
&lt;JakeA> 1<br>
&lt;flackr> 3<br>
&lt;dbaron> 3<br>
&lt;patrickangle_> 3<br>
&lt;futhark> 1<br>
&lt;bramus> 3<br>
&lt;jensimmons> 3<br>
&lt;ydaniv> astearns: taking 2 votes: whether to continue with 1 or change to 3 please put<br>
&lt;astearns> 3<br>
&lt;fremy> 3<br>
&lt;Sebastian_Zartner> 1<br>
&lt;emeyer> 3<br>
&lt;ydaniv> 3<br>
&lt;florian> 3<br>
&lt;ydaniv> astearns: looks very much in favor of 3<br>
&lt;ydaniv> fantasai: we're taking option 3 over 1<br>
&lt;ydaniv> RESOLVED: We're taking option 3 over option 1<br>
&lt;ydaniv> fantasai: anyone want's to add anything to this discussion?<br>
&lt;fantasai> s/this/3 vs 4/<br>
&lt;dbaron> s/this discussion/the discussion of option 3 versus option 4/<br>
&lt;ydaniv> astearns: I think that option 4 may get us to a better place<br>
&lt;ydaniv> fantasai: option 4 has to possible ways...<br>
&lt;astearns> the added punctuation could be '{}' :)<br>
&lt;ydaniv> s/to/two/<br>
&lt;fremy> q+<br>
&lt;jensimmons> q+<br>
&lt;dbaron> fantasai: ... two adjacent blocks, or some punctuation between them (which would allow omitting the first block)<br>
&lt;fantasai> s/to possible ways/two viable options/<br>
&lt;ydaniv> fremy: there's one thing I dislike, the idea that this is usability against "I don't like it"<br>
&lt;ydaniv> TabAtkins: I think this is a bad characterisation<br>
&lt;TabAtkins> q+<br>
&lt;astearns> ack jensimmons<br>
&lt;astearns> ack fremy<br>
&lt;ydaniv> jensimmons: I heard ppl say that option 4 doesn't feel like nesting because they're not nested inside. not like SASS.<br>
&lt;ydaniv> ... but I feel like I get that, I hated it, but then thought what it opens up, it became my first choice<br>
&lt;ydaniv> ... it lets me write more simply without repeating<br>
&lt;TabAtkins> Big objection against 4 is the inconsistency with other syntaxes or planned future syntaxes. At-rules - do they have to go in the property or the rule block? Nested @media - how do we do properties directly inside of it with option 4 syntax? This is common and popular in Sass, for example.<br>
&lt;ydaniv> ... feels like we're trying to solve reality where instead we could choose a different way to accomplish more<br>
&lt;astearns> ack TabAtkins<br>
&lt;ydaniv> TabAtkins: I said before that option 4 is incossistent with current syntax and others<br>
&lt;lea> Oh great point, +1 TabAtkins<br>
&lt;futhark> present-<br>
&lt;ydaniv> ... introducing a new postfix syntax will cause us problems in may ways<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to respond to Tab<br>
&lt;ydaniv> ... instead of using current syntax which works nicely<br>
&lt;ydaniv> fantasai: I agree with Jen about portability between contexts<br>
&lt;ydaniv> ... I have reservations against, options 3 has more rules to learn but portability troubles me<br>
&lt;ydaniv> ... we can make changes to syntax<br>
&lt;lea> q?<br>
&lt;ydaniv> ... there are ways around nesting media rules<br>
&lt;TabAtkins> 3<br>
&lt;JakeA> 3<br>
&lt;bramus> 3<br>
&lt;lea> 3<br>
&lt;argyle> 3<br>
&lt;fremy> 4<br>
&lt;astearns> 4<br>
&lt;ydaniv> astearns: shall we take 3 vs. 4 poll? please vote<br>
&lt;oriol> 4<br>
&lt;jensimmons> 4<br>
&lt;flackr> 3<br>
&lt;florian> 4<br>
&lt;dbaron> 4<br>
&lt;andreubotella> 3<br>
&lt;patrickangle_> 4<br>
&lt;Sebastian_Zartner> 3<br>
&lt;ydaniv> 4<br>
&lt;fantasai> probably 4<br>
&lt;jensimmons> ericmeyer isn't here, but he said 4 before<br>
&lt;dholbert> 4<br>
&lt;ydaniv> TabAtkins: editors choice<br>
&lt;ydaniv> lea: which editor?<br>
&lt;ydaniv> astearns: slightly in favor of 4<br>
&lt;ydaniv> ... if we want to take a binding resolution 4 wins<br>
&lt;ydaniv> TabAtkins: I would object, it's very annoying.<br>
&lt;ydaniv> argyle: I agree<br>
&lt;JakeA> Poll developers for 3 vs 4?<br>
&lt;ydaniv> astearns: we could change the draft to 3, and leave this question open<br>
&lt;ydaniv> florian: it's effectively making a decission<br>
&lt;argyle> its just a prototype, no intent to ship<br>
&lt;ydaniv> astearns: if we're conflicted then we should not ship<br>
&lt;ydaniv> lea: it's already implemented behind a flag<br>
&lt;ydaniv> astearns: then they're shippind shouldn't affect our decission<br>
&lt;ydaniv> jensimmons: I would be disappointed if google ships and this affects our process<br>
&lt;ydaniv> argyle: Google never intended to ship<br>
&lt;ydaniv> ... no one was intending to ship<br>
&lt;ydaniv> jensimmons: pressure is good<br>
&lt;astearns> ack fantasai<br>
&lt;ydaniv> fantasai: I think we should take suggestions to put options infront of developers and get more feedback<br>
&lt;ydaniv> ... we could get more colab<br>
&lt;ydaniv> ... would be reasonable to update draft to 3 think we like it better<br>
&lt;ydaniv> ... get more feedback about 4 and come back when we're more confident<br>
&lt;JakeA> The future is longer than the past :D<br>
&lt;ydaniv> ... we have to get it right, otherwise...<br>
&lt;ydaniv> jensimmons: what Tab said about syntax sounded intesresting would like to see example<br>
&lt;fantasai> s/otherwise/this is going to fundamentally change how we write CSS for ~80% of style rules for the rest of the life of CSS/<br>
&lt;fantasai> s/think we/since we/<br>
&lt;fantasai> s/like it better/like it better than option 1/<br>
&lt;ydaniv> argyle: I sugges writing many examples and see how it comes up<br>
&lt;fantasai> +!<br>
&lt;fantasai> +1<br>
&lt;ydaniv> ... with option 4 &amp; 3<br>
&lt;ydaniv> astearns: proposed resolution to change draft to 3 and leave 4 to another talk<br>
&lt;ydaniv> ... I don't think it's useful anymore<br>
&lt;ydaniv> RESOLVED: change the spec to reflect option 3<br>
&lt;ydaniv> astearns: who will take this to developers?<br>
&lt;ydaniv> lea: together with someone else<br>
&lt;ydaniv> fantasai: I can help<br>
&lt;ydaniv> miriam: me too<br>
&lt;ydaniv> fantasai: we should also mark it up in the draft for ppl to see<br>
&lt;ydaniv> astearns: done with this issue<br>
&lt;ydaniv> ... 10 mins break<br>
&lt;fantasai> s/it up in/issue into/<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7834#issuecomment-1292277520 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 26 October 2022 16:07:17 UTC