Main module for elm-neat-layout.
Call this function only once on root view function. Make sure that your own CSS is partially overwritten by following CSS.
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
[data-elm-neat-layout~=flex]{
display:-ms-flexbox;
display:flex
}Lift Html nodes into View.
import Html exposing (div)
import Mixin exposing (Mixin)
import Neat exposing (View)
import Neat.Padding as Padding exposing (NoPadding)
view1 : View NoPadding msg
view1 =
Neat.div
[]
[ Neat.text "view1"
]
view2 : View NoPadding msg
view2 =
Neat.div
[]
[ Neat.text "view2"
]
composed : View NoPadding msg
composed =
lift div
[ Mixin.class "parent"
]
[ view1
, view2
]An alias for \node -> lift node [] [].
Primitive type representing no padding on a view.
You can introduce custom paddings by just declaring their types and IsPadding values.
type MyPadding
= MyPadding
myPadding : IsPadding MyPadding
myPadding =
IsPadding
{ rem = 0.6
}Information about your custom paddings.
remExpand padding from p1 to p2.
The width of p2 is supposed to be greater than p1.
Set boundary to convert into NoPadding.
These can break neat paddings, so use them carefully.
These are lower level functions, so all you need would be Neat.Layout.Row.optimized and Neat.Layout.Column.optimized.
Do not worry even if you cannot understand how to use these functions.
v1 : View p msg
v1 =
Debug.todo "v1"
v2 : View p msg
v2 =
Debug.todo "v2"
child : Int -> View p msg
child _ =
Debug.todo "child"
child_ : Int -> Html (Protected p msg)
child_ =
toProtected << child
v : List Int -> View p msg
v =
optimized
String.fromInt
(lazy child_)
"div"
[]This is supposed to be used in order to make Html.Lazy.lazyN work.
See optimized for real usage.
Html alternative that has type level padding.