Re: [csswg-drafts] [css-position] 'front' & 'back' keywords for z-index

We've historically rejected this, because as soon as you add `front`, people are going to want to put things at `front + 1`, etc. ^_^

A more reasonable approach is to make z-index take a space-separated list of numbers, and position is determined by comparing the lists piece-by-piece.

This way, if you want to put something in front of `z-index: 1`, you can write `z-index: 1 1`; if you want it be behind, you can write `z-index: 1 -1`.  (`z-index: 1` and `z-index: 1 0` are identical; they'll sort in document order as normal for things with identical z-index values.)  This way you can divide your document into layers via the first value, then sort them within each layer with the second value, without having to predict ahead-of-time how many items will be on each layer.

(And if you need to sub-divide, you can add a third value, or a fourth, as necessary.)

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2444#issuecomment-373509756 using your GitHub account

Received on Thursday, 15 March 2018 20:20:06 UTC