extractCss() returns empty string in Solid SSR environment #495
Open
Description
Here's an example demonstrating the problem:
https://stackblitz.com/edit/solid-start-bare-ts-g7hiuv?file=src/routes/index.tsx
I'm only using css()
for this demo, not styled()
.
I am generating the <style>
element using the following code:
<style id="_goober" innerHTML={extractCss()}>{' '}</style>
If you examine the HTML response in the network tab, you'll see that the <style>
element for goober is empty, even though I am using extractCss()
to generate the content.
The styles look correct once goober has had a chance to render them on the client side, but there is a flash of unstyled content.
I also tried this with another CSS framework - Stitches - and did not encounter this same problem - that is, the following code works as expected:
<style id="stitches" innerHTML={getCssText()}>{' '}</style>
...where getCssText()
is the Stitches equivalent of extractCss()
.
Metadata
Assignees
Labels
No labels