summaryrefslogtreecommitdiff
path: root/assets/css/postcss.config.js
blob: e0d897c887877b09ce552473dcbde03b3abc6074 (plain) (blame)
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
module.exports = conf => {
  return {
    plugins: [
      // converts googleapis URLs to gstatic ones
      require('postcss-import-url')({
        recursive: true,
        modernBrowser: true,
      }),
      // downloads gstatic fonts for local serving
      require('postcss-font-grabber').postcssFontGrabber({
        cssSrc: 'src',
        cssDest: 'css',
        fontDest: 'fonts',
      }),
      // main compatibility phase
      require('postcss-preset-env')({
        stage: 3,
      }),
      // must be run before autoprefixer
      require('postcss-unprefix')(),
      require('autoprefixer')(),
      // does not /add/ prefixes by default, hence previous step
      require('cssnano')({
        preset: 'advanced'
      }),
    ]
  };
};