Inject the autoprefixer-rails CSS post-processor if present in the load path #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per my recent issue, #67, this is the patch I'm using to add support for the autoprefixer-rails gem in my local fork. It's a really handy gem which handles CSS vendor prefixes automatically, basically replacing most of my use cases for Compass and Bourbon and the like.
My first stab here loads the gem in
Environment#initialize
if present in the load path. I'm not sure this is the best approach for everyone. Personally, in the day and age of Bundler, the presence of the gem in the load path is enough of an opt-in for me. But that may be too liberal for others.So I'm open to suggestions on better modularity here. The trick is having access to the right scope for the Sprockets environment object, balanced with some better opt-in from the user to include the autoprefixer.