CSS with classes!
Yew does not natively provide a CSS-in-Rust solution but helps with styling by providing programmatic ways to interact with the HTML class attribute.
classes! macro#
The classes! macro and associated Classes struct simplify the use of HTML classes:
- Literal
- Multiple
- String
- Optional
- Vector
- Slice
use ;
html! ;
use ;
html! ;
use ;
html! ;
use ;
html! ;
use ;
html! ;
use ;
html! ;
We will expand upon this concept in more CSS.
Inline Styles#
Currently Yew does not provide any special help with inline styles specified via the style attribute, but you can use it like any other HTML attribute:
use ;
html! ;
We will expand upon this concept in more CSS.