Bramus Profile picture
Nov 15 5 tweets 3 min read
You think you’ve got the Viewports thing tackled, but then you suddenly wonder if it all plays nice with `scrollbar-gutter` or not …

Narrator: it doesn’t. Chrome with `scrollbar-gutt...Firefox with `scrollbar-gut...Chrome with `scrollbar-gutt...Firefox with `scrollbar-gut...
And now I’m wondering what viewport units will do and how mobile browsers behave … #CanOfWorms 🙈
Couldn’t resist and added some new test pages to interop-2022-viewport.netlify.app to find things out.

Some early results:
- Chrome reports wrong size for ICB (docElement.clientWidth)
- Chrome cuts off rendering (blue box)
- FixedPos in Firefox is wrong (blue box)
- Safari has no support Screenshot of the stable bo...Screenshot of the stable bo...
Debugging the viewport units also interesting: both Firefox and Chrome do not take scrollbar-gutter into account, causing overflow. Screenshot of the stable bo...Screenshot of the stable bo...
Looks like we’ve got some questions to ponder about in the CSSWG:

- Should the LVP resize here (and thereby also move the origin for Fixed Positioning)?
- Should Viewport Units cater for scrollbar-gutter, knowing their size is derived from the ICB (which resizes)?

🤔

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Bramus

Bramus Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @bramus

Oct 4
What if I told you this demo right here is powered by nothing but HTML and CSS?

Yep that’s right, not a single line of JavaScript (*) in sight! 🤩

Demo on @CodePen: codepen.io/bramus/full/GR…

(*) Except for a polyfill that’s being loaded
The demo uses Scroll-Snapping, CSS Reflections (using the proprietary `-webkit-box-reflect`), and Scroll-Linked Animations.

With Scroll-Linked Animations, it’s possible to drive a CSS Animation by scroll: as you scroll, an animation moves forwards/backwards along with it.
In this demo, we track each album cover as they enter and exit the scrollport (enter from the left, exit on the right).

To do this we use a `view-timeline` which can be compared to how IntersectionObserver tracks elements.

```css
li {
view-timeline: li-timeline inline;
}
```
Read 9 tweets
Sep 26
🎉🥳 Good news everyone! The Large, Small and Dynamic viewport units (lv*, sv*, dv*) are coming to Chrome 108!

I2S announcement: groups.google.com/a/chromium.org… Illustration showing the 10...
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. Illustration showing the 10...
Read 8 tweets
Dec 30, 2021
At the start of 2021, I discovered CSS @​scroll-timeline, a way to link CSS Animations to the scroll offset of a scroll container.

Seems fitting to close off the year with a final demo: reverse-scrolling columns.

🔗 codepen.io/bramus/pen/jOG…

🧵
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. /* Set up Animation */ @keyframes adjust-position {   from {
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. // Polyfill for browsers with no Scroll-Timeline support imp
Read 6 tweets
Dec 27, 2021
🔥 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.
Read 12 tweets
Jun 8, 2021
🔥🔥🔥

`document.documentTransition` is a new experimental API in @ChromiumDev that allows you to create transitions between two different visual frames.

🔗 chromestatus.com/feature/519300…

Let's dig in … 🧵
@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.

🔗 codepen.io/bramus/pen/rNj…

This is called a Root Transition.
@ChromiumDev To make it work, you need to perform 3 steps:

1. Capture the begin frame
2. Make UI changes (which are not rendered on screen)
3. Transition to the new (target) frame
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(