forked from NanaMorse/Cuckoo.Plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostcss.config.js
26 lines (24 loc) · 969 Bytes
/
postcss.config.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
import { dp2px, sp2rem } from './src/utils/AndroidMeasurements.js'
/** @type {import('postcss').ProcessOptions & { plugins: PostCssLoaderPluginsOption }} */
export default {
// Add you postcss configuration here
// Learn more about it at https://github.com/webpack-contrib/postcss-loader#config-files
plugins: [
"autoprefixer",
"postcss-mixins",
"postcss-simple-vars",
"postcss-nesting",
[
"postcss-custom-unit",
{
units: [
{ from: 'dp', convert (value) { return `${dp2px(value)}px` } },
{ from: 'sp', convert (value) { return `${sp2rem(value)}rem` } },
],
}
],
],
};
/** @typedef {{ [pluginName: string]: false | any }} PostCssLoaderPluginsObjectOption */
/** @typedef {(string | [string, any] | PostCssLoaderPluginsObjectOption)[]} PostCssLoaderPluginsArrayOption */
/** @typedef {PostCssLoaderPluginsObjectOption | PostCssLoaderPluginsArrayOption} PostCssLoaderPluginsOption */