sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
17.81k stars 1.78k forks source link

sveltekit removes all styles from head #12142

Open eye-wave opened 3 weeks ago

eye-wave commented 3 weeks ago

Describe the bug

sveltekit removes all styles from head when elements such as h1 are added to

Reproduction

add h1 or div or any "visible" element to

Logs

No response

System Info

System:
    OS: Linux 6.8
    Memory: 6.28 GB / 14.99 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 21.7.3 - ~/.local/share/mise/installs/node/latest/bin/node
    bun: 1.1.3 - ~/.bun/bin/bun

Severity

annoyance

Additional Information

No response

MotionlessTrain commented 3 weeks ago

<head> elements aren't allowed to have visible elements in them (just things like a title, scripts, styles, and meta tags). Those all need to go in the <body> of an HTML-document. <svelte:head> allows you to add additional elements to the <head> of the document

eye-wave commented 3 weeks ago

i know that, but if you add those anyways, sveltekit just nukes all of your styles

eltigerchino commented 3 weeks ago

Please provide a minimal reproduction in the form of a repository, sveltelabs, or stackblitz project.