W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

Re: [csswg-drafts] [css-transitions] Transition to height (or width) "auto" (#626)

From: Joakim Chiem via GitHub <sysbot+gh@w3.org>
Date: Wed, 19 Aug 2020 12:00:11 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-676230792-1597838409-sysbot+gh@w3.org>
Hi, what I'm about to mention isn't exactly a `height: auto` solution but it doesn't rely on `max-height` being set to a exceptionally high value which will allow an element to expand to any size, instead it relies on max-height: 100% through a flex element.
While I was working on a component library we had the need for an "Expander" component and I managed to build something that expands to "100% height" of the element but with `max-height: 100%;`.

**I'm wondering is this a bug that may be "fixed" in browsers in the future, or is it somewhat safe to assume that since this is working due to the `flex` specifications it's safe to use?**

I believe it works by the fact that `display: flex;` elements are aware of their own size and as such can adjust to their "max height". Somehow it only works if it's not a direct element child of the flex container though.


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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 August 2020 12:00:17 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC