mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-27 04:09:51 +08:00
14 lines
255 B
JavaScript
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)
|