-
Notifications
You must be signed in to change notification settings - Fork 19
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
Utility for conditionally joining classNames together #7
Comments
That definitely sounds useful. Personally, I would call it something like At the end of the day, it should be possible to write: div(class = labels!("active" if false, "button-style", format_args!("nth-{}", i /* a number */)) {
: "this is a button"
} and get (assuming i = 10): <div class="button-style nth-10">this is a button</div> |
If you need help with any of this, just ask. If you don't feel up for doing all of it, I can finish up anything you don't implement (i.e., partial PRs welcome). |
The additional suggestions sounds good. I'm not totally clear on how to allocate |
You don't. Just implement |
Actually, you can probably just generate a closure wrapped in an |
Thanks. I created a PR attempt based on your suggestions. |
I had a need for something like https://github.com/JedWatson/classnames
I came up with the following macro:
rust playground with examples: https://is.gd/e6Jahb
I just learned rust macros to make this; it can probably be refactored into something more nicer.
I'm wondering if this utility macro would be something worth adding to horrorshow. I can try to PR.
The text was updated successfully, but these errors were encountered: