0

我将如何编写此代码以便检查 $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;
    }
   }
 } 
4

1 回答 1

2

您正在寻找and关键字:

.btn {
  @if $text-shadows and $shadows {
      @include text-shadow-black;
  }
}
于 2013-05-10T13:47:25.907 回答