move postcss functions to own module

This commit is contained in:
Ray Elliott 2021-01-04 12:31:29 +00:00
parent bb41a5239c
commit e42ec37a23
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,4 @@
function half(val) { const postcssFunctions = require('./src/js/postcss-functions.js');
return val / 2;
}
module.exports = { module.exports = {
plugins: [ plugins: [
@ -11,7 +9,7 @@ module.exports = {
'postcss-simple-vars', 'postcss-simple-vars',
['postcss-functions', ['postcss-functions',
{ {
functions: { half }, functions: postcssFunctions,
}, },
], ],
], ],

View File

@ -0,0 +1,7 @@
const postcssFunctions = {
half(val) {
return val / 2;
},
};
module.exports = postcssFunctions;