[csswg-drafts] When using @import scope(), are the imported styles 'nested'? (#11756)

mirisuzanne has just created a new issue for https://github.com/w3c/csswg-drafts:

== When using @import scope(), are the imported styles 'nested'? ==
In https://github.com/w3c/csswg-drafts/pull/11237 @andruud's draft language for `@import scope()` includes the following note: 

> Note: While the [=style rules=] within the imported stylesheet
> become [=scoped=],
> they do not become [=nested style rule|nested=].
> In particular,
> top-level selectors are not re-interpreted as [=relative selectors=],
> and the ''&'' pseudo-class maintains its non-nested behavior.

This behavior wasn't discussed is the original issue https://github.com/w3c/csswg-drafts/issues/7348

There has been [some discussion on the PR](https://github.com/w3c/csswg-drafts/pull/11237#discussion_r1962195156), but this seems like a better place to have the full conversation and come to a resolution. Applying scope without nesting would be a departure from the behavior of `@scope` rules.

@romainmenke points out that the difference makes it hard for tooling to merge files, and wrap the imported sheet in a scope block. And Anders says:

> We'd have to allow relative selectors top-level, but we could do that and spec that they are relative against :scope.
>
> (Re-interpreting & is deeply incompatible with Blink's implementation of nesting, but we don't have to let that guide the discussion.)


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11756 using your GitHub account


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

Received on Thursday, 20 February 2025 17:09:08 UTC