TL;DR: CSS can now divide a length by a length, so calc(100vw / 1px) gives you a plain, unitless number. Firefox 158 shipped it on October 13, 2026, joining Chrome and Safari, so CSS typed arithmetic is Baseline Newly available.
The resize listener that only exists to delete "px"
You want a background image to fade as the viewport gets narrower. Or a heading whose line-height tightens as its container grows. Both need the same thing: a width, as a number.
CSS had the width. It just refused to hand it over without a unit attached. So you wrote this:
const root = document . documentElement ;
new ResizeObserver ( ( [ entry ] ) => { root . style . setProperty ( "--w" , entry . contentRect . width ) ; } ) . observe ( root ) ;
Enter fullscreen mode
Exit fullscreen mode
A whole observer, running on every resize, whose only job is to remove two letters. CSS knew the answer the entire time.…