-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Imported/Declared CSS from $layout.svelte is not ignored with $layout.reset.svelte. Dev and Build include different CSS <link> in different order #1100
Comments
Also, after |
Can also confirm that stylesheets imported into the root Expectation is that module side-effects such as this would also be removed for routes with an associated |
My current workaround is to
|
Cross-posting from #1356 (comment):
|
It seems there is no solution to this problem for now. Closing this issue. |
Describe the bug
$layout.svelte
and a$layout.reset.svelte
for/admin
path$layout.svelte
, we declare some<style>
or import some stylesheetimport ../../../*.css or ../../../*.scss
.$layout.reset.svelte
, we declare same<style>
or import some stylesheetimport ../../../*.css or ../../../*.scss
.http://localhost:3000/admin
,svelte-kit dev
, both<style>
from$layout.svelte
and<style>
from$layout.reset.svelte
are applied.svelte-kit build
output, both<link href="layout.css">
and<link href="$layout.reset.css">
are applied.reset
the layout.build
output's<head>
tag,<link href="$layout.reset.css">
is preceded by<link href="layout.css">
, resulting in an output where style from$layout.svelte
are applied instead of$layout.reset.svelte
after build. Because of the declaration order of CSS.svelte-kit dev
output :svelte-kit build
output :Logs
No Logs.
To Reproduce
$layout.svelte
at the root ofroutes
folder$layout.reset.svelte
at any sub route (e.g /admin).$layout.svelte
and$layout.reset.svelte
.svelte-kit dev
andsvelte-kit build
.or
Reproduction Repo : https://github.com/DhyeyMoliya/sveltekit-css-issue
main
branch for<style>
examplestyle-import
branch fromimport ../../*.css
exampleExpected behavior
<style>
orimport "../../*.css" or "../../*.scss"
) from$layout.reset.svelte
only.$layout.svelte
should not be included in the output of a reset route (eg./admin
in this case).<link>
declaration should be correct.Information about your SvelteKit Installation:
Diagnostics
The output of
npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
System:
OS: macOS 11.2.3
CPU: (8) x64 Apple M1
Memory: 35.38 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.4 - /usr/local/bin/node
npm: 7.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 89.0.4389.128
Edge: 89.0.774.76
Safari: 14.0.3
npmPackages:
@sveltejs/kit: next => 1.0.0-next.78
svelte: ^3.29.0 => 3.37.0
vite: ^2.1.0 => 2.1.5
Your browser
Edge
Your adapter (e.g. Node, static, Vercel, Begin, etc...)
@sveltejs/adapter-node@1.0.0-next.14
Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of SvelteKit entirely?
Issue 1 - Severe - The
build
output anddev
should give same outputs.Issue 2 - Normal - Only the correct css should be applied
Note: the more honest and specific you are here the more we will take you seriously.
Additional context
I'm happy to give more explanation.
A SvelteKit REPL would really help in raising issues with examples.
The text was updated successfully, but these errors were encountered: