Allow serialization of layout information to CSS
What problem does this solve or what need does it fill?
This may be useful functionality for some users. If you care, please chime in in the comments!
What solution would you like?
Create a utility that converts from our native serialization format into CSS. Gate this behind a feature flag and point users to it in the docs.
Add tests to ensure that this continues to work.
What alternative(s) have you considered?
Status quo
Do nothing; we do not currently have users who want this functionality. Trying to build this in a vacuum is a recipe for disaster.
Feature flags
Revert the changes in #84 (and related features) in order to enable easy serialization via serde.
This litters our code base in surprising ways, and makes it very hard to alter the corresponding code structure (see #111 and #112, which were likely to support this functionality) as we must be mindful of CSS's constraints.
Additional context
This was the original intent behind the serde feature flags removed in #84 (and discussed further in #153).
Would this potentially be good for testing? You could have randomly generated layouts and have something compare the results to [whichever browser] (visual diff with basic fill color rects or something?)
Yes, but we already have an existing tool internally via the gentest folder :)
What I’d really like for fuzz-like testing, is a setup where Taffy is compiled to wasm and can be run in a browser. Then you could randomly generate styles, and efficiently run them natively in the browser and in Taffy.