I just imported like this in +page.svelte:
<script>
import '@picocss/pico'
</script>
You can see the linked code in action here: https://m.leftium.com/
I haven't tried importing from +layout.svelte, but I think that would work, too.
There is a Github issue comment that explains how to integrate Pico CSS with SvelteKit even more thoroughly:
Pico depends on main
, footer
, header
being direct children of body
for certain layouts, but that's not possible with sveltekit if you are doing it right.
However, pico has a $semantic-root-element
variable that you can set as this element: <div style="display: contents">%sveltekit.body%</div>
. So far this has fixed that for me but I haven't tried everything.
I did it like this.
<!-- app.html -->
<div id="pico-root" style="display: contents">%sveltekit.body%</div>
// variables.scss
$semantic-root-element: "div#pico-root"
// OR whever you import pico
$semantic-root-element: "div#pico-root"
@import '@picocss/pico/scss/pico';