Open chris-montero opened 1 month ago
It's a good suggestion; unfortunately, it would break a lot of existing code. So, I would suggest just creating a new element, for example layers
, which would accept multiple children and do what you suggest.
I'm mentioning this in the hopes it will make it in the 2.0 branch that is in the works.
Is there a problem with using inFront
to achieve such layering?
Problem
Elm-ui 1.1.8 "el" elements can normally only contain one single child. The way to draw something "layered" with elm-ui is to use the Attribute by the name "inFront" or "behindContent".
Solution
Instead of this, let the "el" element have multiple children, just like the "row" and "column". And have the children of the "el" element just be rendered one on top of the other in the correct order.
This is the approach used in this project, which drew inspiration from elm-ui for its UI layout engine.