Skip to content

Provide an option to disable CSS scoping or auto-generated class names in components #15613

@algorm

Description

@algorm

Describe the problem

With @layer baseline widely available, it is easy enough to write desired styles in vanilla CSS without the need to fight against specificity and writing order issues.
I prefer writing my styles using CSS cascade layers and don't feel the need for Svelte's CSS scoping feature. I also don't like my HTML elements getting unnecessary auto-generated cryptic class names attached to them.

This has been brought to attention in past also but no activity there for long time.

Describe the proposed solution

As Svelte always prefers to embrace native web technologies over custom solutions wherever possible, there should at-least be an option in svelte.config.js to disable CSS scoping application wide for the users who don't want this nice to have feature.

Thanks for awesome work.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssStuff related to Svelte's built-in CSS handlingneeds discussion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions