styled-components

As explained at Integration > CSS-in-JS and styled-components docs > Server Side Rendering, you need to collect the page's styles while server-side rendering the page to HTML.

This enables you to add the styles to the rendered HTML, so that the browser loads the styles before loading JavaScript.

You can follow along on this tutorial (vite-plugin-ssr was the previous name of Vike) on how to add styled-components to your Vike app.

Examples:

See also