From bea2115ee746e8180a367d296cb216235a0c4f57 Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Wed, 3 Apr 2013 20:26:32 +0000 Subject: [PATCH 1/2] fix issue #80 --- scss.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From f87e2c52cd91aa698048e638a96671cc44bd9592 Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Wed, 3 Apr 2013 20:36:24 +0000 Subject: [PATCH 2/2] add @elseif test case --- tests/inputs/if.scss | 7 +++++++ tests/outputs/if.css | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) 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;