A share dialog is supposed to dim the whole page. You give the dimmed backdrop position: fixed and inset: 0 . That combination usually covers the window. Instead, the dimming sits only on one card. The rest of the page stays bright and clickable.
The overlay is not broken. It is obeying a different containing block. A parent, often one with a small transform used to lift the card, has become the reference for fixed .
The layout
A card lifts a little on hover. The share overlay is rendered inside the card, because that is where the button lives.
<section class = "card" > <h2> Quarterly report </h2> <button type = "button" > Share </button> <div class = "overlay" > <div class = "dialog" > Share this file </div> </div> </section>
Enter fullscreen mode
Exit fullscreen mode
.card : hover , .card.is-open { transform : translateY ( -8px ) ; }
.overlay { position : fixed ; inset : 0 ; background : rgb ( 0 0 0 / 0.4 ) ; }
Enter fullscreen mode
Exit fullscreen mode
When the card is open, or hovered, the…