SCSS if指令:如何传递多个变量?

时间:2013-05-10 13:34:08

标签: sass mixins css-preprocessor

我如何编写此代码,以便检查$ text-shadows和$ shadows的真实性?

.btn {
  @if $text-shadows {
    @include text-shadow-black;
  }
  @if $shadows {
    @include shadow-white;
  }
 }

要清楚,我想要实现的是没有嵌套:

.btn {
  @if $text-shadows {
    @if $shadows {
      @include text-shadow-black;
    }
   }
 } 

1 个答案:

答案 0 :(得分:2)

您正在寻找and关键字:

.btn {
  @if $text-shadows and $shadows {
      @include text-shadow-black;
  }
}