pub trait AsClasses {
// Required method
fn extend_classes(&self, classes: &mut Classes);
// Provided method
fn as_classes(&self) -> Classes { ... }
}Expand description
Represent a value as CSS classes
Many variants and options need to be represented as CSS classes when rendering. This trait provides a common way to turn some variant, value, enum into a set of classes.
In combination with ExtendClasses::extend_from, this create a convenient way to
assemble a list of classes when rendering.