DioxusLabs / taffy

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

Implement legacy text alignment #698

Closed nicoburns closed 1 month ago

nicoburns commented 1 month ago

Objective

This change applies to Block layout. It is used to implement the "legacy" alignment behaviour of the <center> element and the align attribute (e.g. <div align="right">). Regular values of text-align do not affect block layout (only inline layout), but special prefixed values like -webkit-center, -moz-center, etc do. I have named these as LegacyCenter, etc in this PR.

Context

This behaviour is actually being standardised even though it's a bit of a hack https://github.com/w3c/csswg-drafts/issues/10388