logseq/postcss.config.js

28 lines
726 B
JavaScript
Raw Normal View History

2023-05-24 12:46:33 +00:00
const or = (...args) => {
const variableNames = args.filter(x => x.startsWith('--'))
const initialValue = args.filter(x => !x.startsWith('--'))[0]
return variableNames.reduceRight((memo, current) => {
if (memo && current) {
return `var(${current.trim()}, ${memo})`
} else if (current) {
return `var(${current.trim()})`
} else if (memo) {
return memo
}
}, initialValue)
}
2022-10-10 05:39:16 +00:00
module.exports = {
plugins: {
2022-11-13 07:39:31 +00:00
'autoprefixer': {},
2022-10-10 05:39:16 +00:00
'postcss-import-ext-glob': {},
'postcss-import': {},
2023-05-24 12:46:33 +00:00
'postcss-functions': { functions: { or } },
2022-10-10 05:39:16 +00:00
'tailwindcss/nesting': 'postcss-nested',
tailwindcss: {},
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
2022-10-10 05:39:16 +00:00
}
}