styled-jsx
You can use Vike with styled-jsx
.
Example:
To use Vike with styled-jsx
:
-
Install:
-
Add styled-jsx
to vite.config.js
:
-
Collect and inject styles.
When using a CSS-in-JS tool, like styled-jsx
, you always need to collect the page's styles upon SSR in order to avoid FOUC.
If you use vike-react
/vike-vue
/vike-solid
, then see Tool Integration > CSS-in-JS.
See also