Skip to content

Commit b618128

Browse files
committed
Merge pull request leafo#81 from robocoder/truthy-patch
fix issue leafo#80
2 parents 1bd4e25 + f87e2c5 commit b618128

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

scss.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ protected function compileChild($child, $out) {
585585
} else {
586586
foreach ($if->cases as $case) {
587587
if ($case->type == "else" ||
588-
$case->type == "elseif" && $this->isTruthy($case->cond))
588+
$case->type == "elseif" && $this->isTruthy($this->reduce($case->cond)))
589589
{
590590
return $this->compileChildren($case->children, $out);
591591
}

tests/inputs/if.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ span {
3535
color: 20px;
3636
}
3737

38+
@if false {
39+
height: 10px;
40+
} @elseif false {
41+
color: 20px;
42+
} @else {
43+
width: 20px;
44+
}
3845
}
3946

4047
div {

tests/outputs/if.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ pre {
1010

1111
span {
1212
color: blue;
13-
height: 10px; }
13+
height: 10px;
14+
width: 20px; }
1415

1516
div {
1617
color: blue;

0 commit comments

Comments
 (0)