From a94813019b146d75f7556d10e8d0dfd50586f54d Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 13 Sep 2015 11:23:04 +0200 Subject: Splitting Global design file into a hierarchy of files --- src/server/Design/Helper.hs | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/server/Design/Helper.hs (limited to 'src/server/Design/Helper.hs') 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) -- cgit v1.2.3