tailwindcss/src/util/usesCustomProperties.js

14 lines
341 B
JavaScript

import valueParser from 'postcss-value-parser'
export default function usesCustomProperties(value) {
let foundCustomProperty = false
valueParser(value).walk(node => {
if (node.type === 'function' && node.value === 'var') {
foundCustomProperty = true
}
return !foundCustomProperty
})
return foundCustomProperty
}