I'm finally getting around to implementing content-visibility: auto in my project to improve render times and general performance. I have a component that has some inset on the page but, under certain conditions, I allow the children of the component to overflow out of the container to make the component full bleed.
Now, when I try to add content-visibility: auto to this parent component, my component gets cut off at the inset boundary of the parent (it is effectively acting like overflow: hidden). I've tried adding overflow: visible to my styles which is having no effect at all.
Codepen example (Uncomment the content-visibility line to see the issue; you will need Chrome for content-visibility support)
Can I use content-visibility: auto without having my overflow hidden?
I am not good at English so this answer is through the translate engine. Sorry if you can not understand this answer.
And this answer is includes my speculation.
The
contains-visibility: auto;document states.So If you add
contains-visibility: auto;, you will see thatlayout containment,style containment, andpaint containmentare turned on. Since these containments indicate that outside of the element not render, so I think thatoverflow: visibledid not work.As far as I tried, it could not be done.