Function sauron::classes_flag

source ·
pub fn classes_flag<MSG>(
    pair: impl IntoIterator<Item = (impl Into<Value>, bool)>
) -> Attribute<MSG>
Expand description

A helper function which takes an array of tuple of class and a flag. The final class is assembled using only the values that has a flag which evaluates to true.

§Examples

use sauron::*;
let is_hidden = true;
let has_error = true;

let line:Attribute<()> = classes_flag([
       ("dashed", is_hidden),
       ("error", has_error),
   ]);