Macro wasm_css::style

source ยท
macro_rules! style {
    ($target:expr, $css:expr $(, $arg:expr)*) => { ... };
    ($css:expr $(, $arg:expr)*) => { ... };
}
Expand description

Construct a Style from a CSS string with formatting

  • Returns WasmCssError if unable to locate Crypto when generating uuid

  • Returns WasmCssError if unable to locate Document/Window/Head



style!(css: &str) -> Result<Style, WasmCssError>

style!(class_name: Into<String>, css: &str) -> Result<Style, WasmCssError>

Example Usage:


style!(
    "
        gap: {}rem;
        display: flex;
        flex-direction: column;
    ",
    gap_size
)?;

style!(
    "my_class",
    "
        gap: {}rem;
        display: flex;
        flex-direction: column;
    ",
    gap_size
)?;