Skip to content

Adding :scope pseudo-class support #1450

Closed
@corneliusio

Description

@corneliusio

This is actually not related to #901 perse, though it's possible it could inform it. I was thinking support for the :scope pseudo-class would make a lot of sense whether styles are scoped or global by default.

Currently, to apply styles directly to any root elements, some unique selector must be applied to it or them to do so. While this certainly isn't a real issue, it did make me start thinking if it should be necessary and how :scope might actually fit into Svelte from an ideological standpoint.

From what I can tell, pretty much everything is already present in svelte to more or less "flip a switch" for this kind of feature. I was able to play around a little and getting it working with just a few new lines of code.

But, I just wanted to throw this out there to see if anything stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions