@mixin theme {
color: #fff;
background-color: #000;
[data-theme="theme1"] & {
color: #f00;
background-color: antiquewhite;
}
[data-theme="theme2"] & {
color: green;
background-color: aqua;
}
[data-theme="theme3"] & {
color: #f0f;
background-color: brown;
}
}
changeTheme (theme) {
window.document.documentElement.setAttribute('data-theme', theme)
}
sass切换主题
最新推荐文章于 2024-01-25 06:00:00 发布