mojotech / sass2stylus

Kewl
http://sass2stylus.com/
79 stars 18 forks source link

Convert `if()` Sass function to ternary operator #77

Open kizu opened 10 years ago

kizu commented 10 years ago

Sass have if() function that can be converted to a ternary operator in Stylus. So, we should convert this Sass:

.bar
  margin: if(true, 10px, 20px)
  padding: if(false, 10px, 20px)

to this Stylus:

.bar
  margin: (true ? 10px : 20px)
  padding: (false ? 10px : 20px)

Note: it is better to keep the parens above the ternary operator, as there could be conflicts otherwise in more complex cases.

samccone commented 10 years ago

:+1: