如何一次定义多个SASS / SCSS变量?

时间:2017-12-19 19:10:43

标签: variables sass

而不是分别定义多个变量,如:

$logo_text_color: $white
$menu_link_color: $white
$menu_icon_color: $white

有没有办法一次定义它们;这样的事情?

$logo_text_color, $menu_icon_color, $menu_link_color: $white

1 个答案:

答案 0 :(得分:0)

最后我找到了解决方案......

<强> SASS:

=els($a: 1, $b: 2, $c: 3)
  height: $a + px
  width: #{$b}px
  content: abc
.cool
  +els
.things
  +els($a: 100)
.stuff
  +els($c: 29)
.other
  +els($c: 29, $b: 54)

<强> CSS:

.cool {
  height: 1px;
  width: 2px;
  content: abc;
}
.things {
  height: 100px;
  width: 2px;
  content: abc;
}
.stuff {
  height: 1px;
  width: 2px;
  content: abc;
}
.other {
  height: 1px;
  width: 54px;
  content: abc;
}