aboutsummaryrefslogtreecommitdiff
path: root/src/server/Design/Helper.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Design/Helper.hs')
-rw-r--r--src/server/Design/Helper.hs62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/server/Design/Helper.hs b/src/server/Design/Helper.hs
new file mode 100644
index 0000000..53839c1
--- /dev/null
+++ b/src/server/Design/Helper.hs
@@ -0,0 +1,62 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Design.Helper
+ ( clearFix
+ , defaultButton
+ , defaultInput
+ , centeredWithMargin
+ , expandBlock
+ ) where
+
+import Clay
+
+import Design.Constants
+import Design.Color as C
+import qualified Clay.Display as D
+
+clearFix :: Css
+clearFix =
+ after & do
+ content (stringContent "")
+ display D.table
+ clear both
+
+defaultButton :: Color -> Color -> Size Abs -> Css
+defaultButton backgroundCol textCol height = do
+ backgroundColor backgroundCol
+ color textCol
+ borderRadius radius radius radius radius
+ verticalAlign middle
+ cursor pointer
+ lineHeight height
+ textAlign (alignSide sideCenter)
+
+defaultInput :: Integer -> Css
+defaultInput inputHeight = do
+ height (px inputHeight)
+ padding (px 10) (px 10) (px 10) (px 10)
+ borderRadius radius radius radius radius
+ border solid (px 1) C.darkGrey
+ focus & borderColor C.grey
+ verticalAlign middle
+
+centeredWithMargin :: Css
+centeredWithMargin = do
+ width (pct blockPercentWidth)
+ marginLeft auto
+ marginRight auto
+
+expandBlock :: Color -> Color -> Size Abs -> Css
+expandBlock headerBackground headerColor headerHeight = do
+ marginBottom blockMarginBottom
+ marginLeft (pct blockPercentMargin)
+ marginRight (pct blockPercentMargin)
+ ".header" ? do
+ defaultButton headerBackground headerColor headerHeight
+ width (pct 100)
+ fontSize (px 18)
+ borderRadius radius radius radius radius
+ textAlign (alignSide sideLeft)
+ position relative
+ paddingLeft blockPadding
+ paddingRight (px 55)