You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently writing the JSPM loader implementation, and Browserify shouldn't be too difficult for someone who understands the internals. Basically, all the syntax transformations are being done by the three PostCSS plugins: postcss-modules-local-by-default,postcss-modules-extract-importsandpostcss-modules-scope. But then the file contains:importand:export` primitives, which aren't documented outside of webpack/css-loader#60. That's what needs to be specialised between Webpack/JSPM/Browserify, and then the whole package needs to be bundled up into an easy-to-install project.
Btw, by dropping postcss-modules-local-by-default off the chain, you get opt-in CSS Modules behaviour, since the other two plugins look for :local directives before they do anything. But when both Webpack & JSPM have loaders, it'll be easier to follow.
If you in general stick to BEM conventions in all your modules, it works quite fine and the project can in general be extended with a lot of rework plugins and in the the future postcss is planned. There is already support for autoprefixer :-)
If you want to learn a bit more - even though it currently lacks some "user friendlyness", you could follow this tutorial atomify slides
If you do, i recommend you to spend some time with each slide not just copy & pasting commands, but thinking about them and analyzing what was created in your directories and text editor.
In the slides, 2 components get created, were one is using the other. Additionally, at the end, the themeing which i described above is demonstrated.
Activity
sokra commentedon May 27, 2015
Currently not. Currently CSS Modules are only possible with webpack.
But @joshgillies want to write a browserify transform once we get the stuff ready: webpack/css-loader#60 (comment)
shama commentedon May 27, 2015
@knownasilya There is https://github.com/shama/webpackify ;)
knownasilya commentedon May 27, 2015
Sweet! I'll see how that works!
geelen commentedon May 27, 2015
I'm currently writing the JSPM loader implementation, and Browserify shouldn't be too difficult for someone who understands the internals. Basically, all the syntax transformations are being done by the three PostCSS plugins:
postcss-modules-local-by-default,postcss-modules-extract-importsandpostcss-modules-scope. But then the file contains:importand:export` primitives, which aren't documented outside of webpack/css-loader#60. That's what needs to be specialised between Webpack/JSPM/Browserify, and then the whole package needs to be bundled up into an easy-to-install project.Btw, by dropping
postcss-modules-local-by-defaultoff the chain, you get opt-in CSS Modules behaviour, since the other two plugins look for:localdirectives before they do anything. But when both Webpack & JSPM have loaders, it'll be easier to follow.serapath commentedon May 29, 2015
I'm not sure if that solves the same problem, but are you aware of atomify?
You can create a project called
mybuttoncssthat contains just:and publish it to
npm. Then, in another projectbuttontestyou do:npm install mybuttoncssand in that projectsbuttontest/index.cssyou write:Advanced
If you want to pass variables around, you can just define in
mybuttoncssproject:and then in
buttontestIf you in general stick to BEM conventions in all your modules, it works quite fine and the project can in general be extended with a lot of
rework pluginsand in the the futurepostcssis planned. There is already support forautoprefixer:-)If you want to learn a bit more - even though it currently lacks some "user friendlyness", you could follow this tutorial atomify slides
If you do, i recommend you to spend some time with each slide not just copy & pasting commands, but thinking about them and analyzing what was created in your directories and text editor.
In the slides, 2 components get created, were one is using the other. Additionally, at the end, the themeing which i described above is demonstrated.
geelen commentedon Jun 5, 2015
There is now https://github.com/css-modules/css-modulesify and https://github.com/css-modules/browserify-demo, so I'm going to close this issue and discussion can continue on one of those projects.
Test :import and :export are ignored, closes css-modules#3