-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Ability to disable css scope across entire application #4764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can already do this by wrapping all selectors in |
There are multiple ways to achieve what you are describing:
|
I give up, it seems nobody is willing to listen. At this point it's become clear I can't use Svelte in my projects. I'll move on to a different framework. Sorry to bother y'all, thanks for fielding the questions. If you could point me at the part of the svelte code responsible for the CSS scoping so I could create a monkey patch for my own use that would be great, but otherwise I've given up hope. |
|
For example, I have an Component named |
Would like to see something like
I'm currently building a rather large application with SvelteKit. Can confirm it's becoming just a tad bit cumbersome to micro manage alternating sources of truth for certain styles. As of now I need to equip certain elements with additional classes to be able to address them from a centralized CSS/SASS file. Would love to have more of a cleaner Svelte way available for local / descending styles. |
Ran into the the same thing here when attempted to style a child component from a parent please reconsider adding option to disable CSS scoping project wide / plugins: [
svelte({
compilerOptions: {
dontMangleStyles: true
}
}), Yes i get it that having global css in components is scary for many of us, but steering people towards an ideology is just as bad. I strongly suggest that svelte should take a neutral stance to this design choice, as products are going to run into scaling issues regardless if they choose scoped or global styling, no solution just tradeoffs. This ticket documents a real scaling issue for framework adoption and growth, please reopen 🙏 |
Is your feature request related to a problem? Please describe.
Problem: Svelte does not provide sufficient flexibility when implementing CSS. For example, the ability for scoped components to modify styles related to other components or to modify component scope.
Describe the solution you'd like
Since I am unaware of a way to accomplish this using existing Svelte methods, I would like a way to disable Svelte's CSS scoping application-wide. The ability to disable scoping would allow me to custom implement scoping either on my own or via third party plugins.
Describe alternatives you've considered
Neither of these features are unique and both exist in competing frameworks.
How important is this feature to you?
I cannot use Svelte, either in legacy applications or new ones, until I have a way for scoped components to modify the CSS of other scoped components.
The text was updated successfully, but these errors were encountered: