Macro C

Source
macro_rules! C {
    ( $($class:expr $(,)?)+ ) => { ... };
}
Expand description

Takes one or more class names and returns a single space-separated string.

This macro provides a bit of sugar.

It frees you from having to write something like this:

let classes = [C.lay.flex, C.fg.flex_col].join(" ");

It also offers a lot of flexibility in what types it accepts, so you can use any of the following as arguments to C!:

  • &str
  • String
  • &String
  • Option<T> and &Option<T> where T is any of the above.
  • Vec<T>, &Vec<T>, and &[T] where T is any of the above.