stitch-0.6.0.0: lightweight CSS DSL

Safe HaskellNone
LanguageHaskell2010

Stitch.Render

Description

This module contains all the functions needed to convert a CSS document from its internal representation (Block) to a concrete text-format CSS output.

Synopsis

Documentation

renderCSS :: CSS -> Text Source #

Convert an abstract CSS document to a real CSS document.

type BlockPrinter = Block -> Text Source #

Type of the CSS printers – a function from the internal Block representation of the CSS to a concrete Text output.

renderCSSWith :: BlockPrinter -> CSS -> Text Source #

Convert an abstract CSS document to a real CSS document using a specific printer. A simple printer called basic is included, as well as a compressing printer called compressed.

renderStitchTWith :: Monad m => BlockPrinter -> StitchT m () -> m Text Source #

Convert an abstract CSS document built with the StitchT transformer into its monad-wrapped Text output. Unless you're explicitly using the transformer, this function is probably not useful.

basic :: BlockPrinter Source #

Outputs a basic human-readable version of the CSS document. Line breaks are added between blocks, and properties are spaced nicely.

compressed :: BlockPrinter Source #

A minimal printer that aims for tiny output CSS. All spaces are removed.