survivejs / site

survivejs.com
https://survivejs.com/
Other
68 stars 22 forks source link

Try CSS Modules or CSS in JS for styling #74

Closed sapegin closed 6 years ago

sapegin commented 6 years ago

Maybe not CSS Modules but seems like the easiest to migrate. Other ideas?

Investigate Styled Components, Emotion, JSS.

bebraw commented 6 years ago

I know CSS Modules would work. Easy to set up too.

Which css-in-js solution allows easy style extraction these days? Is there something particularly good for static sites?

sapegin commented 6 years ago

I can explore this a bit, I’m curious too ;-)

bebraw commented 6 years ago

Ok. css-in-js is acceptable as long as we can get a CSS file out of it neatly.

sapegin commented 6 years ago

I guess we may have issues with hot reload.

sapegin commented 6 years ago

https://medium.com/styled-components/the-simple-guide-to-server-side-rendering-react-with-styled-components-d31c6b2b8fbf

But they are rendering one page and extract styles for one page only. Not sure how it will work with multiple pages. It also returns HTML, not CSS. Looks like they don’t support CSS extraction and likely won’t.

sapegin commented 6 years ago

https://github.com/emotion-js/emotion/blob/master/docs/extract-static.md

Emotion has something but it requires a Babel plugin.

bebraw commented 6 years ago

Emotion has something but it requires a Babel plugin.

Babel is fine. That sounds promising. 👍

sapegin commented 6 years ago

Yeah, we can try couple of components.