module Web.View.Layout where
import Data.Function
import Data.Text
import Web.View.Element
import Web.View.Style
import Web.View.Types
import Web.View.View (View, tag)
layout :: Mod -> View c () -> View c ()
layout :: forall c. Mod -> View c () -> View c ()
layout Mod
f = Mod -> View c () -> View c ()
forall c. Mod -> View c () -> View c ()
el (Mod
root Mod -> Mod -> Mod
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Mod
f)
root :: Mod
root :: Mod
root =
Mod
flexCol
Mod -> Mod -> Mod
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Class -> Mod
addClass
( ClassName -> Class
cls ClassName
"layout"
Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Text Text
"width" Text
"100vw"
Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Text Text
"height" Text
"100vh"
Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Text Text
"min-height" Text
"100vh"
Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Text Text
"z-index" Text
"0"
)
col :: Mod -> View c () -> View c ()
col :: forall c. Mod -> View c () -> View c ()
col Mod
f = Mod -> View c () -> View c ()
forall c. Mod -> View c () -> View c ()
el (Mod
flexCol Mod -> Mod -> Mod
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Mod
f)
row :: Mod -> View c () -> View c ()
row :: forall c. Mod -> View c () -> View c ()
row Mod
f = Mod -> View c () -> View c ()
forall c. Mod -> View c () -> View c ()
el (Mod
flexRow Mod -> Mod -> Mod
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Mod
f)
grow :: Mod
grow :: Mod
grow = Class -> Mod
addClass (Class -> Mod) -> Class -> Mod
forall a b. (a -> b) -> a -> b
$ ClassName -> Class
cls ClassName
"grow" Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Int Text
"flex-grow" Int
1
space :: View c ()
space :: forall c. View c ()
space = Mod -> View c () -> View c ()
forall c. Mod -> View c () -> View c ()
el Mod
grow View c ()
forall c. View c ()
none
collapse :: Mod
collapse :: Mod
collapse = Class -> Mod
addClass (Class -> Mod) -> Class -> Mod
forall a b. (a -> b) -> a -> b
$ ClassName -> Class
cls ClassName
"collapse" Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Int Text
"min-width" Int
0
scroll :: Mod
scroll :: Mod
scroll = Class -> Mod
addClass (Class -> Mod) -> Class -> Mod
forall a b. (a -> b) -> a -> b
$ ClassName -> Class
cls ClassName
"scroll" Class -> (Class -> Class) -> Class
forall a b. a -> (a -> b) -> b
& forall val. ToStyleValue val => Text -> val -> Class -> Class
prop @Text Text
"overflow" Text
"auto"
nav :: Mod -> View c () -> View c ()
nav :: forall c. Mod -> View c () -> View c ()
nav Mod
f = Text -> Mod -> View c () -> View c ()
forall c. Text -> Mod -> View c () -> View c ()
tag Text
"nav" (Mod
f Mod -> Mod -> Mod
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Mod
flexCol)