DioxusLabs / taffy

A high performance rust-powered UI layout library
https://docs.rs/taffy
Other
2.11k stars 107 forks source link

Improve support for `AlignSelf::Baseline` #199

Open Weibye opened 2 years ago

Weibye commented 2 years ago

What problem does this solve or what need does it fill?

We have plenty of properties that are not up to spec, by looking at the codebase it seems that AlignSelf::Baseline is one of them. Further work on #39

What solution would you like?

Implement AlignSelf::Baseline according to spec

Additional context

Code here: https://github.com/DioxusLabs/taffy/blob/main/src/flexbox.rs#L1533 Specification here: https://www.w3.org/TR/css-flexbox-1/#align-items-property

nicoburns commented 1 year ago

The most important thing to do around this is add baseline alignment support to measure functions: baseline alignment is mostly useful for aligning text (either with boxes or other text), and currently Taffy has no way for a text layout engine to communicate baseline alignment information to Taffy. Taffy's support for the Flexbox and CSS Grid aspects of baseline alignment is actually pretty good.