dioxus_class_macro/
lib.rs

1#![doc = include_str!("../README.md")]
2
3use proc_macro::TokenStream;
4use quote::ToTokens;
5use syn::parse_macro_input;
6
7#[cfg(feature = "build-classes")]
8mod build;
9
10mod class;
11
12/// The arguments are list of expressions, separated by space, all of them need to be compatible with
13/// String::from()
14///
15/// The idea is to write in a very similar way of CSS, but can be compile time checked, also can provide
16/// code completion nicely.
17///
18/// # Example
19/// ```rust
20/// class: class!(card card_compact w_64 h_64 bg_base_300 shadow_xl text_center hover(bg_base_200) hover(scale_105)),
21/// ```
22#[proc_macro]
23pub fn class(input: TokenStream) -> TokenStream {
24    parse_macro_input!(input as class::Dsl)
25        .into_token_stream()
26        .into()
27}