mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 13:07:00 +01:00
26 lines
841 B
Rust
26 lines
841 B
Rust
|
///! Macros for the web UI
|
||
|
|
||
|
/// Adds a set of CSS classes to the body element when we're presenting a full-page form
|
||
|
#[macro_export]
|
||
|
macro_rules! add_body_form_classes {
|
||
|
() => {
|
||
|
for x in $crate::constants::CSS_CLASSES_BODY_FORM {
|
||
|
if let Err(e) = $crate::utils::body().class_list().add_1(x) {
|
||
|
console::log!(format!("class_list add error -> {:?}", e));
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/// Removes the set of CSS classes from the body element after we're presenting a full-page form
|
||
|
#[macro_export]
|
||
|
macro_rules! remove_body_form_classes {
|
||
|
() => {
|
||
|
for x in $crate::constants::CSS_CLASSES_BODY_FORM {
|
||
|
if let Err(e) = $crate::utils::body().class_list().remove_1(x) {
|
||
|
console::log!(format!("class_list removal error -> {:?}", e));
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
}
|