content-visibility: auto

Written
  • https://web.dev/content-visibility/
  • This is a CSS attribute that tells to browser to forego full rendering of offscreen elements. Useful for things like big lists.
  • The attribute only takes effect if the entire element is offscreen, so in a list it should be applied to each item in the list instead of the container.
  • Use with contain-intrinsic-size: 1000px where the height there is the expected size of the element.

Thanks for reading! If you have any questions or comments, please send me a note on Twitter. And if you enjoyed this, I also have a newsletter where I write about tech thoughts, interesting things I've read, and project updates each Thursday.

You can check out a recent issue, or enter your email below to subscribe.