Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.

Home Page:https://elderguide.com/tech/elderjs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imported CSS from other layouts still loaded

sea-grass opened this issue · comments

I'm seeing an issue where CSS is incorrectly loaded from other layouts.

I reproduced the issue in a repo.

Reproduction steps:

  1. Create two routes simple and other and configure them to use layouts Layout.svelte and Other.svelte, respectively.
  2. Create two CSS files, simple.css and other.css. Inside the script tag of each layout, import their respective CSS file.
  3. 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.
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.