Skip to content

Commit 260c0c8

Browse files
authored
Merge pull request #51 from alexmingoia/topic/text-shadow-rule
Add text-shadow rule.
2 parents 51632cc + 75d0cb1 commit 260c0c8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/CSS/Text/Shadow.purs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module CSS.Text.Shadow where
2+
3+
import CSS.Color (Color)
4+
import CSS.Common (class Inherit, class Initial, class None)
5+
import CSS.Property (class Val, value)
6+
import CSS.Size (Size)
7+
import CSS.String (fromString)
8+
import CSS.Stylesheet (CSS, key)
9+
import Data.Tuple.Nested (tuple4)
10+
11+
data TextShadow a
12+
= TextShadow (Size a) (Size a) (Size a) (Color)
13+
| None
14+
| Initial
15+
| Inherit
16+
17+
instance valTextShadow :: Val (TextShadow a) where
18+
value (TextShadow h v b c) = value (tuple4 h v b c)
19+
value (None) = fromString "none"
20+
value (Initial) = fromString "initial"
21+
value (Inherit) = fromString "inherit"
22+
23+
instance noneTextShadow :: None (TextShadow a) where
24+
none = None
25+
26+
instance initialTextShadow :: Initial (TextShadow a) where
27+
initial = Initial
28+
29+
instance inheritTextShadow :: Inherit (TextShadow a) where
30+
inherit = Inherit
31+
32+
textShadow :: forall a. Size a -> Size a -> Size a -> Color -> CSS
33+
textShadow h v b c = key (fromString "text-shadow") (TextShadow h v b c)

0 commit comments

Comments
 (0)