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

function jacketOrElse #6

Closed
Hannes-III opened this issue Jul 13, 2014 · 3 comments
Closed

function jacketOrElse #6

Hannes-III opened this issue Jul 13, 2014 · 3 comments

Comments

@Hannes-III
Copy link

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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

Hannes-III referenced this issue in Hannes-III/jacket Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants