shakespeare-2.0.3: A toolkit for making compile-time interpolated templates

Safe HaskellNone
LanguageHaskell98

Text.Cassius

Contents

Synopsis

Datatypes

data Css Source

type CssUrl url = (url -> [(Text, Text)] -> Text) -> Css Source

Type class

class ToCss a where Source

Methods

toCss :: a -> Builder Source

Rendering

renderCss :: Css -> Text Source

renderCssUrl :: (url -> [(Text, Text)] -> Text) -> CssUrl url -> Text Source

Parsing

Mixims

cassiusMixin :: QuasiQuoter Source

Create a mixin with Cassius syntax.

Since 2.0.3

data Mixin Source

Instances

ToCss instances

Color

data Color Source

Constructors

Color Word8 Word8 Word8 

Instances

Size

mkSize :: String -> ExpQ Source

Create a CSS size, e.g. $(mkSize "100px").

data AbsoluteUnit Source

Absolute size units.

Constructors

Centimeter 
Inch 
Millimeter 
Pica 
Point 

data AbsoluteSize Source

Not intended for direct use, see mkSize.

Constructors

AbsoluteSize 

Fields

absoluteSizeUnit :: AbsoluteUnit

Units used for text formatting.

absoluteSizeValue :: Rational

Normalized value in centimeters.

absoluteSize :: AbsoluteUnit -> Rational -> AbsoluteSize Source

Constructs AbsoluteSize. Not intended for direct use, see mkSize.

data PercentageSize Source

Not intended for direct use, see mkSize.

Constructors

PercentageSize 

Fields

percentageSizeValue :: Rational

Normalized value, 1 == 100%.

percentageSize :: Rational -> PercentageSize Source

Constructs PercentageSize. Not intended for direct use, see mkSize.

Internal

cassiusUsedIdentifiers :: String -> [(Deref, VarType)] Source

Determine which identifiers are used by the given template, useful for creating systems like yesod devel.