A 3D transform context breaks when nested inside another transform
A card-flip effect built from CSS 3D transforms depends on a preserved 3D context between the parent and its faces; placing that structure inside another element that is itself transformed flattens the context, and the effect degrades or disappears with no error.
Resurfaces when
- building a flip or 3D card animation
- a CSS 3D effect renders flat
- choosing between CSS animation and a JS library
- placing an animated component inside a transformed container
- cross-browser backface visibility
The lesson’s retrieval contract, weighted three times heavier than its body. A lesson that states when it applies doesn’t need a semantic search to find it.
The lesson
CSS 3D is contextual, not local: the parent establishes perspective and the child is positioned within it, and any intervening transform can collapse that relationship. So an animation that is correct in isolation can break purely by being moved — into a scaled container, a transformed modal, a virtualised list that transforms rows for positioning. Nothing reports it; the element simply renders flat. Choosing pure CSS over a JavaScript animation library is usually right for this kind of effect — no runtime cost during the animation, no bundle — but the trade is this fragility to nesting, plus a vendor-prefixed property still needed for one major browser.
The failure that taught it
No incident forced this; it was recorded as a decision with its consequences, which is why the cost is stated as a constraint rather than a scar. The alternatives considered were an animation library and a state-driven approach, both rejected for bundle size and for running JavaScript during every frame of the animation. The accepted approach documented two costs up front: a required vendor prefix for one browser's backface handling, and the nesting fragility above.
How to apply it
Keep a 3D-transformed component out of transformed ancestors, and check it inside every container it will actually be used in — a scaled wrapper, a modal, a virtualised list — rather than only in isolation. When a 3D effect renders flat, look up the tree for a transform before debugging the element itself. Record the vendor prefix requirement next to the rule that needs it, since it is invisible in the browser you develop in.
Where this claim comes from
- Lessonmedium confidence
A 3D transform context breaks when nested inside another transform
- Distillationmechanism stated
Written from the mechanism, not the incident — which is what lets it transfer to code sharing nothing with the original.
- Scar2 occurrences
2 separate failures, recorded independently at the time. A clustering pass found they shared one cause.
- Evidence2 records
Referenced by content hash, never by path: entry slugs carry client and ticket names, so a lesson storing them could not be published at all. Resolving a hash needs a map that never leaves the machine. An agent running locally traces it with scar_evidence; nothing on this site can.
What happened when it was used
- 8
- retrieved
- 0
- acted on
- 0
- held up
- 0
- did not hold up
Retrieved but never acted on — a demotion, not a neutral result. A lesson that keeps winning the search and never changes a decision is noise.