CKTIS / CSS
backface-visibility — painting the reverse side of a 3D-transformed box
`backface-visibility` decides whether a transformable element remains painted when its accumulated 3D transform turns its reverse side toward the viewer.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
visible | hiddenbackface-visibility decides whether a transformable element remains painted when its accumulated 3D transform turns its reverse side toward the viewer.
Both faces use rotateY(180deg). With hidden, hit-testing reaches under-hidden; with visible, it reaches the face visible. Computed values remain hidden/visible and the transform serializes as matrix3d(...).
Grammar: visible | hidden.
visible paints the mirrored reverse side; hidden suppresses it live as an animation crosses from front to back. The decision uses the accumulated 3D matrix in the element’s rendering context, not merely the local rotation; CSSWG issue CSSWG #917 remains open and labeled Needs Edits: it is an unresolved correctness defect because an algorithm inspecting only m33 is insufficient, not merely a precision concern. Card layouts commonly combine two faces with transform-style: preserve-3d and a parent perspective. Hidden in a 3D context also creates a stacking context and containing block. The property is not inherited, applies to transformable elements, and animates discrete; flattening or unsupported SVG resource elements can prevent the expected 3D behavior. CSS Transforms Level 2 is an Editor’s Draft.
Examples
document.body.innerHTML =
'<style>body{margin:0}.slot{position:absolute;top:10px;width:60px;height:60px;background:#ddd;perspective:300px}.one{left:10px}.two{left:90px}.face{position:absolute;inset:0;background:#d00;transform:rotateY(180deg)}#hidden{backface-visibility:hidden}#visible{backface-visibility:visible}</style>' +
'<div id="under-hidden" class="slot one"><div id="hidden" class="face"></div></div><div id="under-visible" class="slot two"><div id="visible" class="face"></div></div>';
await new Promise(requestAnimationFrame);
const hitHidden=document.elementFromPoint(40,40).id;
const hitVisible=document.elementFromPoint(120,40).id;
console.log('hidden-hit='+hitHidden+'; visible-hit='+hitVisible+'; computed='+getComputedStyle(document.querySelector('#hidden')).backfaceVisibility+'/'+getComputedStyle(document.querySelector('#visible')).backfaceVisibility+'; transform='+getComputedStyle(document.querySelector('#hidden')).transform);Result
hidden-hit=under-hidden; visible-hit=visible; computed=hidden/visible; transform=matrix3d(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1)
`backface-visibility` decides whether a transformable element remains painted when its accumulated 3D transform turns its reverse side toward the viewer.