diff --git a/src/CSS.purs b/src/CSS.purs index a2476ec..2c75a7f 100644 --- a/src/CSS.purs +++ b/src/CSS.purs @@ -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 diff --git a/src/CSS/Font.purs b/src/CSS/Font.purs index b3912aa..55c7dc9 100644 --- a/src/CSS/Font.purs +++ b/src/CSS/Font.purs @@ -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"