naive-ui/playground/collect-vars.js
2021-01-07 01:07:48 +08:00

14 lines
255 B
JavaScript

const varRegex = /var\(--([^)]+)\)/g
function getVars (input) {
console.log(
Array.from(
new Set(Array.from(input.matchAll(varRegex)).map((v) => '// --' + v[1]))
)
.sort()
.join('\n')
)
}
getVars(document.body.textContent)