I am currently in the process of building a wider browser engine / GUI toolkit on top of it (https://github.com/dioxuslabs/blitz). As part of that I am implementing a lot of the messier parts of CSS layout (floats, etc), and also grinding on fixing all the WPT tests which we track here: https://blitz.is/status/wpt/css/css-flexbox.
The vision is a complete standalone implementation of the web layout algorithms that can be easily embedded (with individual algorithms enabled/disabled on a pay what you use basis), and which can also be part of a modular ecosystem of browser engine components that make it easier for people to create new browser engines.
I would be interested in something like Apple's constraint layout system. Nested flexboxes and grids can do a lot, but I kinda fell in love after seeing constraint layout. Even how window resizing is represented as a constraint with a certain priority too!
My opinion is that no one should re-implement CSS layout orimitives and algorithms. Those are rather unique in how (by necessity and quirks if history) awkward, stange and bolted on they are.
Well, hang on, there are several different layout algorithms in CSS, right? They keep the old ones for backwards compatibility, and they have to interoperate which makes things more complicated; but flexbox and grid are relatively new and quite nice.
<strike>This project IMO should admit it's taken a lot of it's inspiration from Clay, a C layout immediate mode UI library: https://github.com/nicbarker/clay/</strike>
EDIT: Was wrong, see reply to this comment, need my coffee...still not a good excuse
This project predates Clay by several years. Clay's earliest commit was 2024. Taffy was forked from https://github.com/vislyhq/stretch in 2022, and Stretch's first commit was 2019.
The real inspiration is https://github.com/react/yoga (as used by React Native). Stretch was originally a Rust port/rewrite of Yoga.
I am currently in the process of building a wider browser engine / GUI toolkit on top of it (https://github.com/dioxuslabs/blitz). As part of that I am implementing a lot of the messier parts of CSS layout (floats, etc), and also grinding on fixing all the WPT tests which we track here: https://blitz.is/status/wpt/css/css-flexbox.
The vision is a complete standalone implementation of the web layout algorithms that can be easily embedded (with individual algorithms enabled/disabled on a pay what you use basis), and which can also be part of a modular ecosystem of browser engine components that make it easier for people to create new browser engines.
Beyond Blitz, some notable users are:
- Servo which uses it only for CSS Grid
- Zed which uses it via it's GPUI toolkit.
https://dictionary.cambridge.org/dictionary/english/taffy
Explore other layout ideas. E.g. https://stackoverflow.com/questions/53911631/gui-layout-algo...
EDIT: Was wrong, see reply to this comment, need my coffee...still not a good excuse
The real inspiration is https://github.com/react/yoga (as used by React Native). Stretch was originally a Rust port/rewrite of Yoga.
An associated project: https://github.com/DioxusLabs/anyrender does take a lot of inspiration from Clay's "drawing commands"