From e42ec37a236b417547487b5db456ddceefcc58df Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 4 Jan 2021 12:31:29 +0000 Subject: [PATCH] move postcss functions to own module --- static-html/postcss.config.js | 6 ++---- static-html/src/js/postcss-functions.js | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 static-html/src/js/postcss-functions.js diff --git a/static-html/postcss.config.js b/static-html/postcss.config.js index 4f5600f..cf9f137 100644 --- a/static-html/postcss.config.js +++ b/static-html/postcss.config.js @@ -1,6 +1,4 @@ -function half(val) { - return val / 2; -} +const postcssFunctions = require('./src/js/postcss-functions.js'); module.exports = { plugins: [ @@ -11,7 +9,7 @@ module.exports = { 'postcss-simple-vars', ['postcss-functions', { - functions: { half }, + functions: postcssFunctions, }, ], ], diff --git a/static-html/src/js/postcss-functions.js b/static-html/src/js/postcss-functions.js new file mode 100644 index 0000000..ce521ed --- /dev/null +++ b/static-html/src/js/postcss-functions.js @@ -0,0 +1,7 @@ +const postcssFunctions = { + half(val) { + return val / 2; + }, +}; + +module.exports = postcssFunctions;