Re:The surprisingly difficult problem of user-defined order ...
by recursive on Saturday January 16, 2021 @12:07AM
(#25800213)
If I need to fit something between z-index 2 and 3, I'd just put it at 2, and subsequent to all the other z-index 2 elements.
Re:The surprisingly difficult problem of user-defined order ...
by rubatuga on Friday January 15, 2021 @09:10PM
(#25799277)
Then you have projects like bootstrap using z vals of 3000 etc.
Re:The surprisingly difficult problem of user-defined order ...
by names_are_hard on Saturday January 16, 2021 @01:24AM
(#25800516)
Then someone gets fed up because they just want their item to be on top, dammit, so they can finish their jira task and move on. So they just type 9999 because that ought to beat all those other pesky z-indexes...
Re:The surprisingly difficult problem of user-defined order ...
by kflzufkrbzi on Saturday January 16, 2021 @06:20AM
(#25801562)
Wrap whatever they provide with position: relative, z-index: 1 and their 3000 index will not go over your 2 index.
Re:The surprisingly difficult problem of user-defined order ...
by earthboundkid on Saturday January 16, 2021 @08:56AM
(#25802178)
The IAB has standard z-indexes in the millions: https://cravencode.com/post/essentials/iab-z-index-guideline...
Early in a project, people stick to some heuristic, like using small z-index values like 0, 1, 2, 3... etc. But this has drawbacks because you can't add new z-index items in between without also shifting everything with a higher z-index
Using z-index values with a gap is a better bet. 0, 10, 20, 30, etc. Of course, you are limited to only a few items in between the original. You've also lost an expectation of ordering in the values.
Larger gaps make more sense, as long as you don't exceed the size of signed integers ±2147483647.
The author of the post mentions how floating point has a similar problem in the amount of floating point precision you can wring out before you end up with rounding errors.
The true crux of the problem is one of items related to one another, in other words it's a graph problem. I want these items to show up underneath these other items.