[KongchangAI]
Concept盒阴影

box-shadow

A CSS property used to add shadow effects outside an element's border, commonly for focus rings or card shadows, without triggering layout shifts; it is clipped inside containers with overflow:hidden.

Timeline (last 90 days)

Oct 13

The focus ring should use `outline` rather than `box-shadow`, because `outline` does not trigger layout shifts and will not be clipped by a parent element's `overflow: hidden`; a `box-shadow` focus ring often mysteriously disappears in scroll containers.

Unverified50%
Oct 13

For elements whose background is unpredictable (such as buttons on photos or videos), the author layers a second focus ring—a white outline plus a black glow—and only in this case uses `box-shadow` as the two-layer supplement, accepting its clipping risk.

Unverified50%
Oct 13

Under Windows High Contrast Mode (forced-colors), `outline` is preserved more reliably than `box-shadow`, which is another reason the author uses outline by default.

Unverified50%
Oct 4

In the "properties you always have to look up" vote, grid ranked first with 22 votes, gradients ranked second with 14 votes, and box-shadow ranked third with 10 votes.

Expired50%

All Facts (4)

Source Articles