DEV Community

Discussion on: I made my website 28ms faster with content-visibility 🤓

Collapse
 
yellow1912 profile image
yellow1912

I don't understand the down vote of Daniel's comment. True it looks like it's an easy to implement hack, but there are serious hidden issue with it. The major issue though, is the height of the element you want to set this case property. Without knowing the exact height the browser cannot allocate for it properly and the content will be jumpy. In fact you may run into another issue (layout shift).

With responsive layouts, sometimes it can be challenging to know the exact height before hand so you may create more problems than you solve.

This should be used with care. There are many lower hanging fruits to fix before you try this one out. Definitely 80% effort vs 20% gain.

Thread Thread
 
dailydevtips1 profile image
Chris Bongers

I agree, also not the one who downvoted the comment, I just didn't understand his explanation for where he was going with it.

You are right there are many things one needs to be aware of, but like everything, I try to give a high-level overview of a function, method, or idea.

I don't want to tell you how to exactly do one thing, but yes well mentioned there are some things to consider with this technique.