[csswg-drafts] [css-transforms-2] Could perspective on root propagate to viewport? (#5781)

johannesodland has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-transforms-2] Could perspective on root propagate to viewport? ==
Some properties that apply to scroll containers are propagated to the viewport. Examples are `scroll-padding` `and scroll-snap-type`: https://github.com/w3c/csswg-drafts/issues/3740

Could we propagate the `perspective` property as well?

**Motivation**

The [perspective property](https://drafts.csswg.org/css-transforms-2/#perspective-property) is often used to create a parallax scrolling effect. To achieve this effect `overflow-x` and `perspective` is set on the `body` element make it a scroll container and the reference box for css transforms. Translating children in the z-axis creates a parallax effect when scrolling.

A full description of how to achieve this can be found here: https://redstapler.co/css-parallax-scrolling-effect/

Making `body` a scroll container degrades the user experience especially on mobile devices. Browser chrome does not move out of the way when the user scrolls down the page.

If perspective on the root element propagated to the viewport, the parallax effect could be achieved without creating a new scroll container?




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5781 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 11 December 2020 10:22:27 UTC