css-modules / css-modules-require-hook

A require hook to compile CSS Modules in runtime
MIT License
484 stars 44 forks source link

Example project #13

Open geelen opened 9 years ago

geelen commented 9 years ago

Much in the same spirit as the browserify, jspm and webpack demos, I'd love to see a simple project using css-modules-require-hook to load CSS and render templates with it on the server side.

Is that something you could take on, @sullenor?

geelen commented 9 years ago

I'm thinking something simple like express, but honestly whatever you'd like to use.

mightyaleksey commented 9 years ago

Sure

I started one earlier. I wanted to try react + redux, so I made a project-stub with a simple demo of the popular game. It uses express on the server side and still lacks css-modules (I will update it soon :)). I'm not sure if it will be a good example. It can be a bit difficult for the beginners.

See the link below: https://github.com/sullenor/skeleton

mightyaleksey commented 9 years ago

@geelen Finally, I managed to make a simple project. In reference to the popular tradition I decided to make a todoApp :) Figuring out how to use the new redux-react package took some time from me. Anyways, check it out!

https://github.com/sullenor/todos

geelen commented 9 years ago

That's great! I'm not quite clear on what's different between this and a normal React/Redux app though? Maybe flesh out the README to point folks at the important points?

mightyaleksey commented 9 years ago

Yeah, my bad. I guess I was obsessed a little with React and Redux. May be I should make something simpler like browserify- or webpack- demos.

geelen commented 9 years ago

No I think what you've done is great, just maybe help some people understand how it all hangs together.

You could also do a few interesting things, like move the global body styles into an actual CSS module then reference that from the index.jade somehow? That should be possible, right?

mightyaleksey commented 9 years ago

You could also do a few interesting things, like move the global body styles into an actual CSS module then reference that from the index.jade somehow? That should be possible, right?

I guess so :) Honestly I wasn't sure in choosing a good variant to do that. Also I think about opportunity of making flexible way to change themes with CSS variables. Looks like adding another postcss-plugin will help here.

mightyaleksey commented 9 years ago

Thank you for sharing your thoughts with me, I'll try to update it in next few days.

boyswan commented 9 years ago

A webpack demo would be great if possible, trying to figure out how to fix the path errors

bdefore commented 9 years ago

:+1: for a webpack example. i'm looking for a way to render serverside modules that use compose and as i understand it's still unsolved, although this library could conceivably fix it

yacodes commented 9 years ago

Hey, guys! I've created a simple webpack + redux + css-modules-require-hook todomvc example app, please check it out https://github.com/canvaskisa/redux-css-modules-todomvc I'd very appreciate your comments and questions, hope that example will help.

mightyaleksey commented 8 years ago

Okay, I made another demo and wrote detailed description. If you'll have questions, please, send me a note :)

svnm commented 8 years ago

Thanks @sullenor for your awesome easy to follow demo. I made a similar one based on yours with react-router-redux and isomorphic-fetch. Great work :+1:

maxgram commented 6 years ago

I'm using css-modules-require-hook in react-saga-universal boilerplate