-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the problem
I am a front end developer and I love Svelte (been using it for years). The only (minor) issue I have is with the way the global CSS is done. Having styles in each +page.svelte file is fantastic, and I would like it to be that good for global styles as well.
Having to wrap every class in :global() is clunky and ugly and makes the code non standard.
In practice what I do on my large projects is use .css files, one for each section. The difficulty with this is then when navigating between sections of the site that have different .css files, each link needs the data-sveltekit-reload property or other workarounds to remove the old classes before loading the new ones.
Describe the proposed solution
Ideally every +layout.svelte <style> section will apply that CSS to every file on the same level or in a sub directory to it. That way we will have targeted globals.
So in the image below the CSS in +layout.svelte would only apply to everything in the portal folder and every sub route such as /portal/times

Importance
would make my life easier