Re: [csswg-drafts] [css-nesting-1] Name, terminology, and nesting selector misnomers are footguns (solution proposed) (#8329)

> I have no idea what you mean. Only `@scope` is an at-rule; Nesting isn't.

It's `@nest`, no?
 
> Yes, :scope allowed anywhere. I'm not sure what point you're making here, tho.

That it being allowed anywhere and everywhere would be needed for "nesting" and is generally limiting if not allowed.

If it already is as you say, it's not being indicated in that spec right now. That it seems to enforce root + descendants only for scopes (hard to really be sure, it's implied throughout, but only gets touched upon under the scoped descendant combinator), my reading is that `scope-start` and any selectors within `@scope` always effectively begin `:is(:scope)` and `:is(:scope) ` (note the space for descendants) and that can't be modified by putting `:scope` in the selector at different positions (attempts to do so would seem unlikely to match anything and be on any use to anyone).

Impractical examples:
```css
@scope (.inner) {
 .outer :scope.special {...}
}
```
Would be scope `.inner`, with selector `.outer :scope.special` instead of `:is(:scope).outer :scope.special, :is(:scope) .outer :scope.special`.
```css
@scope (.inner) {
 @scope (.outer :scope.special) {
  ...
 }
}
```
Would be outer scope `.inner`, with inner scope `.outer :scope.special` instead of `:is(:scope).outer :scope.special, :is(:scope) .outer :scope.special`.

(Whether or not the parent mechanism should modify the meaning of `:scope` so `:is()` and/or root + descendants are always automatically applied even when it's explicitly given, can be a separate discussion, but right now, I don't see that they do).

> It's a perfectly reasonable selector. `@scope (.one) { .two { :scope.three * {...}}}` is equivalent to `@scope (.one) { :scope.three .two * {...}`

Not sure I'd call that a "perfectly reasonable" selector, and certainly that's why I see now how I read it wrong. There's obviously better ways to write it in the first place, and I still don't see anywhere in the spec that allows it to mean anything but scope `.one` and the selector `:is(:scope):scope.three .two *, :is(:scope) :scope.three .two *`, which isn't useful. I'm suggesting the selector would be `:scope.three.two *`, which seems to be what you want and believe it is already... Where am I missing the definition that allows that change of behaviour?

> [Scoping has a meaning.](https://w3c.github.io/csswg-drafts/selectors/#scoping) `:not(&)` isn't scoped by that meaning, nor by a more casual meaning - the elements being selected come from anywhere on the page, with no particular relationship to the elements from the parent rule besides being "not them".

I will concede I have not read most of selectors-4 in several years, and I see the language was updated to not allow anything but the former _scope-filtered_ meaning since 2018. It used to have more permissive meanings and _scope-relative_ allowed the meaning I'm giving here, so I guess I'm making an argument for that being allowed again.

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


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

Received on Thursday, 26 January 2023 00:00:42 UTC