pico icon indicating copy to clipboard operation
pico copied to clipboard

Fix landmark selectors not working properly for Svelte

Open hfcRed opened this issue 8 months ago • 1 comments

This PR adds additional selectors to the landmarks so they work properly on Svelte, as the framework forces a wrapping div around all body content, meaning landmarks can not be direct children of the body element.

Relevant Discussion

hfcRed avatar Mar 27 '25 17:03 hfcRed

You could just add id to that div

  <body data-sveltekit-preload-data="hover">
    <div id="app" style="display: contents">%sveltekit.body%</div>
  </body>

And then configure semantic root element in your scss file

@use "@picocss/pico/scss/pico" with (
  $semantic-root-element: "#app",
);

modagavr avatar Mar 30 '25 07:03 modagavr