clay-0.15.0: CSS preprocessor as embedded Haskell.

Safe Haskell | None
Language | Haskell2010

Clay.Text

Contents

- Letter and word-spacing.
- Text-rendering.
- Text-shadow.
- Text-indent.
- Text-direction.
- Text-align.
- White-space.
- Text-decoration.
- Text-transform.
- Text-overflow.
- Word-break.
- Overflow-wrap (and Word-wrap).
- Hyphenation.
- Content.

Synopsis

- letterSpacing :: Size a -> Css
- wordSpacing :: Size a -> Css
- data TextRendering
- textRendering :: TextRendering -> Css
- optimizeSpeed :: TextRendering
- optimizeLegibility :: TextRendering
- geometricPrecision :: TextRendering
- textShadow :: Size a -> Size a -> Size a -> Color -> Css
- data TextIndent
- textIndent :: TextIndent -> Css
- eachLine :: TextIndent -> TextIndent
- hanging :: TextIndent -> TextIndent
- indent :: Size a -> TextIndent
- data TextDirection
- direction :: TextDirection -> Css
- ltr :: TextDirection
- rtl :: TextDirection
- data TextAlign
- textAlign :: TextAlign -> Css
- textAlignLast :: TextAlign -> Css
- justify :: TextAlign
- matchParent :: TextAlign
- start :: TextAlign
- end :: TextAlign
- alignSide :: Side -> TextAlign
- alignString :: Char -> TextAlign
- data WhiteSpace
- whiteSpace :: WhiteSpace -> Css
- pre :: WhiteSpace
- nowrap :: WhiteSpace
- preWrap :: WhiteSpace
- preLine :: WhiteSpace
- data TextDecoration
- textDecoration :: TextDecoration -> Css
- textDecorationStyle :: Stroke -> Css
- textDecorationLine :: TextDecoration -> Css
- textDecorationColor :: Color -> Css
- underline :: TextDecoration
- overline :: TextDecoration
- lineThrough :: TextDecoration
- blink :: TextDecoration
- data TextTransform
- textTransform :: TextTransform -> Css
- capitalize :: TextTransform
- uppercase :: TextTransform
- lowercase :: TextTransform
- fullWidth :: TextTransform
- data TextOverflow
- textOverflow :: TextOverflow -> Css
- overflowClip :: TextOverflow
- overflowEllipsis :: TextOverflow
- data WordBreak
- wordBreak :: WordBreak -> Css
- breakAll :: WordBreak
- keepAll :: WordBreak
- data OverflowWrap
- overflowWrap :: OverflowWrap -> Css
- wordWrap :: OverflowWrap -> Css
- breakWord :: OverflowWrap
- hyphens :: Hyphens -> Css
- hyphenateCharacter :: HyphenateCharacter -> Css
- hyphenateLimitChars :: HyphenateLimit -> HyphenateLimit -> HyphenateLimit -> Css
- manual :: Hyphens
- data Hyphens
- data HyphenateCharacter
- data HyphenateLimit
- data Content
- content :: Content -> Css
- contents :: [Content] -> Css
- attrContent :: Text -> Content
- stringContent :: Text -> Content
- uriContent :: Text -> Content
- urlContent :: Text -> Content
- openQuote :: Content
- closeQuote :: Content
- noOpenQuote :: Content
- noCloseQuote :: Content

# Letter and word-spacing.

letterSpacing :: Size a -> Css #

wordSpacing :: Size a -> Css #

# Text-rendering.

data TextRendering #

#### Instances

Instances details

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

textRendering :: TextRendering -> Css #

optimizeSpeed :: TextRendering #

optimizeLegibility :: TextRendering #

geometricPrecision :: TextRendering #

# Text-shadow.

textShadow :: Size a -> Size a -> Size a -> Color -> Css #

# Text-indent.

Supply a length — optionally annotated with `each-line` or `hanging` or both, or a global value. It is possible to apply the same annotation multiple times, but it has no defined effect.

Note browser support is currently (March 2018) non-existent, but the Prince typesetting system supports the syntax.

### Formal argument syntax

    <length-percentage> && hanging? && each-line?
    where
    <length-percentage> = <length> | <percentage>

data TextIndent #

#### Instances

Instances details

Inherit TextIndent # |
Instance details Defined in Clay.Text Methods inherit :: TextIndent #
Initial TextIndent # |
Instance details Defined in Clay.Text Methods initial :: TextIndent #
Other TextIndent # |
Instance details Defined in Clay.Text Methods other :: Value -> TextIndent #
Unset TextIndent # |
Instance details Defined in Clay.Text Methods unset :: TextIndent #
Val TextIndent # |
Instance details Defined in Clay.Text Methods value :: TextIndent -> Value #

textIndent :: TextIndent -> Css #

eachLine :: TextIndent -> TextIndent #

Annotate the supplied `TextIndent` with `each-line` or `hanging` or both.

    eachLine . hanging . indent $ px 3 :: TextIndent

hanging :: TextIndent -> TextIndent #

Annotate the supplied `TextIndent` with `each-line` or `hanging` or both.

    eachLine . hanging . indent $ px 3 :: TextIndent

indent :: Size a -> TextIndent #

# Text-direction.

data TextDirection #

#### Instances

Instances details

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

direction :: TextDirection -> Css #

ltr :: TextDirection #

rtl :: TextDirection #

# Text-align.

data TextAlign #

#### Instances

Instances details

Center TextAlign # |
Instance details Defined in Clay.Text Methods center :: TextAlign #
Inherit TextAlign # |
Instance details Defined in Clay.Text Methods inherit :: TextAlign #
Normal TextAlign # |
Instance details Defined in Clay.Text Methods normal :: TextAlign #
Other TextAlign # |
Instance details Defined in Clay.Text Methods other :: Value -> TextAlign #
Val TextAlign # |
Instance details Defined in Clay.Text Methods value :: TextAlign -> Value #

textAlign :: TextAlign -> Css #

textAlignLast :: TextAlign -> Css #

justify :: TextAlign #

matchParent :: TextAlign #

start :: TextAlign #

end :: TextAlign #

alignSide :: Side -> TextAlign #

alignString :: Char -> TextAlign #

# White-space.

data WhiteSpace #

#### Instances

Instances details

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

whiteSpace :: WhiteSpace -> Css #

pre :: WhiteSpace #

nowrap :: WhiteSpace #

preWrap :: WhiteSpace #

preLine :: WhiteSpace #

# Text-decoration.

data TextDecoration #

#### Instances

Instances details

Inherit TextDecoration # |
Instance details Defined in Clay.Text Methods inherit :: TextDecoration #
None TextDecoration # |
Instance details Defined in Clay.Text Methods none :: TextDecoration #
Other TextDecoration # |
Instance details Defined in Clay.Text Methods other :: Value -> TextDecoration #
Val TextDecoration # |
Instance details Defined in Clay.Text Methods value :: TextDecoration -> Value #

textDecoration :: TextDecoration -> Css #

textDecorationStyle :: Stroke -> Css #

textDecorationLine :: TextDecoration -> Css #

textDecorationColor :: Color -> Css #

underline :: TextDecoration #

overline :: TextDecoration #

lineThrough :: TextDecoration #

blink :: TextDecoration #

# Text-transform.

data TextTransform #

#### Instances

Instances details

Inherit TextTransform # |
Instance details Defined in Clay.Text Methods inherit :: TextTransform #
None TextTransform # |
Instance details Defined in Clay.Text Methods none :: TextTransform #
Val TextTransform # |
Instance details Defined in Clay.Text Methods value :: TextTransform -> Value #

textTransform :: TextTransform -> Css #

capitalize :: TextTransform #

uppercase :: TextTransform #

lowercase :: TextTransform #

fullWidth :: TextTransform #

# Text-overflow.

data TextOverflow #

#### Instances

Instances details

Inherit TextOverflow # |
Instance details Defined in Clay.Text Methods inherit :: TextOverflow #
Initial TextOverflow # |
Instance details Defined in Clay.Text Methods initial :: TextOverflow #
None TextOverflow # |
Instance details Defined in Clay.Text Methods none :: TextOverflow #
Val TextOverflow # |
Instance details Defined in Clay.Text Methods value :: TextOverflow -> Value #

textOverflow :: TextOverflow -> Css #

overflowClip :: TextOverflow #

overflowEllipsis :: TextOverflow #

# Word-break.

data WordBreak #

#### Instances

Instances details

Inherit WordBreak # |
Instance details Defined in Clay.Text Methods inherit :: WordBreak #
Initial WordBreak # |
Instance details Defined in Clay.Text Methods initial :: WordBreak #
Normal WordBreak # |
Instance details Defined in Clay.Text Methods normal :: WordBreak #
Unset WordBreak # |
Instance details Defined in Clay.Text Methods unset :: WordBreak #
Val WordBreak # |
Instance details Defined in Clay.Text Methods value :: WordBreak -> Value #

wordBreak :: WordBreak -> Css #

breakAll :: WordBreak #

keepAll :: WordBreak #

# Overflow-wrap (and Word-wrap).

data OverflowWrap #

#### Instances

Instances details

Inherit OverflowWrap # |
Instance details Defined in Clay.Text Methods inherit :: OverflowWrap #
Initial OverflowWrap # |
Instance details Defined in Clay.Text Methods initial :: OverflowWrap #
Normal OverflowWrap # |
Instance details Defined in Clay.Text Methods normal :: OverflowWrap #
Unset OverflowWrap # |
Instance details Defined in Clay.Text Methods unset :: OverflowWrap #
Val OverflowWrap # |
Instance details Defined in Clay.Text Methods value :: OverflowWrap -> Value #

overflowWrap :: OverflowWrap -> Css #

wordWrap :: OverflowWrap -> Css #

breakWord :: OverflowWrap #

# Hyphenation.

hyphens :: Hyphens -> Css #

Specifies how words should be hyphenated.

Possible values are:

`none`
  No hyphenation. Words will not be hyphenated even if it is explicitly suggested for a word.
`manual`
  Manual hyphenation. Specific characters such as `&shy;` in a word will suggest break points. This is the default.
`auto`
  Automatic hyphenation. The browser is free to hyphenate words as it sees fit. However, explicitly suggested break points will take precedence.

For example,

    >>> hyphens auto

The hyphenation rules depend on the language, which must be specified by the `lang` attribute.

For reference, see `hyphens`.

hyphenateCharacter :: HyphenateCharacter -> Css #

Customizes the character used for hyphenation.

For example,

    >>> hyphenateCharacter "~"

For reference, see `hyphenate-character`.

hyphenateLimitChars #

Arguments

:: HyphenateLimit | Minimum length of a word which can be hyphenated.
-> HyphenateLimit | Minimum number of characters allowed before a break point.
-> HyphenateLimit | Minimum number of characters allowed after a break point.
-> Css |

Adjusts the minumum number of characters involved in hyphenation.

I.e., specifies the minumum number of characters allowed in a breakable word, before a break point, and after a break point when hyphenating a word.

For example,

    >>> hyphenateLimitChars 14 auto auto

For reference, see `hyphenate-limit-chars`.

manual :: Hyphens #

Value for `hyphens` specifying that hyphenation be manual.

data Hyphens #

Type for values which can be provided to `hyphens`.

#### Instances

Instances details

Auto Hyphens # |
Instance details Defined in Clay.Text Methods auto :: Hyphens #
Inherit Hyphens # |
Instance details Defined in Clay.Text Methods inherit :: Hyphens #
Initial Hyphens # |
Instance details Defined in Clay.Text Methods initial :: Hyphens #
None Hyphens # |
Instance details Defined in Clay.Text Methods none :: Hyphens #
Other Hyphens # |
Instance details Defined in Clay.Text Methods other :: Value -> Hyphens #
Unset Hyphens # |
Instance details Defined in Clay.Text Methods unset :: Hyphens #
Val Hyphens # |
Instance details Defined in Clay.Text Methods value :: Hyphens -> Value #

data HyphenateCharacter #

Type for values which can be provided to `hyphenateCharacter`.

#### Instances

Instances details

IsString HyphenateCharacter # |
Instance details Defined in Clay.Text Methods fromString :: String -> HyphenateCharacter #
Auto HyphenateCharacter # |
Instance details Defined in Clay.Text Methods auto :: HyphenateCharacter #
Inherit HyphenateCharacter # |
Instance details Defined in Clay.Text Methods inherit :: HyphenateCharacter #
Initial HyphenateCharacter # |
Instance details Defined in Clay.Text Methods initial :: HyphenateCharacter #
Other HyphenateCharacter # |
Instance details Defined in Clay.Text Methods other :: Value -> HyphenateCharacter #
Unset HyphenateCharacter # |
Instance details Defined in Clay.Text Methods unset :: HyphenateCharacter #
Val HyphenateCharacter # |
Instance details Defined in Clay.Text Methods value :: HyphenateCharacter -> Value #

data HyphenateLimit #

Type for values which can be provded to `hyphenateLimitChars`.

#### Instances

Instances details

Num HyphenateLimit # |
Instance details Defined in Clay.Text Methods (+) :: HyphenateLimit -> HyphenateLimit -> HyphenateLimit # (-) :: HyphenateLimit -> HyphenateLimit -> HyphenateLimit # (*) :: HyphenateLimit -> HyphenateLimit -> HyphenateLimit # negate :: HyphenateLimit -> HyphenateLimit # abs :: HyphenateLimit -> HyphenateLimit # signum :: HyphenateLimit -> HyphenateLimit # fromInteger :: Integer -> HyphenateLimit #
Auto HyphenateLimit # |
Instance details Defined in Clay.Text Methods auto :: HyphenateLimit #
Inherit HyphenateLimit # |
Instance details Defined in Clay.Text Methods inherit :: HyphenateLimit #
Initial HyphenateLimit # |
Instance details Defined in Clay.Text Methods initial :: HyphenateLimit #
Other HyphenateLimit # |
Instance details Defined in Clay.Text Methods other :: Value -> HyphenateLimit #
Unset HyphenateLimit # |
Instance details Defined in Clay.Text Methods unset :: HyphenateLimit #
Val HyphenateLimit # |
Instance details Defined in Clay.Text Methods value :: HyphenateLimit -> Value #

# Content.

data Content #

#### Instances

Instances details

Inherit Content # |
Instance details Defined in Clay.Text Methods inherit :: Content #
Initial Content # |
Instance details Defined in Clay.Text Methods initial :: Content #
None Content # |
Instance details Defined in Clay.Text Methods none :: Content #
Normal Content # |
Instance details Defined in Clay.Text Methods normal :: Content #
Val Content # |
Instance details Defined in Clay.Text Methods value :: Content -> Value #

content :: Content -> Css #

contents :: [Content] -> Css #

attrContent :: Text -> Content #

stringContent :: Text -> Content #

uriContent :: Text -> Content #

urlContent :: Text -> Content #

openQuote :: Content #

closeQuote :: Content #

noOpenQuote :: Content #

noCloseQuote :: Content #