Setting the width of selects to the width of the selected option

This is a repost promoting content originally published elsewhere. See more things Dan's reposted.

The field-sizing property is coming to Firefox 152, making it available across all major engines. It allows you to control the sizing behavior of elements with a default preferred size, such as form elements.

Sometimes a new CSS feature comes along and I immediately “get it”. Like: that’s a cool new feature, I can already see how it’ll save me time, or make things simpler, or improve accessibility, or allow me to do something new.

Other times, like this one, I initially shrug. What’s the point?, I think…

…and then later in the very same day find occasion to wish it was already mainstream. Hah!

Thanks for sharing, Manuel.