module Design.Helper ( clearFix , button , input , centeredWithMargin , verticalCentering ) where import Prelude hiding (span) import Clay hiding (button, input) import Design.Color as Color import Design.Constants clearFix :: Css clearFix = after & do content (stringContent "") display displayTable clear both button :: Color -> Color -> Size a -> (Color -> Color) -> Css button backgroundCol textCol h focusOp = do display flex alignItems center justifyContent center backgroundColor backgroundCol padding (px 0) (px 10) (px 0) (px 10) 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) input :: Double -> Css input h = do height (px h) padding (px 10) (px 10) (px 10) (px 10) borderRadius radius radius radius radius border solid (px 1) Color.dustyGray focus & borderColor Color.silver verticalAlign middle centeredWithMargin :: Css centeredWithMargin = do width (pct blockPercentWidth) marginLeft auto marginRight auto verticalCentering :: Css verticalCentering = do position absolute top (pct 50) "transform" -: "translateY(-50%)"