Re: [csswg-drafts] [css-ui] ? Allow <textarea> to be sized by contents. (#7542)

I would much prefer re-using existing syntax than expanding the language even more, and I share @fantasai's concerns about a new property. Also, I think it should be an antipattern to add syntax that only applies to specific types of elements (e.g. this is why we re-used `::marker` for `<summary>` rather than introduce a new pseudo-element).

I think we should explore the compat implications before we rule it out. I could ping the httparchive folks if that would be useful, but we need to formulate a query first. E.g. what about this: % of pages where there is at least one `<textarea>` or `<input>` element where at least one of `width`, `height`, `min-width`, `max-width`, `min-height`, `max-height` is either `min-content` or `max-content`.

One thing that makes this a little tricky: when the form element is empty, you almost *never* want full-blown input sizing, because that would make it 0! You usually want a minimum width/height of 1 character / 1 line. This can be done with `min-*` of course, but it's somewhat annoying that every use of `width: min-content` for form elements would *also* require this boilerplate. I suppose `min(1lh, max-content)` is more palatable, but we still can't use identifiers in calc functions.

Also, the concept of input sizing needs to take placeholders into account. Generally, when there is no input, you want to use the placeholder for sizing (when one exists), rather than the empty string.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7542#issuecomment-1535261791 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 4 May 2023 19:02:17 UTC