diff options
author | Joris | 2015-09-13 11:23:04 +0200 |
---|---|---|
committer | Joris | 2015-09-13 11:23:04 +0200 |
commit | a94813019b146d75f7556d10e8d0dfd50586f54d (patch) | |
tree | cf1ca605b72e0d2a4045f7aa54369e06d64aa872 /src/server/Design/Helper.hs | |
parent | e56aaedad92f8585a70277edce8ed8ad065d681c (diff) |
Splitting Global design file into a hierarchy of files
Diffstat (limited to 'src/server/Design/Helper.hs')
-rw-r--r-- | src/server/Design/Helper.hs | 62 |
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) |