Skip to content

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

Open
@mirisuzanne

Description

@mirisuzanne

In #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 #7348

There has been some discussion on the PR, 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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions