tanghaolin
2025-04-17 6716b2a7ecc3ce3745c17f8361c781abd63d40d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export class AlloyCSS {
    /**
     * 获取全局 css 变量
     * @param property 变量名
     * @returns 变量值
     */
    static getRootPropertyValue(property: string) {
        return getComputedStyle(document.documentElement).getPropertyValue(property);
    }
 
 
    /**
     * 修改全局 css 变量
     */
    static setRootPropertyValue(property: string, value: string) {
        document.documentElement.style.setProperty(property, value);
    }
}