Email or username:

Password:

Forgot your password?
Bramus

Something to add to your CSS reset from now on:

```
:root {
interpolate-size: allow-keywords;
}
```

It enables things like transitions from `height: 0` to `height: auto`.

developer.chrome.com/docs/css-

20 comments
Mayank

@bramus if it is recommended to be set on `:root`, then why isn't it just part of the UA stylesheet?

Mayank

@bramus ah i missed that somehow 😅

it's a bit unfortunate that it's not backwards-compatible. sometimes i wonder if we need a global way to opt into the "new CSS" (using a meta tag or something). needing to maintain a CSS reset for new features is not nice

Duke of Germany 💫

By pure chance, this is exactly what I need for my current project! 😮 Thank you! 💜

@bramus

Keith J Grant

@bramus wait, this will work without calc-size()? 👀

Bramus

@keithjgrant yes. Calc-size() is only needed when you want to actually calculate. Otherwise just use interpolate-size and you're good to go.

Eric

@bramus This is rad, but isn't animating layout super janky? I spent most of 2014 - 2016 getting yelled at by dev rels on youtube that I shouldn't be animating anything but transforms and opacity to stay on the render layer.

Bramus

@zeh As noted in the article the lack of browser support doesn’t really matter here, as it’s a nice progressive enhancement: browsers with no support get the rough switch. Browsers with support (which is Chromium-based ones only at this moment) give you the nice transition.

Zeh Fernando

@bramus it does matter in the sense that it won't be supported, and future adoption is uncertain. No, it won't break anything, but it won't work either. This is not an unreasonable thing to mention.

Lots of new CSS features are about progressive enhancement. This is not different. It's still important for developers to keep in mind what works and when/where, and what doesn't.

The world is not just Chrome/Blink.

Bramus

@zeh These features are part of official CSSWG resolutions and are ready for other vendors to implement. Sometimes Chrome implements something first, and sometimes Chrome is last. Here, Chrome happens to be first.

The thing with Progressive Enhancement is that you don’t have to care about what works when or where. You put a solid good working base experience in place that works out of the box. But if the browser supports more than just that base, they get a better experience.

Bramus

A common piece of feedback I receive on this one is “it’s Chrome-only, so I won’t use it”.

Here’s the kicker: that doesn’t really matter here, as it’s a nice #ProgressiveEnhancement: Browsers without support get the status quo. Browsers with support get the nice transition.

At worst you make the experience better in browsers with support.

developer.chrome.com/docs/css-

#CSS #EmbraceThePlatform

Large Heydon Collider

@bramus People really don't seem to know about progressive enhancement in 2024

Bramus

By opting-in today, you’re future proofing your code: once other browsers add support for it, their users too will get the nice experience. A free upgrade, hooray!

For you as a developer that means no fallbacks or polyfills to include; just sit back & relax and let the browsers work on it.

Thain

@bramus In my case there's also a political point. I'm tired to see Chrome having the best experience because no one test on other browser. This is not healthy for browser diversity and I don't want to be a web developer in a world where blink is the only rendering engine.

Anil

@bramus I've been using the display:grid trick: terminal.space/tech/adding-a-s

Once this proposal gets broad compatibility, it would be a nice addition.

Go Up