1
0
mirror of https://github.com/kognise/water.css.git synced 2025-08-25 14:10:47 +02:00

feat: inline SVGs using postcss-inline-svg

This commit is contained in:
Jonas Kuske
2019-06-06 23:46:18 +02:00
parent 64e7377caa
commit 436a4211eb
5 changed files with 78 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ const flatten = require('gulp-flatten')
const sizereport = require('gulp-sizereport')
const postcssCssVariables = require('postcss-css-variables')
const postcssImport = require('postcss-import')
const postcssInlineSvg = require('postcss-inline-svg')
const postcssColorModFunction = require('postcss-color-mod-function').bind(null, {
/* Use `.toRGBLegacy()` as other methods can result in lots of decimals */
stringifier: color => color.toRGBLegacy(),
@@ -59,7 +60,7 @@ function style() {
// Add sourcemaps
.pipe(sourcemaps.init())
// Resolve imports and calculated colors
.pipe(postcss([postcssImport(), postcssColorModFunction()]))
.pipe(postcss([postcssImport(), postcssColorModFunction(), postcssInlineSvg()]))
// * Process legacy builds *
.pipe(excludeModern)