Skip to content
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

Feature request: option to make all CSS global #1352

Closed
nolanlawson opened this issue Apr 18, 2018 · 2 comments
Closed

Feature request: option to make all CSS global #1352

nolanlawson opened this issue Apr 18, 2018 · 2 comments

Comments

@nolanlawson
Copy link
Contributor

First off, Svelte is awesome. 😃 I love it; it's my favorite framework ever.

The fix to remove scoping via attributes (#1118) is awesome, but I already architected my Svelte/Sapper app to make all CSS selectors global, in order to make the CSS as tiny as possible. (I just trust myself not to allow class names to collide. It's not as bad as it sounds. 😉)

To achieve this right now, I have a script to run a regex before sapper build to add :global() to every CSS selector (and remove it when the build is done). Obviously this is less-than-ideal, and I would love to just have some kind of global: true option or something to make everything global-by-default.

In terms of how this works with shaking out unused CSS, again I am just trusting myself not to make that mistake. Already there are plenty of places where I'm injecting unknown raw HTML anyway, and so I would have to have some :global()s even if I were not using this script.

Thank you for making Svelte/Sapper! 😁

@ekhaled
Copy link
Contributor

ekhaled commented Apr 19, 2018

Related #901

This is something I'd also like to see in v2

@nolanlawson
Copy link
Contributor Author

Yes I think #901 probably covers my request, so this issue should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants