tailwindcss/src/util/usesCustomProperties.js
Adam Wathan 38b4eeb288 Prettier likes parens a lot now
git blame is now broken forever.
2020-10-16 15:39:44 -04:00

14 lines
343 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
}