Skip to content

Support native css scoped, at-rule @scope #10807

@alkorlos

Description

@alkorlos

Describe the problem

Chrome has supported @scope since last year, Safari released on the fourth march this year supports @scope, Firefox comming. Soon all browser engines will support native css scoped.

Svelte scoped CSS in this way:

Adding a class to affected elements, which is based on a hash of the component styles (e.g. svelte-123xyz).

To disable this behavior can by adding :global to each class or by installing a library like svelte-preprocess and adding a global attribute to each style tag. These options are not convenient.

Need the ability to disable Svelte scoped CSS globally.

Describe the proposed solution

Add the option scopedStyle: boolean to svelte.config.js to disable Svelte scoped styles.

Importance

would make my life easier

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