css-in-rust icon indicating copy to clipboard operation
css-in-rust copied to clipboard

Yew 0.18 support

Open mistricky opened this issue 3 years ago • 3 comments

I can't use css-in-rust in Yew that version is 0.18

mistricky avatar Jun 29 '21 12:06 mistricky

I have generate a PR https://github.com/lukidoescode/css-in-rust/pull/37 Waiting for approval ... You can use the branch to start.

MarcAntoine-Arnaud avatar Jul 20 '21 17:07 MarcAntoine-Arnaud

you can make it manually

use yew::html::Classes;
use css_in_rust::Style;

pub fn parser(style: Style) -> Classes {
    Classes::from(style.to_string())
}

to use

let style = match Style::create(...){...};
html!{
    <Element class=parser(style.clone()) ></Element>
}

ghost avatar Jul 30 '21 04:07 ghost

There is a fork of this repo that added 0.18 support: https://github.com/futursolo/stylist-rs

tea-lover-418 avatar Oct 10 '21 08:10 tea-lover-418