Skip to content

Add text-shadow rule. #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/CSS/Text/Shadow.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module CSS.Text.Shadow where

import CSS.Color (Color)
import CSS.Common (class Inherit, class Initial, class None)
import CSS.Property (class Val, value)
import CSS.Size (Size)
import CSS.String (fromString)
import CSS.Stylesheet (CSS, key)
import Data.Tuple.Nested (tuple4)

data TextShadow a
= TextShadow (Size a) (Size a) (Size a) (Color)
| None
| Initial
| Inherit

instance valTextShadow :: Val (TextShadow a) where
value (TextShadow h v b c) = value (tuple4 h v b c)
value (None) = fromString "none"
value (Initial) = fromString "initial"
value (Inherit) = fromString "inherit"

instance noneTextShadow :: None (TextShadow a) where
none = None

instance initialTextShadow :: Initial (TextShadow a) where
initial = Initial

instance inheritTextShadow :: Inherit (TextShadow a) where
inherit = Inherit

textShadow :: forall a. Size a -> Size a -> Size a -> Color -> CSS
textShadow h v b c = key (fromString "text-shadow") (TextShadow h v b c)