Main module for elm-neat-layout.
View gap msg
A gap-sensible Html msg
alternative.
Boundary msg
A bounded View without gap.
Convert to/from View by setGap
/setBoundary
.
render : Renderer -> Boundary msg -> Mixin.Html.Html msg
Render the View
into Html
so that it spreads across the screen.
Internal.Renderer
Settings for rendering View
.
defaultRenderer : Renderer
setBaseSizeInRem : Basics.Float -> Renderer -> Renderer
Set the base size in rem.
Represents the font-size of the root element (typically ).
All gap sizes are determined relative to this value.
when : Basics.Bool -> (a -> a) -> a -> a
Apply a modifier only when a condition is met.
unless : Basics.Bool -> (a -> a) -> a -> a
Apply a modifier unless a condition is met.
withMaybe : Maybe a -> (a -> b -> b) -> b -> b
Apply a modifier only if the given value is Just
.
You can use custom gaps just by declaring new types and IsGap
values for them.
import Neat exposing (IsGap)
type ButtonGroup
= ButtonGroup Never
buttonGroup : IsGap ButtonGroup
buttonGroup =
IsGap
{ horizontal = 0.6
, vertical = 0.6
}
Internal.IsGap p
Information about your custom gaps.
e.g., If the base size is 2rem
, IsGap { horizontal = 1.2, vertical = 2 }
becomes gap with "2.4rem"
horizontally and "4rem"
vertically.
customGap : Gap -> IsGap p
{ horizontal : Basics.Float
, vertical : Basics.Float
}