adunkman/connect-assets — pull request #201 by acruikshank (2013-08-02 03:00:51+00:00)
Title: Provide asseturl() functions to less and stylus compilers.

This PR adds an asseturl() function to the less and stylus compilers. Calling asseturl(path) from within a stylesheet results in "url([managed_path])" where managed_path is what is returned when you call the connect-assets helper img(path).

This PR addresses the difficulty referencing connect-asset managed images from dynamically compiled stylesheets. The connect-assets package post-processes static css to replace any file references with cached or remote urls if the url refers to an asset managed by connect-assets. This post-processing step does not occur for stylesheets compiled with less or stylus. This is the problem PR https://github.com/adunkman/connect-assets/pull/79 addresses.

I was planning on supporting this solution, but I changed my mind when I realized it would break backwards compatibility. I'm sure there is a lot of code out there that now expects the urls to remain unchanged. It also seems odd to require post processing when when less and stylus are already excellent css processors. The proposed solution can be opted in by developers with a simple search and replace, and the 'asseturl' in the code should clarify the fact that the paths will receive additional processing.

Thanks managing this project. I look forward to the next big revision.