-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.js
More file actions
47 lines (43 loc) · 1.43 KB
/
Copy pathpostcss.config.js
File metadata and controls
47 lines (43 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Load plugins
// https://www.postcss.parts/
// https://www.npmjs.com/search?q=keywords%3Apostcss-plugin
// https://github.com/postcss/postcss
// "selector-nested-pattern": "^&",
// https://goalsmashers.github.io/css-minification-benchmark/
/* ____________________________________________ */
import presetEnv from 'postcss-preset-env'; // Included: autoprefixer
import purgecss from '@fullhuman/postcss-purgecss';
import sortCSSmq from 'postcss-sort-media-queries';
import pxtorem from 'postcss-pxtorem';
import mergeLonghand from 'postcss-merge-longhand';
import mergeRules from 'postcss-merge-rules';
import mergeIdents from 'postcss-merge-idents';
import optSvgo from 'postcss-svgo';
/* ____________________________________________ */
const srcFolder = './src';
const postcssConfig = [
presetEnv({
stage: 2,
autoprefixer: { cascade: false, grid: true },
}),
purgecss({
content: [`${srcFolder}/**/*.{html,php,twig,njk,js,ts}`], // jsx,tsx,vue
skippedContentGlobs: ['node_modules/**', 'bower_components/**', 'src_components/**'],
safelist: [':where', ':is', ':has', 'hidden', 'active', 'open', 'lock-fixed', 'lock'],
keyframes: true,
variables: false,
fontFace: false,
}),
sortCSSmq({ sort: 'desktop-first' }),
pxtorem({
rootValue: 16,
propList: ['*'],
propWhiteList: ['*'],
selectorBlackList: ['html', 'body'],
}),
mergeRules(),
mergeLonghand(),
mergeIdents(),
optSvgo({ encode: true }),
];
export default postcssConfig;