Skip to content

[css-cascade] Can we use @scope for style isolation? #11002

Open
@bramus

Description

@bramus

CSS @scope is for selector isolation, not style isolation. Properties that inherit will inherit onto children beyond the scope’s scoping limit. From a lot of authors I hear that they expected it to be about style isolation.

I was wondering if it would be possible to extend @scope to do style isolation too – something I believe would be very helpful for web component authors.

Maybe a prelude like isolated? E.g. @​scope isolated (root) to (limit) { /* no authors styles get in or bleed out */ }.
Or maybe there need to be two flags? One to prevent styles from getting in, and one to prevent them from bleeding out?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions