diff --git a/README.md b/README.md index 2a00248..1f0d505 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ and then on the command line, lessc file.less --autoprefix="browsers" ``` -The browsers are a comma seperated list of [browsers as specified with autoprefixer](https://github.com/postcss/autoprefixer#browsers). +The browsers are a comma seperated list of [browsers as specified with autoprefixer](https://github.com/postcss/autoprefixer#browsers). For use autoprefixer grid fallback option, add "grid-on" in browser list. ## Programmatic usage diff --git a/lib/parse-options.js b/lib/parse-options.js index 3f4eb3b..a7621e6 100644 --- a/lib/parse-options.js +++ b/lib/parse-options.js @@ -1,7 +1,10 @@ module.exports = function(options) { if (typeof options === 'string') { - var browsers = options.replace(/\s*,\s*/g, ",").split(","); - options = {browsers: browsers}; + var options = options.replace(/\s*,\s*/g, ",").split(","); + var opt = { + browsers: options.filter(function(el){ return el !== 'grid-on' }), + grid: options.indexOf('grid-on') != -1 ? true : false + }; } - return options; + return opt; };