Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert if() Sass function to ternary operator #77

Open
kizu opened this issue May 6, 2014 · 1 comment
Open

Convert if() Sass function to ternary operator #77

kizu opened this issue May 6, 2014 · 1 comment
Labels

Comments

@kizu
Copy link

kizu commented May 6, 2014

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 samccone added the bug label May 6, 2014
@samccone
Copy link
Contributor

samccone commented May 6, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants