at-import / jacket

Conditional Styles with Sass. Dress you CSS appropriately.
BSD 3-Clause "New" or "Revised" License
232 stars 9 forks source link

function jacketOrElse #6

Closed Hannes-III closed 10 years ago

Hannes-III commented 10 years ago

for my project I have implemented a Function like that:

@function jacketOrElse($value, $else, $contexts...) {}

It will return $value if the $contexts match or $else if not. If you think his would be an interesting addition to Jacket, drop me a note. I will Fork Jacket and place a pull request.

I had to implement his function because I did not find a way to get a Value if none of the $contexts matched.

Regards, Hannes

Hannes-III commented 10 years ago

Yesterday I found a case where it showed that this functionality is even necessary because my workaround did not work: I used this syntax to get this or that value in a function:

  @return jacket($rem-list, all) jacket($px-list, ielt9);

This worked fine up to yesterday, where I found out that this returns a List with a null value, which Is not what I wanted.

robwierzbowski commented 10 years ago

That's a decent idea, PR welcome. Would you mind calling the function jacket-else, to stay brief and keep with CSS style function names?

Hannes-III commented 10 years ago

Thank you for looking @ the pull request. More comments there. I'll close this issue now.