3 releases (breaking)

new 0.8.0 Dec 19, 2024
0.7.0 Apr 9, 2024
0.5.0 Mar 28, 2024

#1303 in Procedural macros

Download history 2/week @ 2024-08-31 3/week @ 2024-09-14 16/week @ 2024-09-21 4/week @ 2024-09-28 3/week @ 2024-10-12 1/week @ 2024-10-19 13/week @ 2024-11-02 1/week @ 2024-11-09 2/week @ 2024-11-16 5/week @ 2024-11-23 5/week @ 2024-11-30 17/week @ 2024-12-07 75/week @ 2024-12-14

102 downloads per month
Used in 3 crates (via dioxus-class)

MIT license

13KB
283 lines

dioxus-class-macro

class! proc_macro provided to define class clearly

Example

   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()

Dependencies

~2.9–8MB
~75K SLoC