Skip to content

Add Normal, Initial, Inherit, and Unset FontWeight instances. #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/CSS/Font.purs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module CSS.Font where

import Prelude

import Data.Generic (class Generic)
import Data.NonEmpty (NonEmpty, oneOf)

import CSS.Color (Color)
import CSS.Common (class Inherit, class Initial, class Normal, class Unset)
import CSS.Property (class Val, Value, value, quote)
import CSS.Size (Size)
import CSS.String (fromString)
import CSS.Stylesheet (CSS, key)
import Data.Generic (class Generic)
import Data.NonEmpty (NonEmpty, oneOf)

color :: Color -> CSS
color = key $ fromString "color"
Expand Down Expand Up @@ -41,6 +40,18 @@ derive instance genericFontWeight :: Generic FontWeight
instance valFontWeight :: Val FontWeight where
value (FontWeight v) = v

instance normalFontWeight :: Normal FontWeight where
normal = FontWeight (fromString "normal")

instance initialFontWeight :: Initial FontWeight where
initial = FontWeight (fromString "initial")

instance inheritFontWeight :: Inherit FontWeight where
inherit = FontWeight (fromString "inherit")

instance unsetFontWeight :: Unset FontWeight where
unset = FontWeight (fromString "unset")

bold :: FontWeight
bold = FontWeight $ fromString "bold"

Expand Down