/
VerticalAlign.purs
69 lines (54 loc) · 1.68 KB
/
VerticalAlign.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module CSS.VerticalAlign where
import CSS.Common (class Baseline, class Inherit, class Initial, class Unset, class Top, class Middle, class Bottom)
import CSS.Property (class Val)
import CSS.String (fromString)
import CSS.Stylesheet (CSS, key)
import Data.Function (($))
data VerticalAlign
= Baseline
| Sub
| Super
| TextTop
| TextBottom
| Middle
| Top
| Bottom
| Inherit
| Initial
| Unset
instance valVerticalAlign :: Val (VerticalAlign) where
value (Baseline) = fromString "baseline"
value (Sub) = fromString "sub"
value (Super) = fromString "super"
value (TextTop) = fromString "text-top"
value (TextBottom) = fromString "text-bottom"
value (Middle) = fromString "middle"
value (Top) = fromString "top"
value (Bottom) = fromString "bottom"
value (Inherit) = fromString "inherit"
value (Initial) = fromString "initial"
value (Unset) = fromString "unset"
instance inheritVerticalAlign :: Inherit (VerticalAlign) where
inherit = Inherit
instance initialVerticalAlign :: Initial (VerticalAlign) where
initial = Initial
instance unsetVerticalAlign :: Unset (VerticalAlign) where
unset = Unset
instance baselineVerticalAlign :: Baseline (VerticalAlign) where
baseline = Baseline
instance middleVerticalAlign :: Middle (VerticalAlign) where
middle = Middle
instance topVerticalAlign :: Top (VerticalAlign) where
top = Top
instance bottomVerticalAlign :: Bottom (VerticalAlign) where
bottom = Bottom
sub :: VerticalAlign
sub = Sub
super :: VerticalAlign
super = Super
textTop :: VerticalAlign
textTop = TextTop
textBottom :: VerticalAlign
textBottom = TextBottom
verticalAlign :: VerticalAlign -> CSS
verticalAlign = key $ fromString "vertical-align"