phpsass
phpsass copied to clipboard
@each malfunctions
In Ruby, this code:
$default-prefixes: webkit moz ms o;
@mixin prefixize($property, $value, $prefixes: $default-prefixes) {
@each $prefix in $prefixes {
-#{$prefix}-#{$property}: #{$value};
}
#{$property}: #{$value};
}
li {
@include prefixize(box-sizing, border-box, moz webkit)
}
a {
@include prefixize(box-sizing, border-box)
}
compiles into:
li {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
a {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
}
In phpsass, this very same code seems to miss the @each part and compiles into:
li {
-moz webkit-box-sizing: border-box;
box-sizing: border-box;
}
a {
-webkit moz ms o-box-sizing: border-box;
box-sizing: border-box;
}
This is a bug in how lists are parsed; the argument $prefixes is never seen as a "list", just as a string.
Not entirely sure how to force it to treat it as a list either ...