diff --git a/scss.inc.php b/scss.inc.php index 7ba58295..30d872d9 100644 --- a/scss.inc.php +++ b/scss.inc.php @@ -585,7 +585,7 @@ protected function compileChild($child, $out) { } else { foreach ($if->cases as $case) { if ($case->type == "else" || - $case->type == "elseif" && $this->isTruthy($case->cond)) + $case->type == "elseif" && $this->isTruthy($this->reduce($case->cond))) { return $this->compileChildren($case->children, $out); } diff --git a/tests/inputs/if.scss b/tests/inputs/if.scss index 3a7a816e..d62b056a 100644 --- a/tests/inputs/if.scss +++ b/tests/inputs/if.scss @@ -35,6 +35,13 @@ span { color: 20px; } + @if false { + height: 10px; + } @elseif false { + color: 20px; + } @else { + width: 20px; + } } div { diff --git a/tests/outputs/if.css b/tests/outputs/if.css index b2a90666..b9d05205 100644 --- a/tests/outputs/if.css +++ b/tests/outputs/if.css @@ -10,7 +10,8 @@ pre { span { color: blue; - height: 10px; } + height: 10px; + width: 20px; } div { color: blue;