futursolo / stylist-rs

A CSS-in-Rust styling solution for WebAssembly Applications
https://crates.io/crates/stylist
MIT License
366 stars 22 forks source link

v0.13.0 Style::new() function error #152

Open arthasyou opened 6 months ago

arthasyou commented 6 months ago

I follow the example as bellow use stylist::Style;

let style = Style::new("background-color: red;")?;

the error is:

the trait bound StyleSource: From<&str> is not satisfied the trait From<Sheet> is implemented for StyleSource required for &str to implement Into<StyleSource> required for StyleSource to implement TryFrom<&str>

WorldSEnder commented 6 months ago

The example shown in the "Runtime Style" section of the README depends on enabling the parser feature. I suppose this should be made clear. Prefer the macros generally, due to lower runtime overhead.