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

I was wondering how `.foo div { .bar &, .baz, > .fred { .qux & { … } }` might expand. I think it might go something like this:

`.foo div { .bar &, .baz, > .fred { .qux & { … } }`

    for each complex selector in a nested selector list (cs)
        if (cs) starts with a combinator imply '& ' precedes it
        otherwise if (cs) contains a '&' do nothing
        otherwise imply '& ' precedes (cs)
`.foo div { .bar &, & .baz, & > .fred { .qux & { … } }`

    Substitute from inside to out, wrapping each substitution in :is() 
`.foo div { .qux :is(.bar &, & .baz, & > .fred) { … }` 
`.qux :is(.bar :is(.foo div), :is(.foo div) .baz, :is(.foo div) > .fred) { … }`

I think this is consistent with LeaVerou's answer

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


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

Received on Thursday, 27 October 2022 17:56:28 UTC