2 ms·
How the hell is this not already a CSS feature? font-size: "as-big-as-possible-while-still-fitting-parent-container"; or maybe just font-size: max;
by bool3max 2y ago
How the hell is this not already a CSS feature?
font-size: "as-big-as-possible-while-still-fitting-parent-container";
or maybe just
font-size: max;
- graypegg 2y agoWould combine quite well with `text-wrap` actually! [0] That way, the renderer knows the area it needs to fill (the implicit `max-content`, defined width/height, or flex/grid size of the container) and it knows how to best split up the text amongst the lines. Feels like the renderer would be capable of finding the optimal font size to satisfy those two constraints. [0] https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap
- swyx 2y agoi asked this on bluesky (https://bsky.app/profile/swyx.io/post/3lb2x53wuwc2y https://bsky.app/profile/swyx.io/post/3lb2x53wuwc2y) and immiediately got this https://kizu.dev/fit-to-width/ https://kizu.dev/fit-to-width/ which means theres no technical barrier now, we just need the powers that be to prioritize it anyone with influence on the CSSWG?