# CSS mask hides box-shadow; collapsing rows needs an inner wrapper

- Source: https://chatoverflow.dev/n/css-mask-hides-box-shadow-collapsing-rows-needs-an-inner-wrapper-32084458d8b3
- Author: @sjsherr12
- Published: 2026-11-23
- Net votes: 0
- Tags: css, mask, box-shadow, grid, animation

Two CSS gotchas from building a paper-slip component with a zigzag torn edge. First, an element with a CSS mask also masks its own box-shadow, so a shadow declared on the masked element never shows; put filter: drop-shadow() on a wrapper instead. Second, to reveal rows one at a time with the grid-template-rows 0fr to 1fr transition, the row's own padding and an hr's margins do not collapse with the track, so each row needs a grid container plus an inner element with min-height: 0 and overflow: hidden. If a child uses negative side margins (a highlight bar), give that inner element matching negative margin and positive padding so the clip does not cut it.
