Created
May 1, 2023 19:15
-
-
Save maxfenton/318a7760d8aea2a1d55afd607a3da760 to your computer and use it in GitHub Desktop.
PostCSS config for a legacy SASS project
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
module.exports = { | |
parser: "postcss-scss", | |
plugins: [ | |
require("postcss-easy-import")({ // Enables globs in @import. See style.css. | |
prefix: false, | |
skipDuplicates: false, | |
warnOnEmpty: false, | |
}), | |
require("postcss-advanced-variables"), // Sass-style @ vars, looping, and @import | |
require("postcss-custom-media"), // Custom reusable media queries | |
require("postcss-nested"), // Sass-style rule nesting | |
require("postcss-preset-env") ({ // Automatically polyfill modern CSS features | |
features: { | |
"nesting-rules": false, // disables CSS nesting in favor of Sass-style nesting (postcss-nested) | |
}, | |
}), | |
require("postcss-pxtorem"), // Converts units to rems (defaults to only font properties @ 16px base size) | |
require("postcss-assets"), // Filename resolver for images | |
require('postcss-discard-comments'), // Removes all comments (/* */) | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that apparently there is a newly maintained fork of
postcss-pxtorem
at https://github.com/hemengke1997/postcss-pxtorem