stitch-0.6.0.0: lightweight CSS DSL

Safe HaskellNone
LanguageHaskell2010

Stitch.Types

Description

Defines all the types needed for Stitch's internal CSS representation. You shouldn't need to import this module unless you're messing around with the Block representation before outputting CSS.

Synopsis

Documentation

newtype Selector Source #

Represents a CSS selector. Can be combined with other Selectors using its Monoid instance.

Constructors

Selector 

Fields

newtype Children Source #

Children is a simple specialized wrapper around Map with a custom Monoid instance. Instead of simply unioning the two Maps, the Children instance mappends the two values together in case of a key clash.

Instances
Eq Children Source # 
Instance details

Defined in Stitch.Types

Read Children Source # 
Instance details

Defined in Stitch.Types

Show Children Source # 
Instance details

Defined in Stitch.Types

Semigroup Children Source # 
Instance details

Defined in Stitch.Types

Monoid Children Source # 
Instance details

Defined in Stitch.Types

data Property Source #

Type for a CSS property or comment. The two are combined because we want to keep the ordering of comments and properties in the output CSS.

Constructors

Property Text Text 
Comment Text 
Instances
Eq Property Source # 
Instance details

Defined in Stitch.Types

Read Property Source # 
Instance details

Defined in Stitch.Types

Show Property Source # 
Instance details

Defined in Stitch.Types

newtype Import Source #

Basic newtype for handling css @import statements.

Constructors

Import Text 
Instances
Eq Import Source # 
Instance details

Defined in Stitch.Types

Methods

(==) :: Import -> Import -> Bool #

(/=) :: Import -> Import -> Bool #

Read Import Source # 
Instance details

Defined in Stitch.Types

Show Import Source # 
Instance details

Defined in Stitch.Types

data Block Source #

Top-level representation of a CSS document.

Constructors

Block [Import] [Property] Children 
Instances
Eq Block Source # 
Instance details

Defined in Stitch.Types

Methods

(==) :: Block -> Block -> Bool #

(/=) :: Block -> Block -> Bool #

Read Block Source # 
Instance details

Defined in Stitch.Types

Show Block Source # 
Instance details

Defined in Stitch.Types

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

Semigroup Block Source # 
Instance details

Defined in Stitch.Types

Methods

(<>) :: Block -> Block -> Block #

sconcat :: NonEmpty Block -> Block #

stimes :: Integral b => b -> Block -> Block #

Monoid Block Source # 
Instance details

Defined in Stitch.Types

Methods

mempty :: Block #

mappend :: Block -> Block -> Block #

mconcat :: [Block] -> Block #

data InnerBlock Source #

Representation of a CSS inner block. Similar to a top-level Block, but doesn't allow Imports.

Constructors

InnerBlock [Property] Children