News for hackers. Stuff that matters.
Re:CSS Modules by andrewingram on Wednesday August 19, 2015 @04:51AM (#10084327)
I've been using CSS Modules in a couple of projects (combined with PostCSS), am pretty happy so far.

I think you could actually go one step further and embed the stylesheet in the React component's module using a tagged template string, I haven't looked into how you'd get webpack to extract this into CSS files, but I'm sure it's possible.

Eg: https://gist.github.com/AndrewIngram/e3af5e8b70fd89a9a0d3

Re:CSS Modules by andreypopp on Wednesday August 19, 2015 @05:13AM (#10084398)
That (extraction) can be done (React Style does that) but for it to be consistent with JS semantics you need to evaluate code at build time because such template strings can contain interpolations from JS world.
Re:CSS Modules by andrewingram on Wednesday August 19, 2015 @05:19AM (#10084411)
Ah yes, forget about the interpolation issue. I knew there was a reason I stopped digging into it
Re:CSS Modules by xzyfer on Wednesday August 19, 2015 @04:59AM (#10084362)
I've thought about this also. Alternatively some mixed format file like yaml front matter style.