include default plugins
From https://github.com/sheetify/sheetify/issues/32#issuecomment-170731218
an open question is whether we specify any default plugins, such as what
css-modulesifydoes. specifically i'm thinking ofpostcss-import, perhaps also a way to pass values around (like this but in our own way).
I reckon including postcss-import is a good call; if any other plugins should be included too this would be the right place to discuss.
Hmm, css-variables could perhaps be a solution to this? - it'd be cool if variables would trickle through to child nodes; perhaps with a global flag set or smth
Perhaps if a stylesheet is imported / declared, but not defined to a variable (e.g. prefix) it is treated as global - intentionally, because no prefix is being used. Do you reckon that's sane behavior?
Alright so postcss-import is not going to fly - even though it's a sync operation, it presumes it's async and starts doing hairy .then() stuff.
Given that we already have syntax for to solve this e.g.
sheetify('module-from-npm')
I don't think there's a need to include this plugin specifically.
I'm going to close this issue for now, as it's holding up a v4 release - going to add tests for module imports tho, as they're not currently being tested I believe.
If any other plugins should perhaps be included, I reckon we should open separate issues for that. Thanks!
Reviving this, as it can be useful for more complex css libs to split up their deps into multiple files (see css-wipe).
This does require that index.js performs actions in an async fashion, as PostCSS decided to support async calls for their api - https://github.com/postcss/postcss-import/issues/41 - big fat refactor is needed for this to work.
I would personally prefer if sheetify didn't come with a lot of plugins. It would be better if you could add them in as you need them with sheetify-postcss.
@bcomnes yup on board with you here