I've been using this to fix lag on pages with massive DOM trees. It basically tells the browser not to bother rendering anything outside the viewport. You don't need a complex intersection observer setup if you just want a quick win for scroll performance. Just make sure you set a
minimum height so the scrollbar doesn't jump around when things load in.
.list-item {content-visibility: auto;contain-intrinsic-size: 0 50px;}The intrinsic size part is important because it keeps the layout stable. It works best with
content-visibility on repeating components like cards or list rows.