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

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

From: Axel D. via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 May 2020 20:40:59 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-631070457-1589920858-sysbot+gh@w3.org>
@laukstein / @Loirooriol: Good thoughts.

First of all, I would suggest to have transitions and animations always be based on the computed device pixels value, regardless of the CSS length currently being applicable to an element. Doing so, we get an abstraction layer from how a `width` or `height` is declared to what it really is.

Then, in the event of (a) content changing, (b) styles getting dynamically applied or (c) transitions/animations being triggered, I would - figuratively speaking - draw the page having transitions/animations disabled. Then I'd get the computed device pixels values for all elements having `auto` set for their `width` and `height` properties, and store those "target" device pixels values as shadow properties along with those elements. Next, I would re-enable transitions/animations and have them animate all elements whose current "in-transition" computed device pixels value deviate from the newly computed "target" device pixels value accordingly.

I once wrote a JavaScript function that works exactly like this (using hidden shadow elements, so running transitions on the target elements won't get interrupted) and it works like a charm.

@laukstein : Given my above explanation I would suggest to use the computed "target" device pixels value as a starting point for any initial transition/animation.

GitHub Notification of comment by SetTrend
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/626#issuecomment-631070457 using your GitHub account
Received on Tuesday, 19 May 2020 20:41:03 UTC

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