Stylist
Stylist is a CSS-in-Rust styling solution for WebAssembly Applications.
This is a fork of css-in-rust.
Usage
To create a stylesheet, use Style::new:
use Style;
let style = new.expect;
If you want to use a custom prefix for your class name,
you can use Style::create.
use Style;
let style = create.expect;
Everything that is not in a conditioned block will be applied to the Component the class of this style is applied to.
The Style you put in will get parsed and converted to actual CSS and automatically appended to the head of your HTML document.
You may also use the & identifier in order to use CSS selectors or pseudo
classes on the styled element:
&}
You can also use other CSS rules, e.g. keyframes:
{
from }
to }
}
{
}
& }
}
Yew Integration
To enable yew integration. Enable feature yew in Cargo.toml.
Then create a style and use it with yew like this:
use Style;