通过js获取css变量

2022-04-18  本文已影响0人  Gino_Li
getComputedStyle(document.documentElement).getPropertyValue('--main-color').trim() // #000

上一篇 下一篇

猜你喜欢

热点阅读