/
Image.purs
51 lines (40 loc) · 1.47 KB
/
Image.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module CSS.ListStyle.Image where
import CSS.Common (class Inherit, class Initial, class None, class Unset, class URL)
import CSS.Property (class Val)
import CSS.String (fromString)
import CSS.Stylesheet (CSS, key)
import Data.Eq (class Eq)
import Data.Function (($))
import Data.Generic (class Generic, gShow)
import Data.Ord (class Ord)
import Data.Semigroup ((<>))
import Data.Show (class Show)
data ListStyleImage
= ListStyleImage String
| Initial
| Inherit
| Unset
| None
derive instance eqListStyleImage :: Eq ListStyleImage
derive instance ordListStyleImage :: Ord ListStyleImage
derive instance genericListStyleImage :: Generic ListStyleImage
instance showListStyleImage :: Show ListStyleImage where
show = gShow
instance valListStyleImage :: Val ListStyleImage where
value (Initial) = fromString "initial"
value (Inherit) = fromString "inherit"
value (Unset) = fromString "unset"
value (None) = fromString "none"
value (ListStyleImage url) = fromString ("url('" <> url <> "')")
instance initialListStyleImage :: Initial ListStyleImage where
initial = Initial
instance inheritListStyleImage :: Inherit ListStyleImage where
inherit = Inherit
instance unsetListStyleImage :: Unset ListStyleImage where
unset = Unset
instance noneListImageImage :: None ListStyleImage where
none = None
instance urlListStyleImage :: URL ListStyleImage where
url s = ListStyleImage s
listStyleImage :: ListStyleImage -> CSS
listStyleImage = key $ fromString "list-style-image"