Imported CSS from other layouts still loaded
sea-grass opened this issue · comments
Chris Grass commented
I'm seeing an issue where CSS is incorrectly loaded from other layouts.
I reproduced the issue in a repo.
Reproduction steps:
- Create two routes simple and other and configure them to use layouts Layout.svelte and Other.svelte, respectively.
- Create two CSS files, simple.css and other.css. Inside the script tag of each layout, import their respective CSS file.
- Bug: Start the dev server and navigate to one of your routes. You'll see that on both routes, both simple.css and other.css are loaded.
- Expected behaviour: On the simple route, only simple.css is loaded. On the other route, only other.css is loaded.
eight commented
Elderjs bundles all styles from all components into a single file. Therefore it is better to use the component style in case you want to avoid the conflict.