css_stylesheet

Macro css_stylesheet 

Source
macro_rules! css_stylesheet {
    ($filepath: expr) => { ... };
}
Expand description

css_stylesheet macro allows to attach new css stylesheets to the application directly from CSS files.

To attach CSS file as a stylesheet, call the macro providing the relative path to the file. It will return the Css object, which can be used to reference the stylesheet selectors inside the rsx macro

ยงExample usage

use wal_css::css:Css;
use wal_css::css_stylesheet;

thread_local! {
    static CSS: Css = css_stylesheet!("path-to-css-file");
}
// ...
CSS.with(|css| {
    rsx! {
        <div class={format!("{} {}", css["class1"], css["class2"])} />
    }
})