naive-ui/playground/collect-vars.js

14 lines
255 B
JavaScript
Raw Normal View History

2021-01-07 01:07:48 +08:00
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)