pub struct Css { /* private fields */ }
Expand description
Css struct allows to reference the stylesheet selectors from appended stylesheet inside the rsx macro.
In order to referecne a selector from the stylesheet use the indexing operator with the name of the selector as an argument.
§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"])} />
}
})
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Css
impl RefUnwindSafe for Css
impl !Send for Css
impl !Sync for Css
impl Unpin for Css
impl UnwindSafe for Css
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more