36

Fuck you css!

Today I discovered (by losing some hours) that "position: fixed" has an exception when deciding where to position elements:

If the element with position fixed is inside an element with a transform, that element is treated has the viewport instead of the screen.

Why the fuck did someone thought that was a good idea?

Comments
  • 8
    Box model 😄👍
  • 2
    Box model indeed.

    Transform creates a new GPU context, and fixed lives inside it.
  • 0
    How would you otherwise be able to 'position-fix' something inside that viewport?
  • 1
    @wtho maybe make the transformed element position-relative and position-absolute whatever you want to position-fix inside that viewport?

    My point is: this is a weird exception for position-fix.
Add Comment