通过js获取css变量 2022-04-18 本文已影响0人 Gino_Li getComputedStyle(document.documentElement).getPropertyValue('--main-color').trim() // #000