Created
August 27, 2014 07:13
-
-
Save gruzzilkin/c1cad797cc267e4c910f to your computer and use it in GitHub Desktop.
Custom "stylus + if-ie.styl + autoprefixer" tech for ENB project. Destination `.bem/techs`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autoprefixer = require('autoprefixer'); | |
module.exports = require('enb-stylus/techs/css-stylus').buildFlow() | |
.name('css-stylus-with-if-ie') | |
.defineOption('browsers') | |
.defineOption('autoprefixerArguments') | |
.methods({ | |
_configureRenderer: function(renderer) { | |
var args = this._browsers || this._autoprefixerArguments; | |
renderer.include('./node_modules'); | |
renderer.import('if-ie.styl/if-ie'); | |
renderer.use(function (style) { | |
this.on('end', function (err, css) { | |
return args ? | |
autoprefixer.apply(this, {browsers: args}).process(css).css : | |
autoprefixer.process(css).css; | |
}); | |
}); | |
return renderer; | |
} | |
}) | |
.createTech(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment