| Crates.io | dwind-macros |
| lib.rs | dwind-macros |
| version | 0.4.0 |
| created_at | 2024-12-02 14:14:26.678222+00 |
| updated_at | 2025-07-26 19:15:24.472713+00 |
| description | Macros used by the dwind crate for applying dominator classes to components using a custom language |
| homepage | https://github.com/JedimEmO/dwind |
| repository | https://github.com/JedimEmO/dwind |
| max_upload_size | |
| id | 1468710 |
| size | 49,722 |
This crate provides the core macros used by the DWIND style system.
For examples of usage, check out the example application here: https://jedimemo.github.io/dwind/examples/
The main macros used from applications are dwclass and dwclass_signal.
These can be used on DomBuilder<N> to use dwind classes on your dom elements.
fn hello() {
html!("div", {
.dwclass!("hover:font-extrabold")
.dwclass_signal!("text-l", always(true))
})
}
This macro lets you pre-declare classes to use in your dwind application. Typically used in style packages, such as dwind itself
#[macro_export]
macro_rules! width_generator {
($width:tt) => {
const_format::formatcp!("width: {};", $width)
};
}
// Invokes the width_generator!(a, b) macro for all elements in the provided array of tuples
dwgenerate_map!(
"w",
"width-",
[
// these tuples are turned into arguments to the invokes generator macro
("p-5", "5%"),
]
);