forked from statebox/purescript-halogen-svg
/
FontSize.purs
47 lines (42 loc) · 996 Bytes
/
FontSize.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
module Halogen.Svg.Attributes.FontSize
( FontSize(..)
, printFontSize
) where
import Prelude
import Halogen.Svg.Attributes.CSSLength (CSSLength, printCSSLength)
data FontSize
= XXSmall
| XSmall
| Small
| Medium
| Large
| XLarge
| XXLarge
| Smaller
| Larger
| FontSizeLength CSSLength
derive instance eqFontSize :: Eq FontSize
instance showFontSize :: Show FontSize where
show = case _ of
XXSmall -> "XXSmall"
XSmall -> "XSmall"
Small -> "Small"
Medium -> "Medium"
Large -> "Large"
XLarge -> "XLarge"
XXLarge -> "XXLarge"
Smaller -> "Smaller"
Larger -> "Larger"
FontSizeLength l -> "(FontSizeLength " <> printCSSLength l <> ")"
printFontSize :: FontSize -> String
printFontSize = case _ of
XXSmall -> "xx-small"
XSmall -> "x-small"
Small -> "small"
Medium -> "medium"
Large -> "large"
XLarge -> "x-large"
XXLarge -> "xx-large"
Smaller -> "smaller"
Larger -> "larger"
FontSizeLength l -> printCSSLength l