tanghaolin
2025-02-18 7be5a4682ac099cac0e57d206c651682afc34573
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);
    }
}