Avoid z-indexes whenever possible

https://danielrotter.at/2020/04/08/avoid-z-index-whenever-possible.html

Whenever I use z-indexes, I am going to regret it at some point, especially with libraries utilizing components. Let’s see if we can avoid them all together.

3 points · 2 comments · view on lemmy.world

2 Comments

SHITPOSTING_ACCOUNT@feddit.de · 1 pts · 2y (1 reply)

Not that I disagree, but if you do use them, understand how stacking contexts work (and use e.g. z-index: 0 to create a new stacking context where appropriate).

danrot@kbin.social · 1 pts · 2y

I have even mentioned stacking contexts in the article, and the thing is that they are not only introduce with z-index, which makes them even more complex :-/ So yeah, it certainly helps if you understand them, but I think it does not make the problem less complex.