Skip to content

Instantly share code, notes, and snippets.

@kaueburiti
Last active October 20, 2016 12:44
Show Gist options
  • Save kaueburiti/6bca2fd221052a0998c19d352c8617f6 to your computer and use it in GitHub Desktop.
Save kaueburiti/6bca2fd221052a0998c19d352c8617f6 to your computer and use it in GitHub Desktop.
Basic PostCSS config to work with some Sass features
// Webpack configs
(...)
postcss: function(webpack) {
return [
require('postcss-import')({
addDependencyTo: webpack,
root: rootPath,
path: [srcPath, nodeModulesPath]
}),
require('postcss-cssnext')({
features: {
customProperties: { preserve: 'computed' }
},
plugins: {
afterEach: [
require('postcss-at-rules-variables')
],
beforeEach: [
require('postcss-custom-properties')
]
}
}),
require('postcss-nested'),
require('postcss-each')({
plugins: {
afterEach: [
require('postcss-at-rules-variables')
],
beforeEach: [
require('postcss-custom-properties')
]
}
}),
require('postcss-for')({
plugins: {
afterEach: [
require('postcss-at-rules-variables')
],
beforeEach: [
require('postcss-custom-properties')
]
}
}),
require('postcss-simple-vars'),
require('postcss-reporter')({ clearMessages: true })
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment