qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[DOCS] useStyles SSR inaccuracy?

Open wmertens opened this issue 3 years ago • 4 comments

I'm reading the tutorial for styles and following along in the example DOM and I see that (as I would expect) components that use useStyles emit their style just in front of their DOM node.

However, in the text it states that SSR puts the styles in head. This is incorrect, right?

It's only when toggling the Child component, and inserting the Child's style into HEAD, that the Sibling's style also gets moved into HEAD.

wmertens avatar Sep 29 '22 22:09 wmertens

Excuse me,Do you how to add style in ssr process? like this image

lightersss avatar Nov 11 '22 08:11 lightersss

@lightersss See https://qwik.builder.io/docs/components/styles/

wmertens avatar Nov 11 '22 08:11 wmertens

@lightersss See https://qwik.builder.io/docs/components/styles/

Should I use this https://qwik.builder.io/docs/components/styles/#inline-critical-styles? But it seems I can't import css file this way. And import "./global.css?inline"; doesn't work.

lightersss avatar Nov 11 '22 09:11 lightersss

@lightersss See https://qwik.builder.io/docs/components/styles/

Oh, It just worked with useStyles$.Thank you so much for your help!!😘

lightersss avatar Nov 11 '22 09:11 lightersss