From a8309988518af5bddf62d6a326d990fde4069b40 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 3 Jan 2016 19:41:31 +0100 Subject: Set focus properties to button elements --- src/server/Design/Helper.hs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/server/Design/Helper.hs') diff --git a/src/server/Design/Helper.hs b/src/server/Design/Helper.hs index 40218f8..f4c19fa 100644 --- a/src/server/Design/Helper.hs +++ b/src/server/Design/Helper.hs @@ -27,19 +27,22 @@ clearFix = display D.table clear both -defaultButton :: Color -> Color -> Size Abs -> Css -defaultButton backgroundCol textCol h = do +defaultButton :: Color -> Color -> Size a -> (Color -> Color) -> Css +defaultButton backgroundCol textCol h focusOp = do backgroundColor backgroundCol color textCol borderRadius radius radius radius radius verticalAlign middle cursor pointer lineHeight h + height h textAlign (alignSide sideCenter) + hover & backgroundColor (focusOp backgroundCol) + focus & backgroundColor (focusOp backgroundCol) -iconButton :: Color -> Color -> Size Abs -> Css -iconButton backgroundCol textCol h = do - defaultButton backgroundCol textCol h +iconButton :: Color -> Color -> Size Abs -> (Color -> Color) -> Css +iconButton backgroundCol textCol h focusOp = do + defaultButton backgroundCol textCol h focusOp i <> span ? do height h lineHeight h @@ -49,11 +52,10 @@ iconButton backgroundCol textCol h = do i ? do marginLeft (px 15) marginRight (px 20) - hover & i ? transform (scale 1.2 1.2) defaultInput :: Integer -> Css -defaultInput inputHeight = do - height (px inputHeight) +defaultInput h = do + height (px h) padding (px 10) (px 10) (px 10) (px 10) borderRadius radius radius radius radius border solid (px 1) C.darkGrey @@ -72,7 +74,7 @@ expandBlock headerBackground headerColor headerHeight = do marginLeft (pct blockPercentMargin) marginRight (pct blockPercentMargin) ".header" ? do - defaultButton headerBackground headerColor headerHeight + defaultButton headerBackground headerColor headerHeight focusLighten width (pct 100) fontSize (px 18) borderRadius radius radius radius radius -- cgit v1.2.3