Re: [csswg-drafts] [css-nesting] Problem with mixing properties and selectors (#8249)

FWIW, I also do not think an at-rule approach has any future. The fact it was rebuked in the working group several times is not a cause but just a symptom of why. The whole point of the nesting feature is to be easier to type and maintain than repetition, so adding an extra indentation level and a sizeable prefix will get a strong opposition from authors, because it's defeating the point of the feature. They will continue to use a module like SASS or LESS or SCSS to compile their code because they will offer a better alternative. If we do not provide authors with a soluation at least as elegant as these engines, we might as well not provide anything.

> The look-ahead approach, while much better than option 3, still has some issues, namely:
> 
> - Requires parser changes - these have bitten us in the past more often than not and must not be taken lightly.

I would argue that the parser changes proposed here are marginal, and will not affect current authors at all.

> - Still has some restrictions on future syntax, they are much smaller than option 3, but they exist.

Not being able to add a top-level bracket in a css property value in a position other than the first. This is not a real restriction, we would not consider this at all. I would probably argue that we should never introduced top-level brackets in css property values, this is un-css and confusing. We should at the very least always wrap that in a function.

> - Has issues with error recovery. Since declaration recovery and rule recovery differ, unrecognized rules in declaration blocks will eat the following declaration. This will surprise authors.

Do you have an example?

> - We still need to define feature detection somehow.

I agree, but this is orthogonal.

> - The syntax, while SASS-like, doesn't have quite the same behavior.

I am not that familiar with SASS, but can someone explain what those differences are?

-- 
GitHub Notification of comment by FremyCompany
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1500992543 using your GitHub account


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

Received on Saturday, 8 April 2023 22:52:51 UTC