| Crates.io | dioxus-class-macro |
| lib.rs | dioxus-class-macro |
| version | 0.8.0 |
| created_at | 2024-03-28 14:31:38.777187+00 |
| updated_at | 2024-12-19 13:42:43.68396+00 |
| description | Dioxus class proc_macro |
| homepage | https://github.com/edger-dev/dioxus-class |
| repository | https://github.com/edger-dev/dioxus-class |
| max_upload_size | |
| id | 1189085 |
| size | 7,000 |
class! proc_macro provided to define class clearly
rsx! {
div {
class: class!(card card_compact w_64 h_64 bg_base_300 shadow_xl text_center hover(bg_base_200) hover(scale_105)),
div {
class: class!(text_8xl py_10),
"{value}",
},
div {
class: class!(card_body text_center items_center),
div {
class: class!(card_title text_sm text_base_content),
"{alias}",
}
}
}
}
The elements such as card_compact are just normal rust expressions, they are all checked by compiler,
and when defined as constants, can provide auto-complete in editor. The only requirement is that they
can be converted to String with String::from()