`content-visiblity` Without Jittery Scrollbars

1 · Alex Russell · Dec. 4, 2020, midnight
The new content-visibility CSS property finally allows browsers to intelligently decide to defer layout and rendering work for content that isn't on-screen. For pages with large DOMs, this can be transformative. In applications that might otherwise be tempted to adopt large piles of JS to manage viewports, it can be the difference between SPA monoliths and small progressive enhancements to HTML. One challenge with naive application of content-visibility, though, is the way that it removes elemen...