clay 0.1.1 → 0.2
raw patch · 6 files changed
+87/−17 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Clay.Border: groove :: Stroke
+ Clay.Border: inset :: Stroke
+ Clay.Border: outline :: Stroke -> Size Abs -> Color -> Css
+ Clay.Border: outlineBottom :: Stroke -> Size Abs -> Color -> Css
+ Clay.Border: outlineBottomColor :: Color -> Css
+ Clay.Border: outlineBottomStyle :: Stroke -> Css
+ Clay.Border: outlineBottomWidth :: Size Abs -> Css
+ Clay.Border: outlineColor :: Color -> Css
+ Clay.Border: outlineLeft :: Stroke -> Size Abs -> Color -> Css
+ Clay.Border: outlineLeftColor :: Color -> Css
+ Clay.Border: outlineLeftStyle :: Stroke -> Css
+ Clay.Border: outlineLeftWidth :: Size Abs -> Css
+ Clay.Border: outlineOffset :: Size Abs -> Css
+ Clay.Border: outlineRight :: Stroke -> Size Abs -> Color -> Css
+ Clay.Border: outlineRightColor :: Color -> Css
+ Clay.Border: outlineRightStyle :: Stroke -> Css
+ Clay.Border: outlineRightWidth :: Size Abs -> Css
+ Clay.Border: outlineStyle :: Stroke -> Css
+ Clay.Border: outlineTop :: Stroke -> Size Abs -> Color -> Css
+ Clay.Border: outlineTopColor :: Color -> Css
+ Clay.Border: outlineTopStyle :: Stroke -> Css
+ Clay.Border: outlineTopWidth :: Size Abs -> Css
+ Clay.Border: outlineWidth :: Size Abs -> Css
+ Clay.Border: outset :: Stroke
+ Clay.Border: ridge :: Stroke
+ Clay.Display: opacity :: Double -> Css
+ Clay.Render: banner :: Config -> Bool
- Clay.Render: Config :: Builder -> Builder -> Builder -> Bool -> Bool -> Config
+ Clay.Render: Config :: Builder -> Builder -> Builder -> Bool -> Bool -> Bool -> Config
- Clay.Transform: rotate :: Angle a -> Angle a -> Transformation
+ Clay.Transform: rotate :: Angle a -> Transformation
Files
- clay.cabal +10/−6
- src/Clay/Border.hs +55/−4
- src/Clay/Display.hs +7/−0
- src/Clay/Font.hs +2/−2
- src/Clay/Render.hs +11/−3
- src/Clay/Transform.hs +2/−2
clay.cabal view
@@ -1,5 +1,5 @@ Name: clay-Version: 0.1.1+Version: 0.2 Synopsis: CSS preprocessor as embedded Haskell. Description: Clay is a CSS preprocessor like LESS and Sass, but implemented as an embedded@@ -7,17 +7,21 @@ and style rules are first class Haskell functions, which makes reuse and composability easy. .- The project is described on <http://sebastiaanvisser.github.com/clay>.+ The project is described on <http://fvisser.nl/clay>. . The API documentation can be found in the top level module "Clay". .- > 0.1 -> 0.1.1- > - Fixed bug in visibility property.- > Thanks to Conrad Indiono for the pull request.+ > 0.1.1 -> 0.2+ > - Rotate takes only one argument.+ > - Added opacity property.+ > - Print Clay banner in CSS comments by default.+ > - Fixed bug in font-family rendering (Firefox only).+ > - Added outline related properties.+ > - Fixed bug in monospace font family. Author: Sebastiaan Visser Maintainer: Sebastiaan Visser <code@fvisser.nl>-Homepage: http://sebastiaanvisser.github.com/clay+Homepage: http://fvisser.nl/clay Bug-Reports: http://github.com/sebastiaanvisser/clay/issues License: BSD3
src/Clay/Border.hs view
@@ -1,9 +1,9 @@ {-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-} module Clay.Border (--- * Stroke type.+-- * Stroke type, used for border-style and outline-style. Stroke-, solid, dotted, dashed, double, wavy+, solid, dotted, dashed, double, wavy, groove, ridge, inset, outset -- * Border properties. @@ -12,6 +12,14 @@ , borderStyle, borderLeftStyle, borderRightStyle, borderTopStyle, borderBottomStyle , borderWidth, borderLeftWidth, borderRightWidth, borderTopWidth, borderBottomWidth +-- * Outline properties.++, outline, outlineTop, outlineLeft, outlineBottom, outlineRight+, outlineColor, outlineLeftColor, outlineRightColor, outlineTopColor, outlineBottomColor+, outlineStyle, outlineLeftStyle, outlineRightStyle, outlineTopStyle, outlineBottomStyle+, outlineWidth, outlineLeftWidth, outlineRightWidth, outlineTopWidth, outlineBottomWidth+, outlineOffset+ -- * Border radius. , borderRadius@@ -29,14 +37,20 @@ newtype Stroke = Stroke Value deriving (Val, Other, Inherit, Auto, None) -solid, dotted, dashed, double, wavy :: Stroke+solid, dotted, dashed, double, wavy, groove, ridge, inset, outset :: Stroke solid = Stroke "solid" dotted = Stroke "dotted" dashed = Stroke "dashed" double = Stroke "double"-wavy = Stroke "Wavu"+wavy = Stroke "wavy"+groove = Stroke "groove"+ridge = Stroke "ridge"+inset = Stroke "inset"+outset = Stroke "outset" +-------------------------------------------------------------------------------+ border, borderTop, borderLeft, borderBottom, borderRight :: Stroke -> Size Abs -> Color -> Css border a b c = key "border" (a ! b ! c)@@ -68,6 +82,43 @@ borderRightWidth = key "border-right-width" borderTopWidth = key "border-top-width" borderBottomWidth = key "border-bottom-width"++-------------------------------------------------------------------------------++outline, outlineTop, outlineLeft, outlineBottom, outlineRight :: Stroke -> Size Abs -> Color -> Css++outline a b c = key "outline" (a ! b ! c)+outlineTop a b c = key "outline-top" (a ! b ! c)+outlineLeft a b c = key "outline-left" (a ! b ! c)+outlineBottom a b c = key "outline-bottom" (a ! b ! c)+outlineRight a b c = key "outline-right" (a ! b ! c)++outlineColor, outlineLeftColor, outlineRightColor, outlineTopColor, outlineBottomColor :: Color -> Css++outlineColor = key "outline-color"+outlineLeftColor = key "outline-left-color"+outlineRightColor = key "outline-right-color"+outlineTopColor = key "outline-top-color"+outlineBottomColor = key "outline-bottom-color"++outlineStyle, outlineLeftStyle, outlineRightStyle, outlineTopStyle, outlineBottomStyle :: Stroke -> Css++outlineStyle = key "outline-style"+outlineLeftStyle = key "outline-left-style"+outlineRightStyle = key "outline-right-style"+outlineTopStyle = key "outline-top-style"+outlineBottomStyle = key "outline-bottom-style"++outlineWidth, outlineLeftWidth, outlineRightWidth, outlineTopWidth, outlineBottomWidth :: Size Abs -> Css++outlineWidth = key "outline-width"+outlineLeftWidth = key "outline-left-width"+outlineRightWidth = key "outline-right-width"+outlineTopWidth = key "outline-top-width"+outlineBottomWidth = key "outline-bottom-width"++outlineOffset :: Size Abs -> Css+outlineOffset = key "outline-offset" -------------------------------------------------------------------------------
src/Clay/Display.hs view
@@ -43,6 +43,10 @@ , clip , rect +-- * Opacity.++, opacity+ -- * Z-index. , zIndex@@ -173,6 +177,9 @@ rect t r b l = Clip (mconcat ["rect(", value t, ",", value r, ",", value b, ",", value l, ")"]) -------------------------------------------------------------------------------++opacity :: Double -> Css+opacity = key "opacity" zIndex :: Integer -> Css zIndex i = key "z-index" (fromString (show i) :: Value)
src/Clay/Font.hs view
@@ -118,7 +118,7 @@ ------------------------------------------------------------------------------- fontFamily :: [Text] -> [Text] -> Css-fontFamily a b = key "font-family" (value (Literal <$> a) ! value b)+fontFamily a b = key "font-family" (value (Literal <$> a) <> if null b then "" else (", " <> value b)) sansSerif :: Text sansSerif = "sans-serif"@@ -127,7 +127,7 @@ serif = "serif" monospace :: Text-monospace = "fixed"+monospace = "monospace" -------------------------------------------------------------------------------
src/Clay/Render.hs view
@@ -35,17 +35,18 @@ , sep :: Builder , warn :: Bool , align :: Bool+ , banner :: Bool } -- | Configuration to print to a pretty human readable CSS output. pretty :: Config-pretty = Config " " "\n" " " True True+pretty = Config " " "\n" " " True True True -- | Configuration to print to a compacted unreadable CSS output. compact :: Config-compact = Config "" "" "" False False+compact = Config "" "" "" False False True -- | Render to CSS using the default configuration (`pretty`) and directly -- print to the standard output.@@ -64,10 +65,17 @@ renderWith :: Config -> [App] -> Css -> Lazy.Text renderWith cfg top (S c)- = toLazyText+ = renderBanner cfg+ . toLazyText . rules cfg top . execWriter $ c++renderBanner :: Config -> Lazy.Text -> Lazy.Text+renderBanner cfg =+ if banner cfg+ then (<> "\n/* Generated with Clay, http://fvisser.nl/clay */")+ else id rules :: Config -> [App] -> [Rule] -> Builder rules cfg sel rs = mconcat
src/Clay/Transform.hs view
@@ -72,8 +72,8 @@ ------------------------------------------------------------------------------- -rotate :: Angle a -> Angle a -> Transformation-rotate x y = Transformation ("rotate(" <> value [x, y] <> ")")+rotate :: Angle a -> Transformation+rotate x = Transformation ("rotate(" <> value x <> ")") rotateX, rotateY, rotateZ :: Angle a -> Transformation