diff --git a/src/Clay/Border.hs b/src/Clay/Border.hs index be072fe..7c27ff9 100644 --- a/src/Clay/Border.hs +++ b/src/Clay/Border.hs @@ -27,6 +27,8 @@ module Clay.Border , borderBottomLeftRadius, borderBottomRightRadius -- * Collapsing borders model for a table +, BorderCollapse +, separate , borderCollapse , borderSpacing, borderSpacing2 ) @@ -37,7 +39,6 @@ import Clay.Stylesheet import Clay.Color import Clay.Common import Clay.Size -import Clay.Display newtype Stroke = Stroke Value deriving (Val, Other, Inherit, Auto, None) @@ -158,19 +159,13 @@ borderBottomRightRadius a b = key "border-bottom-right-radius" (a ! b) ------------------------------------------------------------------------------- -{- newtype Collapse = Collapse Value - deriving (Val, Initial, Inherit, Other) +newtype BorderCollapse = BorderCollapse Value + deriving (Val, Other, Inherit, Initial, Unset, Collapse) -collapseCollapse, collapseSeparate :: Collapse +separate :: BorderCollapse +separate = BorderCollapse "separate" -collapseCollapse = Collapse "collapse" -collapseSeparate = Collapse "separate" -} - -{- Due conflict with Visibility collapse - Preferred just to add separate to Visibility - Because (borderCollapse collapseCollapse) sounds bad -} - -borderCollapse :: Visibility -> Css +borderCollapse :: BorderCollapse -> Css borderCollapse = key "border-collapse" borderSpacing :: Size a -> Css diff --git a/src/Clay/Common.hs b/src/Clay/Common.hs index 5a1cf26..3447825 100644 --- a/src/Clay/Common.hs +++ b/src/Clay/Common.hs @@ -19,6 +19,7 @@ class All a where all :: a class Auto a where auto :: a class Baseline a where baseline :: a class Center a where center :: a +class Collapse a where collapse :: a class Inherit a where inherit :: a class None a where none :: a class Normal a where normal :: a @@ -41,6 +42,8 @@ baselineValue :: Value baselineValue = "baseline" centerValue :: Value centerValue = "center" +collapseValue :: Value +collapseValue = "collapse" inheritValue :: Value inheritValue = "inherit" normalValue :: Value @@ -60,6 +63,7 @@ instance All Value where all = allValue instance Auto Value where auto = autoValue instance Baseline Value where baseline = baselineValue instance Center Value where center = centerValue +instance Collapse Value where collapse = collapseValue instance Inherit Value where inherit = inheritValue instance Normal Value where normal = normalValue instance None Value where none = noneValue diff --git a/src/Clay/Display.hs b/src/Clay/Display.hs index 52b2c6b..55de943 100644 --- a/src/Clay/Display.hs +++ b/src/Clay/Display.hs @@ -37,7 +37,6 @@ module Clay.Display -- * Visibility. , Visibility -, collapse, separate , visibility @@ -186,12 +185,7 @@ overflowY = key "overflow-y" ------------------------------------------------------------------------------- newtype Visibility = Visibility Value - deriving (Val, Other, Auto, Inherit, Hidden, Visible) - -separate, collapse :: Visibility - -collapse = Visibility "collapse" -separate = Visibility "separate" + deriving (Val, Other, Auto, Inherit, Hidden, Visible, Collapse) visibility :: Visibility -> Css visibility = key "visibility"