Eric Burel @ericburel.tech · Mar 1

The PageHeader is the first component I meet,and it comes with a good surprise: it uses Styled Component, a CSS-in-JS libs, while CSS-in-JS is notoriously not compatible with server-only rendering because of its runtime requirements! I need to read some docs about styling in Astro

0 likes 2 replies

?

Replies

Jan Nicklas · Nov 9

we created a solution for next.js which compiles styled-components to static css using rust that allows using css-in-js also for server side renderings unfortunately it is next.js only right now

Eric Burel · Mar 1

I don't want to swear on Bluesky (it's not Twitter) but GOOD LORD Astro does have scoped CSS from WITHIN the file! Next.js has like ten ways of styling components with CSS modules or global styles, but lacks the simplest one: writing your CSS within the component docs.astro.build/fr/guides/st...