generate_class

Function generate_class 

Source
pub fn generate_class<T: FnOnce(&mut ContextHandle<'_, '_, '_, '_, '_>)>(
    context: &mut ContextHandle<'_, '_, '_, '_, '_>,
    rule_content_fn: T,
    custom_after_class: &str,
)
Expand description

Generate a CSS rule with a class.

Note: At-rules (e.g. @media) are not handled by this function, see generate_wrapper.

The second argument, a closure, is called to generate the CSS content of the rule. The third argument is used to add a custom string just after the class (e.g. > *).

ยงErrors

Returns fmt::Error indicating whether writing to the buffer succeeded.