mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 07:10:05 +02:00
26 lines
735 B
JavaScript
26 lines
735 B
JavaScript
|
module.exports = function (postcss) {
|
||
|
return postcss([
|
||
|
require('postcss-import')(),
|
||
|
require('postcss-at-rules-variables')(),
|
||
|
require('postcss-modules-values'),
|
||
|
require('postcss-functions')({
|
||
|
functions: {
|
||
|
remCalc: function(values) {
|
||
|
values = values.replace('px', '');
|
||
|
values = values.split(' ');
|
||
|
let outputRems = '';
|
||
|
const base = 16;
|
||
|
values.forEach( (value, i) => {
|
||
|
const remValue = value / base;
|
||
|
outputRems += i === 0 ? `${remValue}rem` : ` ${remValue}rem`;
|
||
|
});
|
||
|
return outputRems;
|
||
|
}
|
||
|
},
|
||
|
}),
|
||
|
require('postcss-mixins')(),
|
||
|
require('postcss-for'),
|
||
|
require('postcss-cssnext')()
|
||
|
])
|
||
|
}
|