guybedford/require-css — pull request #151 by gobengo (2014-05-29 08:09:34+00:00)
Title: Allow configuring modules to transform each CSS string

This is just a proof of concept wrt https://github.com/guybedford/require-less/issues/64

Things to note:

* `config.css.transformEach[]` is a list of 'transform modules' that export functions that will have a chance to transform the final css string
* See `exampe/tools` for two examples, one of which prepends a comment to each css string (meh). The other prefixes all rules in the css string with an attribute selector based on your package name and version (in this case `example#0.0.0`)
* Each item in `config.transformEach[]` can be a single module Id, or an object with different strings for `node` and `requirejs`. The latter is allowed to perform its work async, and is run in the browser. THe latter is required via `require.nodeRequire`

Does the functionality I've sketched here make sense? Think it's worth cleaning up to be shared? Or should I just keep using my fork?

We'll be using something like `example/tools/prefix-css` in the near future.