Skip to content

Commit 70eb12d

Browse files
authored
Merge pull request #50 from alexmingoia/topic/font-weight-instances
Add Normal, Initial, Inherit, and Unset FontWeight instances.
2 parents cdd62db + 336dc17 commit 70eb12d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/CSS/Font.purs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
module CSS.Font where
22

33
import Prelude
4-
5-
import Data.Generic (class Generic)
6-
import Data.NonEmpty (NonEmpty, oneOf)
7-
84
import CSS.Color (Color)
5+
import CSS.Common (class Inherit, class Initial, class Normal, class Unset)
96
import CSS.Property (class Val, Value, value, quote)
107
import CSS.Size (Size)
118
import CSS.String (fromString)
129
import CSS.Stylesheet (CSS, key)
10+
import Data.Generic (class Generic)
11+
import Data.NonEmpty (NonEmpty, oneOf)
1312

1413
color :: Color -> CSS
1514
color = key $ fromString "color"
@@ -41,6 +40,18 @@ derive instance genericFontWeight :: Generic FontWeight
4140
instance valFontWeight :: Val FontWeight where
4241
value (FontWeight v) = v
4342

43+
instance normalFontWeight :: Normal FontWeight where
44+
normal = FontWeight (fromString "normal")
45+
46+
instance initialFontWeight :: Initial FontWeight where
47+
initial = FontWeight (fromString "initial")
48+
49+
instance inheritFontWeight :: Inherit FontWeight where
50+
inherit = FontWeight (fromString "inherit")
51+
52+
instance unsetFontWeight :: Unset FontWeight where
53+
unset = FontWeight (fromString "unset")
54+
4455
bold :: FontWeight
4556
bold = FontWeight $ fromString "bold"
4657

0 commit comments

Comments
 (0)