-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostcss.config.js
44 lines (40 loc) · 1.03 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { resolve } = require('path');
const project = require('./config/project.config.js'); // eslint-disable-line
const autoprefixer = require('autoprefixer')({
browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 10'],
});
const fontMagician = require('postcss-font-magician')({
variants: {
'Roboto Condensed': {
300: [],
400: [],
'400i': [],
700: [],
},
},
foundries: ['google'],
});
const fontSetOptions = {
inline: ['woff2'],
path: resolve(process.cwd(), '/fonts/'), // folder to save all font files. Required absolute path!
formats: ['woff2', 'woff'],
filename: '[css-name]-[set-name].[hash:4].[ext]',
url({ fontName }) {
return fontName;
},
};
const postcssIcon = require('postcss-icon')({
'postcss-icon.material-design': {
...fontSetOptions,
prefix: 'md-',
},
});
module.exports = ctx => ({
parser: ctx.parser ? 'postcss-js' : false,
sourceMap: ctx.env === 'development' ? ctx.map : false,
plugins: [
autoprefixer,
fontMagician,
postcssIcon,
],
});