Now you might be wondering: “What took Chrome so long?!”
Well, if you’ve watched my #HTTP203 episode on Viewports () you know that there currently is a difference between browsers on how they handle the Virtual Keyboard.
Today, some browsers resize the Layout Viewport (and therefore ICB as well), while some don’t.
This difference in ICB resize behavior affects the Viewport Units.
In order to ship **Interoperable** Viewport Units, we had to do something about this different resize behavior.
That’s why, also shipping in Chrome 108, Chrome on Android will no longer resize the ICB when the Virtual Keyboard gets shown.
In browsers that support CSS Scroll-Timeline (which is only Chromium with “Experimental Web Platform Features” enabled for now) the effect is achieved using nothing but CSS.
In browsers that don't support CSS Scroll-Timeline a JavaScript polyfill is loaded and used. The animations themselves are regular WAAPI animations, extended with a linked ScrollTimeline instance.
🔥 CSS Features to start learning, as I expect them to ship in all browsers in 2022:
1. Container Queries 2. Cascade Layers 3. Color Functions 4. Viewport Units 5. :has() 6. Overscroll Behaviour 7. Subgrid 8. Accent Color 9. Media Query Ranges
1. Container Queries allow authors to style elements according to the size or appearance of a container. For size-based container queries, this is similar to a @media query, except that it will evaluate against the size of a parent container instead of the viewport.
2. With Cascade Layers, you can control cascade ordering for same-origin rules properly. You do this by layering your styles using the @layer at-rule. Layers appear before specificity and order of appearance in the cascade.
@ChromiumDev In this example you see the API transition between the frame with the avatar and the frame with the info modal. The transition — including "slide up" animation — is handled by the API/browser.