utkarshkukreti / markup.rs

A blazing fast, type-safe template engine for Rust.
Apache License 2.0
350 stars 14 forks source link

Add support for spreading classes #32

Open jquesada2016 opened 1 year ago

jquesada2016 commented 1 year ago

This is something that might be possible, but did not see it in the docs anywhere.

Would it be possible to support arbitrary class spreading, much like the attribute spread syntax?

markup::define! {
  Button<I: Iterator<Item = String>>(
    extra_classes: I,
  ) {
    button .btn ..extra_classes {
      "Click Me!"
    }
  }
}