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

I just published my new technique for handling shrinkwrap: https://kizu.dev/shrinkwrap-solution/ — including adjusting the layout. It doesn’t solve all the use cases — the most complex is the menu one — but most others seem to be possible with ease.

Basically, if we know the boundaries in which our element can expand, we can use these boundaries as our “max-inline-size”, isolating the rendering of the inner part of our element from the outer context, so when the content inside wraps, we measure it with anchor positioning and scroll-driven animations and apply the correct width on the outer wrapper.

I believe this should be possible to implement this behavior natively, in one way or another. The more complex cases would be still nice to handle, but could be for sure postponed for later, as while I still think they could be possible, it is better to start smaller and fix 90% of simpler use cases first.

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


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

Received on Tuesday, 27 January 2026 11:51:05 UTC