2 ms·
I totally agree, and I assume that's why a new property is being used. But I'm failing to see a real distinction. Yes, it's a form component, so as the user pr
by danielvaughn 3y ago
I totally agree, and I assume that's why a new property is being used. But I'm failing to see a real distinction.
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.
- jahewson 3y agoFor a div, fit-content is already defined as the width of the longest word - that is the minimal intrinsic width of the content. Not amazingly useful, but it can’t be changed without breaking existing pages. The meaning of content width gets more complex when you factor in line breaking, hyphenation and ellipsis.
- Izkata 3y ago> 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.