【发布时间】:2014-07-10 21:25:22
【问题描述】:
我想在我的项目中创建各种主题(我使用 SASS 3.2):
我定义了一个变量:
$themeName: Z;
我尝试创建一个 mixin,例如:
@mixin theme($themeName) {
@if $themeName == Z {
@content;
}
@if $themeName == Y {
@content;
}
}
为了能够这样使用:
.wrapper {
@include theme(Y) {
border-top: 5px solid blue;
}
@include theme(Z) {
border-top: 10px solid red;
}
}
但在我的 CSS 文件中,我有类似的东西:
.wrapper {
border-top: 10px solid red;
border-top: 5px solid blue;
}
我会很感激一些帮助,我花了几个小时试图找到一种解决方案,以便为我的平台轻松开发各种主题。
【问题讨论】:
标签: css variables sass themes mixins