-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow inclusion of global styles #1948
Comments
Just realized that |
@ebeloded Hi, I have this problem too, the stylesheet file I import in __layout.svelte doesn't exist in the initial markup. How did you fix this?! |
not quite sure where to put this -- there are several issues (open and closed) discussing this and (relatedly) possible changes to the root
|
@benblazak honestly, that's really useful and it's really nice to see this posted somewhat relatively recent (in terms of bug searching online haha). Though I could've sworn there was already a |
@ErraticFox it's been discussed (here's another open issue) and apparently there is something similar in sapper. as far as i know you have to do it manually in sveltekit. hopefully i'll notice if the team decides to change that :) |
Going to close this in favour of #1530, as it's essentially the same feature request, the only difference being that this issue focus on CSS rather than including generic code |
I don't check GitHub comment responses often, but I think I was getting Edit: to add to that, it isn't bad honestly. It's just more or less fighting with (carbon-framework) the framework. If it doesn't override the style I'm trying to apply, I just got to find a way to make the selectors more dominant (idk the terminology for that css jargon) so that they overrride the frameworks style without having to use |
Describe the problem
Currently the recommended way to include global styles is to add it to root
__layout.svelte
, as was suggested by Rich and supported with this PR (#726):The issue is that these styles are not linked in rendered HTML (like
start.css
), but rather are included at runtime with JS.This means that
Describe the proposed solution
app.[scss|less|css]
done by SvelteKitapp.ts
living alongside app.html, included by SvelteKit. This file may import global styles, but also some scripts, which wouldn't make sense to include in layouts.app.html
smarter (Parcel style), allowing it to include files in whatever format, which would then be compiled to js/cssAlternatives considered
An alternative is to compile CSS separately from SvelteKit and include hashed filename in app.html during build.
Importance
nice to have
Additional Information
Related issues:
#714
The text was updated successfully, but these errors were encountered: