mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-23 05:03:52 +03:00
1.4 KiB
1.4 KiB
Rendering Order
Nearby elements such as below
, above
, and inFront
are rendered after the other children of the Element.
behindContent` is rendered before.
This is so:
inFront
doesn't need a specialz-index
to work. This can increase performance because too manyz-index
overrides means shipping more layers to the gpu.- Nearby elements higher up in the DOM hierarchy will be on top of elements lower in the hierarchy.
inFront
on a higher element should be on top ofinFront
elements on a lower element. - Allows nearby elements to be affected by
focused
forInput
, because they can be reached by a sibling selector..focuesed:focus ~ .focusable-style {}
Desired Behavior of Nearby Elements
inFront
on an element will be in front of all children.- if there's an
inFront
attached to a child, it will be beneath the parent'sinFront
- if there's an
behindContent
, likewise, will always be between the background and the element's children.onLeft
,onRight
,above
, andbelow
will be in front of any element they overlap with.- if an element has an
inFront
and it's neighbor has anonLeft
, then theonLeft
element will be on top of theinFront
.
- if an element has an
- if
onLeft
,onRight
,above
, andbelow
on separate elements overlap, source order wins:- in a row, the one attached to the element farthest to the right wins.
- in a column, the one attached to the element farthest down wins.