-
Notifications
You must be signed in to change notification settings - Fork 1
/
.postcssrc.js
49 lines (44 loc) · 1.35 KB
/
.postcssrc.js
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
48
49
const defaultPostcssPixelToViewportConfig = {
viewportUnit: "vw",
propertyBlacklist: [/(.*)/],
minPixelValue: 2,
mediaQuery: false,
};
module.exports = ({ file, options, env }) => ({
syntax: "postcss-scss",
plugins: [
require("postcss-import")({ root: file.dirname }),
require("postcss-pixel-to-viewport")({
...defaultPostcssPixelToViewportConfig,
viewportWidth: 320,
enableConvertComment: `xs-viewport`,
disableConvertComment: `xs-viewport-off`,
}),
require("postcss-pixel-to-viewport")({
...defaultPostcssPixelToViewportConfig,
viewportWidth: 768,
enableConvertComment: `md-viewport`,
disableConvertComment: `md-viewport-off`,
}),
require("postcss-pixel-to-viewport")({
...defaultPostcssPixelToViewportConfig,
viewportWidth: 1024,
enableConvertComment: `lg-viewport`,
disableConvertComment: `lg-viewport-off`,
}),
require("postcss-pixel-to-viewport")({
...defaultPostcssPixelToViewportConfig,
viewportWidth: 1920,
enableConvertComment: `xl-viewport`,
disableConvertComment: `xl-viewport-off`,
}),
require("postcss-responsive-font")(),
require("postcss-calc")(),
require("postcss-flexbugs-fixes")(),
require("postcss-preset-env")({
autoprefixer: {
grid: env === "production",
},
}),
],
});