As explained in the styled-components SSR docs we can collect the page's styles while server-side rendering the page to HTML.

This enables us to add the styles to the HTML so that the browser loads the styles before loading the JavaScript.

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


See also