Clay.Font

clay-0.15.0: CSS preprocessor as embedded Haskell.

Safe Haskell | None
Language | Haskell2010

Clay.Font

Contents

- Generic font property.
- Color.
- Font-family.
- Font-size.
- Font-style
- Font-variant.
- Font-weight
- Named fonts.
- Line-height.

Synopsis

- class Val a => Font a where
  - font :: a -> Css
- data Optional = Optional (Maybe FontWeight) (Maybe FontVariant) (Maybe FontStyle)
- data Required a = Required (Size a) (Maybe (Size a)) [Text] [GenericFontFamily]
- fontColor :: Color -> Css
- color :: Color -> Css
- fontFamily :: [Text] -> [GenericFontFamily] -> Css
- sansSerif :: GenericFontFamily
- serif :: GenericFontFamily
- monospace :: GenericFontFamily
- cursive :: GenericFontFamily
- fantasy :: GenericFontFamily
- data FontSize
- fontSize :: Size a -> Css
- fontSizeCustom :: FontSize -> Css
- xxSmall :: FontSize
- xSmall :: FontSize
- small :: FontSize
- medium :: FontSize
- large :: FontSize
- xLarge :: FontSize
- xxLarge :: FontSize
- smaller :: FontSize
- larger :: FontSize
- data FontStyle
- fontStyle :: FontStyle -> Css
- italic :: FontStyle
- oblique :: FontStyle
- data FontVariant
- fontVariant :: FontVariant -> Css
- smallCaps :: FontVariant
- data FontWeight
- fontWeight :: FontWeight -> Css
- bold :: FontWeight
- bolder :: FontWeight
- lighter :: FontWeight
- weight :: Integer -> FontWeight
- data NamedFont
- caption :: NamedFont
- icon :: NamedFont
- menu :: NamedFont
- messageBox :: NamedFont
- smallCaption :: NamedFont
- statusBar :: NamedFont
- lineHeight :: Size a -> Css

# Generic font property.

class Val a => Font a where #

We implement the generic font property as a type class that accepts multiple value types. This allows us to combine different font aspects into a shorthand syntax. Fonts require a mandatory part and have a optional a part.

http://www.w3.org/TR/css3-fonts/#font-prop

Minimal complete definition

Nothing

Methods

font :: a -> Css #

#### Instances

Instances details

Font (Required a) # |
Instance details Defined in Clay.Font Methods font :: Required a -> Css #
Font (Optional, Required a) # |
Instance details Defined in Clay.Font Methods font :: (Optional, Required a) -> Css #

data Optional #

Constructors

Optional (Maybe FontWeight) (Maybe FontVariant) (Maybe FontStyle) |

#### Instances

Instances details

Val Optional # |
Instance details Defined in Clay.Font Methods value :: Optional -> Value #
Font (Optional, Required a) # |
Instance details Defined in Clay.Font Methods font :: (Optional, Required a) -> Css #

data Required a #

Constructors

Required (Size a) (Maybe (Size a)) [Text] [GenericFontFamily] |

#### Instances

Instances details

Font (Required a) # |
Instance details Defined in Clay.Font Methods font :: Required a -> Css #
Val (Required a) # |
Instance details Defined in Clay.Font Methods value :: Required a -> Value #
Font (Optional, Required a) # |
Instance details Defined in Clay.Font Methods font :: (Optional, Required a) -> Css #

# Color.

fontColor :: Color -> Css #

An alias for color.

color :: Color -> Css #

# Font-family.

fontFamily :: [Text] -> [GenericFontFamily] -> Css #

The `fontFamily` style rules takes to lists of font families: zero or more custom font-families and preferably one or more generic font families.

sansSerif :: GenericFontFamily #

serif :: GenericFontFamily #

monospace :: GenericFontFamily #

cursive :: GenericFontFamily #

fantasy :: GenericFontFamily #

# Font-size.

data FontSize #

#### Instances

Instances details

Auto FontSize # |
Instance details Defined in Clay.Font Methods auto :: FontSize #
Inherit FontSize # |
Instance details Defined in Clay.Font Methods inherit :: FontSize #
Other FontSize # |
Instance details Defined in Clay.Font Methods other :: Value -> FontSize #
Val FontSize # |
Instance details Defined in Clay.Font Methods value :: FontSize -> Value #

fontSize :: Size a -> Css #

fontSizeCustom :: FontSize -> Css #

xxSmall :: FontSize #

xSmall :: FontSize #

small :: FontSize #

medium :: FontSize #

large :: FontSize #

xLarge :: FontSize #

xxLarge :: FontSize #

smaller :: FontSize #

larger :: FontSize #

# Font-style

data FontStyle #

#### Instances

Instances details

Inherit FontStyle # |
Instance details Defined in Clay.Font Methods inherit :: FontStyle #
Normal FontStyle # |
Instance details Defined in Clay.Font Methods normal :: FontStyle #
Other FontStyle # |
Instance details Defined in Clay.Font Methods other :: Value -> FontStyle #
Val FontStyle # |
Instance details Defined in Clay.Font Methods value :: FontStyle -> Value #

fontStyle :: FontStyle -> Css #

italic :: FontStyle #

oblique :: FontStyle #

# Font-variant.

data FontVariant #

#### Instances

Instances details

Inherit FontVariant # |
Instance details Defined in Clay.Font Methods inherit :: FontVariant #
Normal FontVariant # |
Instance details Defined in Clay.Font Methods normal :: FontVariant #
Other FontVariant # |
Instance details Defined in Clay.Font Methods other :: Value -> FontVariant #
Val FontVariant # |
Instance details Defined in Clay.Font Methods value :: FontVariant -> Value #

fontVariant :: FontVariant -> Css #

smallCaps :: FontVariant #

# Font-weight

data FontWeight #

#### Instances

Instances details

Inherit FontWeight # |
Instance details Defined in Clay.Font Methods inherit :: FontWeight #
Normal FontWeight # |
Instance details Defined in Clay.Font Methods normal :: FontWeight #
Other FontWeight # |
Instance details Defined in Clay.Font Methods other :: Value -> FontWeight #
Val FontWeight # |
Instance details Defined in Clay.Font Methods value :: FontWeight -> Value #

fontWeight :: FontWeight -> Css #

bold :: FontWeight #

bolder :: FontWeight #

lighter :: FontWeight #

weight :: Integer -> FontWeight #

# Named fonts.

data NamedFont #

#### Instances

Instances details

Other NamedFont # |
Instance details Defined in Clay.Font Methods other :: Value -> NamedFont #
Val NamedFont # |
Instance details Defined in Clay.Font Methods value :: NamedFont -> Value #

caption :: NamedFont #

icon :: NamedFont #

menu :: NamedFont #

messageBox :: NamedFont #

smallCaption :: NamedFont #

statusBar :: NamedFont #

# Line-height.

lineHeight :: Size a -> Css #