dwgenerate!() { /* proc-macro */ }Expand description
Generates a dwind class that can later be used by the ‘dwclass!()’ macro.
Using this will create a lazy static in the scope from which the macro is invoked, so it can be used to create styling modules.
§Examples
mod my_custom_theme {
use dwind_macros::dwgenerate;
macro_rules! padding_generator {
($padding:tt) => {
const_format::formatcp!("padding: {};", $padding)
};
}
dwgenerate!("nth-2-padding", "nth-child(2):hover:padding-[20px]");
}
use my_custom_theme::*;
// Now use the generated pseudoclass on an html element
html!("div", {
.text("hi there")
.dwclass!("nth-2-padding")
});