Skip to content

Add font-style values #70

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 1 commit into from
Aug 28, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/CSS.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import CSS.Display (Display(..), Position(..), absolute, block, display, display
import CSS.Elements (a, abbr, address, area, article, aside, audio, b, bdi, bdo, blockquote, body, br, button, canvas, caption, cite, code, col, colgroup, datalist, dd, del, details, dfn, div, dl, dt, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, html, i, iframe, img, input, ins, kbd, label, legend, li, main, map, mark, meter, nav, object, ol, optgroup, output, p, pre, progress, q, s, samp, section, small, span, strong, sub, summary, sup, tbody, td, textarea, tfoot, th, thead, tr, u, ul, var) as X
import CSS.Flexbox (class FlexEnd, class FlexStart, class SpaceAround, class SpaceBetween, class Stretch, AlignContentValue(..), AlignItemsValue(..), AlignSelfValue(..), FlexDirection(..), FlexWrap(..), JustifyContentValue(..), alignContent, alignItems, alignSelf, column, columnReverse, flexBasis, flexDirection, flexEnd, flexFlow, flexGrow, flexShrink, flexStart, flexWrap, justifyContent, nowrap, order, row, rowReverse, spaceAround, spaceBetween, stretch, wrap, wrapReverse) as X
import CSS.FontFace (FontFaceFormat(..), FontFaceSrc(..), fontFaceFamily, fontFaceSrc, formatName) as X
import CSS.Font (FontWeight(..), GenericFontFamily(..), bold, bolder, color, fontFamily, fontSize, fontWeight, lighter, sansSerif, weight) as X
import CSS.Font (FontStyle, FontWeight(..), GenericFontFamily(..), bold, bolder, color, fontFamily, fontSize, fontStyle, fontWeight, italic, lighter, oblique, sansSerif, weight) as X
import CSS.Geometry (bottom, height, left, margin, marginBottom, marginLeft, marginRight, marginTop, maxHeight, maxWidth, minHeight, minWidth, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, right, top, width) as X
import CSS.Gradient (Extend, Radial, Ramp, circle, circular, closestCorner, closestSide, ellipse, elliptical, farthestCorner, farthestSide, hGradient, hRepeatingGradient, linearGradient, radialGradient, repeatingLinearGradient, repeatingRadialGradient, vGradient, vRepeatingGradient) as X
import CSS.Property (class Val, Key(..), Literal(..), Prefixed(..), Value(..), cast, noCommas, plain, quote, value, (!)) as X
Expand Down
30 changes: 30 additions & 0 deletions src/CSS/Font.purs
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,33 @@ weight i = FontWeight $ value i

fontWeight :: FontWeight -> CSS
fontWeight = key $ fromString "font-weight"

newtype FontStyle = FontStyle Value

derive instance eqFontStyle :: Eq FontStyle
derive instance ordFontStyle :: Ord FontStyle
derive instance genericFontStyle :: Generic FontStyle

instance valFontStyle :: Val FontStyle where
value (FontStyle v) = v

instance normalFontStyle :: Normal FontStyle where
normal = FontStyle (fromString "normal")

instance initialFontStyle :: Initial FontStyle where
initial = FontStyle (fromString "initial")

instance inheritFontStyle :: Inherit FontStyle where
inherit = FontStyle (fromString "inherit")

instance unsetFontStyle :: Unset FontStyle where
unset = FontStyle (fromString "unset")

italic :: FontStyle
italic = FontStyle $ fromString "italic"

oblique :: FontStyle
oblique = FontStyle $ fromString "oblique"

fontStyle :: FontStyle -> CSS
fontStyle = key $ fromString "font-style"