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

Safe HaskellNone
LanguageHaskell98

Text.Lucius

Contents

Synopsis

Parsing

lucius :: QuasiQuoter Source #

>>> renderCss ([lucius|foo{bar:baz}|] undefined)
"foo{bar:baz}"

Mixins

data Mixin Source #

Instances

Runtime

luciusRT :: Text -> [(Text, Text)] -> Either String Text Source #

luciusRT' :: Text -> Either String ([(Text, Text)] -> Either String [TopLevel Resolved]) Source #

luciusRTMinified :: Text -> [(Text, Text)] -> Either String Text Source #

Same as luciusRT, but output has no added whitespace.

Since 1.0.3

Mixin

luciusRTMixin Source #

Arguments

:: Text

template

-> Bool

minify?

-> [(Text, RTValue)]

scope

-> Either String Text 

Runtime Lucius with mixin support.

Since 1.0.6

data RTValue Source #

Constructors

RTVRaw Text 
RTVMixin Mixin 

Datatypes

data Css Source #

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

Type class

class ToCss a where Source #

Minimal complete definition

toCss

Methods

toCss :: a -> Builder Source #

Instances

ToCss Text Source # 

Methods

toCss :: Text -> Builder Source #

ToCss Text Source # 

Methods

toCss :: Text -> Builder Source #

ToCss PercentageSize Source # 

Methods

toCss :: PercentageSize -> Builder Source #

ToCss AbsoluteSize Source # 

Methods

toCss :: AbsoluteSize -> Builder Source #

ToCss Color Source # 

Methods

toCss :: Color -> Builder Source #

ToCss EmSize Source # 

Methods

toCss :: EmSize -> Builder Source #

ToCss ExSize Source # 

Methods

toCss :: ExSize -> Builder Source #

ToCss PixelSize Source # 

Methods

toCss :: PixelSize -> Builder Source #

ToCss [Char] Source # 

Methods

toCss :: [Char] -> Builder Source #

Rendering

renderCss :: Css -> Text Source #

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

ToCss instances

Color

data Color Source #

Constructors

Color Word8 Word8 Word8 

Instances

Show Color Source # 

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

ToCss Color Source # 

Methods

toCss :: Color -> Builder Source #

Size

mkSize :: String -> ExpQ Source #

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

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

percentageSize :: Rational -> PercentageSize Source #

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

Internal

parseTopLevels :: Parser [TopLevel Unresolved] Source #

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

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