futursolo / stylist-rs

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

Implement eager parsing, getting rid of lifetime on StyleSource #71

Closed WorldSEnder closed 2 years ago

WorldSEnder commented 2 years ago

First PR angled towards #70. In evaluating the existing API, the lifetime of on StyleSource, existing only for the parser feature, has been removed. Raw css now gets parsed eagerly and early during conversion into a StyleSource. The feature gated From<str>, ... impls have been changed to TryFrom<str>, ...

This doesn't change the usage for the average user working with css! and other macros. Most of the time (even in existing API) the lifetime was assumed to be 'static anyway.