CSS shrink-to-fit container
- Category
- CSS
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Shrinks container width to match the maximum line length of its wrapped content. While keywords like fit-content leave empty space when text wraps, this CSS property tightly fits the container around the actual rendered layout to eliminate awkward trailing gaps.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals — The issue has 31 upvotes.
- Tracking bug: https://issues.chromium.org/issues/537526308
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=css-shrink-to-fit-container
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CSS%20shrink-to-fit%20container
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CSS%20shrink-to-fit%20container
- Baseline status: https://webstatus.dev/?q=CSS%20shrink-to-fit%20container
Explainers: https://github.com/explainers-by-googlers/css-shrink-to-fit/blob/main/README.md