css-modules / webpack-demo

Working demo of CSS Modules, using Webpack's css-loader in module mode
https://css-modules.github.io/webpack-demo/
1.49k stars 180 forks source link

Document example of :local #4

Open jokull opened 9 years ago

jokull commented 9 years ago

I’m still not sure what :local does exactly or what kind of scenario it would be helpful in. Another example would help.

I’m also trying to figure out how to share a "family" of classes without too much boilerplate code. An example would be an <input> that shares valid/required/error/etc. states across an app. Currently you can easily import directly from a shared/input.css and use those classnames, but as soon as you want to customize one state for that component (say; increase the size) your composed classname won’t pick up all the other definitions (.valid, .error, etc.). I guess the solution here would be to not compose and just use multiple classnames?