Re: [csswg-drafts] [css-sizing] How to shrink to fit the width? (#191)

Made another small demo using my anchor positioning way of doing the shrinkwrap (so obviously only visible in Chrome Canary): https://codepen.io/kizu/pen/LYvqPmO?editors=1010

Here is a video, showing 5 items, each having a max-width of 20% of the parent's width, with `text-wrap: balance` on them, and placed so every item follows the previous one:

https://github.com/w3c/csswg-drafts/assets/177485/287deaa3-3fb8-4a96-b06e-764b1306564e

With this method (and I imagine with any other similar one), for every element with shrinkwrap we need to know its dimensions before layout out every other element that depends on it. This can lead to very complex calculations if used for many elements, which is probably one of the reasons this does not exist in CSS yet (and I doubt it could, but we can dream, I guess).

-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/191#issuecomment-2074506453 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 24 April 2024 09:27:00 UTC