mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +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)
|