Skip to content

Instantly share code, notes, and snippets.

@nkt
Last active July 4, 2016 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkt/10a1c931a420360fc4bb5e2482663e05 to your computer and use it in GitHub Desktop.
Save nkt/10a1c931a420360fc4bb5e2482663e05 to your computer and use it in GitHub Desktop.
const postcss = require('postcss');
const defaultOptions = {
bundler: null,
browsers: 'Chrome >= 45, ff >= 40, ie >= 10, Safari >= 8'
};
const plugin = postcss.plugin('postcss-dialog', (_options) => {
const options = Object.assign(defaultOptions, _options);
const plugins = [
require('postcss-import')({
addDependencyTo: options.bundler
}),
require('postcss-cssnext')({
browsers: options.browsers
})
];
return postcss(plugins);
});
module.exports = plugin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment