{-# LANGUAGE OverloadedStrings #-}
module Clay.Geometry
(
-- * Positioning.
  size, top, left, bottom, right

-- * Sizing.
, width, height, minWidth, minHeight, maxWidth, maxHeight

-- * Padding.
, padding
, paddingTop, paddingLeft, paddingRight, paddingBottom

-- * Margin.
, margin
, marginTop, marginLeft, marginRight, marginBottom
)
where

import Clay.Property
import Clay.Stylesheet
import Clay.Size

-------------------------------------------------------------------------------

size, top, left, bottom, right :: Size a -> Css

size :: Size a -> Css
size      = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"size"
top :: Size a -> Css
top       = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"top"
left :: Size a -> Css
left      = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"left"
bottom :: Size a -> Css
bottom    = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"bottom"
right :: Size a -> Css
right     = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"right"

width, height, minWidth, minHeight, maxWidth, maxHeight :: Size a -> Css

width :: Size a -> Css
width     = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"width"
height :: Size a -> Css
height    = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"height"
minWidth :: Size a -> Css
minWidth  = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"min-width"
minHeight :: Size a -> Css
minHeight = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"min-height"
maxWidth :: Size a -> Css
maxWidth  = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"max-width"
maxHeight :: Size a -> Css
maxHeight = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"max-height"

-------------------------------------------------------------------------------

padding :: Size a -> Size a -> Size a -> Size a -> Css
padding :: Size a -> Size a -> Size a -> Size a -> Css
padding Size a
a Size a
b Size a
c Size a
d = Key (Size a, (Size a, (Size a, Size a)))
-> (Size a, (Size a, (Size a, Size a))) -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a, (Size a, (Size a, Size a)))
"padding" (Size a
a Size a
-> (Size a, (Size a, Size a))
-> (Size a, (Size a, (Size a, Size a)))
forall a b. a -> b -> (a, b)
! Size a
b Size a -> (Size a, Size a) -> (Size a, (Size a, Size a))
forall a b. a -> b -> (a, b)
! Size a
c Size a -> Size a -> (Size a, Size a)
forall a b. a -> b -> (a, b)
! Size a
d)

paddingTop, paddingLeft, paddingRight, paddingBottom :: Size a -> Css

paddingTop :: Size a -> Css
paddingTop    = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"padding-top"
paddingLeft :: Size a -> Css
paddingLeft   = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"padding-left"
paddingRight :: Size a -> Css
paddingRight  = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"padding-right"
paddingBottom :: Size a -> Css
paddingBottom = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"padding-bottom"

-------------------------------------------------------------------------------

margin :: Size a -> Size a -> Size a -> Size a -> Css
margin :: Size a -> Size a -> Size a -> Size a -> Css
margin Size a
a Size a
b Size a
c Size a
d = Key (Size a, (Size a, (Size a, Size a)))
-> (Size a, (Size a, (Size a, Size a))) -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a, (Size a, (Size a, Size a)))
"margin"  (Size a
a Size a
-> (Size a, (Size a, Size a))
-> (Size a, (Size a, (Size a, Size a)))
forall a b. a -> b -> (a, b)
! Size a
b Size a -> (Size a, Size a) -> (Size a, (Size a, Size a))
forall a b. a -> b -> (a, b)
! Size a
c Size a -> Size a -> (Size a, Size a)
forall a b. a -> b -> (a, b)
! Size a
d)

marginTop, marginLeft, marginRight, marginBottom :: Size a -> Css

marginTop :: Size a -> Css
marginTop     = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"margin-top"
marginLeft :: Size a -> Css
marginLeft    = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"margin-left"
marginRight :: Size a -> Css
marginRight   = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"margin-right"
marginBottom :: Size a -> Css
marginBottom  = Key (Size a) -> Size a -> Css
forall a. Val a => Key a -> a -> Css
key Key (Size a)
"margin-bottom"