You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure how eager browsers would be to develop the feature, but I'm sure most of us have come upon the cumbersome task of needing to shuffle around and/or overspecify z-index values to create effects like...
Example - Notice as you scroll all subsequent pages are revealed from below the current page.
To accomplish a simple reversal of layers in that example, you either have to specify the reverse sequence to the nth z-index or use a flex container that sets flex-direction: column-reverse while reversing the semantic sequence of your content (order-accessibility).
And I know with the successful implementation of order within [css-flexbox] ('order-modified document order is used in place of raw document order') the implementation might actually be simple. And even if this predicament isn't the biggest in the CSS world, it's still more cumbersome than seemingly needs to be?
Proposing a non inherited property that sets a reverse sequenced local stacking context?
layer-ordering: forward | reverse
With forward being the initial value and guessing reverse would lead to a child element with z-index: 1 sitting above a sibling set to z-index: 2 as well as all other 'normal' layering visualizing in reverse.
I was recently exploring the possibilities of scroll-driven animations, and controlling the stack/layer ordering was one of the things I experimented on — and it seems that with the scroll-driven animations we could have a work-around/polyfill for this.
TLDR; we can assign the z-index for elements in a container based on their position inside of it.
This won't solve all the cases for layering, as it requires elements to be in the same context and have at least initial position over one of the axes in a certain order, so it would be still nice to see some way to control this natively.
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.csswg.org/css-position-3/#layered-presentation
Not sure how eager browsers would be to develop the feature, but I'm sure most of us have come upon the cumbersome task of needing to shuffle around and/or overspecify z-index values to create effects like...
Example - Notice as you scroll all subsequent pages are revealed from below the current page.
To accomplish a simple reversal of layers in that example, you either have to specify the reverse sequence to the nth
z-index
or use a flex container that setsflex-direction: column-reverse
while reversing the semantic sequence of your content (order-accessibility).And I know with the successful implementation of
order
within [css-flexbox] ('order-modified document order is used in place of raw document order') the implementation might actually be simple. And even if this predicament isn't the biggest in the CSS world, it's still more cumbersome than seemingly needs to be?Proposing a non inherited property that sets a reverse sequenced local stacking context?
With
forward
being the initial value and guessingreverse
would lead to a child element withz-index: 1
sitting above a sibling set toz-index: 2
as well as all other 'normal' layering visualizing in reverse.Further Reading -> MDN Stacking without z-index
The text was updated successfully, but these errors were encountered: