use stylist::Style;
let style_str = r#"
background-color: red;
.nested {
background-color: blue;
width: 100px
}
"#;
let style = Style::new(style_str).expect("Failed to create style");
the error is the trait bound stylist::StyleSource: std::convert::From<&str> is not satisfied
the trait std::convert::From<stylist::ast::Sheet> is implemented for stylist::StyleSource
required for &str to implement
here is the Cargo.toml
[dependencies]
stylist = {version="0.13.0",features=["yew","yew_use_style"]}
yew = { version = "0.21.0", features = ["csr"] }
I follow the example as bellow
the error is the trait bound
stylist::StyleSource: std::convert::From<&str>
is not satisfied the traitstd::convert::From<stylist::ast::Sheet>
is implemented forstylist::StyleSource
required for&str
to implementhere is the Cargo.toml