width: fit-content
height: fit-content
Why couldn't they just use that? Isn't it essentially the same thing? width: fit-content
height: fit-content
Why couldn't they just use that? Isn't it essentially the same thing?min-content/etc get invoke in more places than you'd expect. For example:
<table>
<tr>
<td>
<input style="width: 100%">
</td>
</tr>
<tr>
<td>
<input style="width: 100%">
</td>
</tr>
</table>
Here when initially sizing the table the "width:100%" will actually be "width:min-content". (We can't change how this works, it'll break sites, and I'm oversimplifying slightly).This property is basically a switch to say "don't use the magical values for the intrinsic sizes size based on your content instead".
With the new form-sizing property (or whatever it gets named) all the inputs in that table will be sized to the maximum input.
I understand its frustrating but changing a 20+ year platform isn't an easy/simple affair sometimes :).
(jsfiddle for previous example: https://jsfiddle.net/vk8fy1bz/ )
And AFAIU form-sizing: normal does reuse existing properties by making width/height have the normal meaning.
For the most part, browsers are very reluctant to make such changes.
Can you find any evidence that this happens? This seems incredibly fantastically super unlikely. And it was an invalid use if it did exist.
Sounds like a big huge bundle of nonsense FUD to me.
Without fully reading the spec it seems reasonable.
Yes, it's a form component, so as the user provides more text input, the element grows. But in that case, text nodes are being inserted into the DOM and thus increases the dimensions of the element's content.
If a div has `width: fit-content` applied, then it is expected to grow and shrink according to...the dimensions of the element's content.
What's different? I know that I must be wrong, but I'm honestly not seeing it.
The meaning of content width gets more complex when you factor in line breaking, hyphenation and ellipsis.
Don't forget font-face and size. It's usually not done in a noticeable way, or at all, but those can be set to anything for textareas too.