Sass:根据主题设置全局变量

时间:2018-09-09 19:47:31

标签: sass scss-mixins

我尝试在包含主题混合器时设置全局变量,因为它看起来比我从搜索中找到的“ themify”东西更直接。

这个主意类似于将_themes.scss

@mixin light-theme { $primary-color: #123456 !global; }
@mixin dark-theme { $primary-color: #654321 !global; }

body.light-theme { @include light-theme }
body.dark-theme { @include dark-theme }

问题在于,自上次声明以来,它始终使用深色主题值。我想做的事可能吗?

0 个答案:

没有答案