【发布时间】:2012-09-06 14:48:23
【问题描述】:
我有以下混入
@mixin arrows($arrowdirection:"left", $arrowsize:"5px", $arrowcolor:$navbgblue ) {
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
@if $arrowdirection == "right" {
border-top: $arrowsize + px;
border-bottom: $arrowsize + px;
border-left: $arrowsize + px $arrowcolor;
} @else if $arrowdirection == "left" {
border-top: $arrowsize + px;
border-bottom: $arrowsize + px;
border-right:$arrowsize + px $arrowcolor;
} @else if $arrowdirection == "up" {
border-bottom: $arrowsize + px $arrowcolor;
border-left: $arrowsize + px;
border-right: $arrowsize + px;
} @else if $arrowdirection == "down" {
border-left: $arrowsize + px;
border-right: $arrowsize + px;
border-top: $arrowsize + px $arrowcolor;
}
}
由于某些(无疑是显而易见的)原因拒绝工作 如果我使用默认值或传入一些东西
.test{
@include arrows("left", "5px", "blue");
}
我只得到 CSS
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
所以我的 if / else 不知何故没有发挥作用。 为什么?
【问题讨论】:
标签: sass