| Copyright | (c) 2017 Cristian Adrián Ontivero |
|---|---|
| License | BSD3 |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Hasmin.Types.Stylesheet
Description
Synopsis
- data Expression
- data MediaQuery
- data Rule
- = AtCharset StringType
- | AtImport (Either StringType Url) [MediaQuery]
- | AtNamespace Text (Either StringType Url)
- | AtMedia [MediaQuery] [Rule]
- | AtKeyframes VendorPrefix Text [KeyframeBlock]
- | AtSupports SupportsCondition [Rule]
- | AtBlockWithRules Text [Rule]
- | AtBlockWithDec Text [Declaration]
- | StyleRule [Selector] [Declaration]
- data KeyframeSelector
- = From
- | To
- | KFPercentage Percentage
- data KeyframeBlock = KeyframeBlock [KeyframeSelector] [Declaration]
- data SupportsCondition
- data SupportsCondInParens
- minifyRules :: [Rule] -> Reader Config [Rule]
- collapse :: [Declaration] -> [Declaration]
- mergeRules :: [Rule] -> [Rule]
Documentation
data Expression Source #
Constructors
| Expression Text (Maybe Value) | |
| InvalidExpression Text |
Instances
| Eq Expression Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Show Expression Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> Expression -> ShowS # show :: Expression -> String # showList :: [Expression] -> ShowS # | |
| ToText Expression Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Minifiable Expression Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: Expression -> Reader Config Expression Source # | |
data MediaQuery Source #
Data type for media queries. For the syntax, see media query syntax.
Constructors
| MediaQuery1 Text Text [Expression] | First possibility in the grammar |
| MediaQuery2 [Expression] | Second possibility in the grammar |
Instances
| Eq MediaQuery Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Show MediaQuery Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> MediaQuery -> ShowS # show :: MediaQuery -> String # showList :: [MediaQuery] -> ShowS # | |
| ToText MediaQuery Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Minifiable MediaQuery Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: MediaQuery -> Reader Config MediaQuery Source # | |
| Minifiable [MediaQuery] Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: [MediaQuery] -> Reader Config [MediaQuery] Source # | |
A CSS rule, either a normal style rule, or one of the many possible at-rules.
Constructors
| AtCharset StringType | |
| AtImport (Either StringType Url) [MediaQuery] | |
| AtNamespace Text (Either StringType Url) | |
| AtMedia [MediaQuery] [Rule] | |
| AtKeyframes VendorPrefix Text [KeyframeBlock] | |
| AtSupports SupportsCondition [Rule] | |
| AtBlockWithRules Text [Rule] | |
| AtBlockWithDec Text [Declaration] | |
| StyleRule [Selector] [Declaration] |
data KeyframeSelector Source #
Constructors
| From | |
| To | |
| KFPercentage Percentage |
Instances
| Eq KeyframeSelector Source # | |
Defined in Hasmin.Types.Stylesheet Methods (==) :: KeyframeSelector -> KeyframeSelector -> Bool # (/=) :: KeyframeSelector -> KeyframeSelector -> Bool # | |
| Show KeyframeSelector Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> KeyframeSelector -> ShowS # show :: KeyframeSelector -> String # showList :: [KeyframeSelector] -> ShowS # | |
| ToText KeyframeSelector Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Minifiable KeyframeSelector Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: KeyframeSelector -> Reader Config KeyframeSelector Source # | |
data KeyframeBlock Source #
Constructors
| KeyframeBlock [KeyframeSelector] [Declaration] |
Instances
| Eq KeyframeBlock Source # | |
Defined in Hasmin.Types.Stylesheet Methods (==) :: KeyframeBlock -> KeyframeBlock -> Bool # (/=) :: KeyframeBlock -> KeyframeBlock -> Bool # | |
| Show KeyframeBlock Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> KeyframeBlock -> ShowS # show :: KeyframeBlock -> String # showList :: [KeyframeBlock] -> ShowS # | |
| ToText KeyframeBlock Source # | |
Defined in Hasmin.Types.Stylesheet | |
| Minifiable KeyframeBlock Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: KeyframeBlock -> Reader Config KeyframeBlock Source # | |
data SupportsCondition Source #
Constructors
| Not SupportsCondInParens | |
| And SupportsCondInParens (NonEmpty SupportsCondInParens) | |
| Or SupportsCondInParens (NonEmpty SupportsCondInParens) | |
| Parens SupportsCondInParens |
Instances
| Eq SupportsCondition Source # | |
Defined in Hasmin.Types.Stylesheet Methods (==) :: SupportsCondition -> SupportsCondition -> Bool # (/=) :: SupportsCondition -> SupportsCondition -> Bool # | |
| Show SupportsCondition Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> SupportsCondition -> ShowS # show :: SupportsCondition -> String # showList :: [SupportsCondition] -> ShowS # | |
| ToText SupportsCondition Source # | |
Defined in Hasmin.Types.Stylesheet Methods toText :: SupportsCondition -> Text Source # toBuilder :: SupportsCondition -> Builder Source # | |
| Minifiable SupportsCondition Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: SupportsCondition -> Reader Config SupportsCondition Source # | |
data SupportsCondInParens Source #
Constructors
| ParensCond SupportsCondition | |
| ParensDec Declaration |
Instances
| Eq SupportsCondInParens Source # | |
Defined in Hasmin.Types.Stylesheet Methods (==) :: SupportsCondInParens -> SupportsCondInParens -> Bool # (/=) :: SupportsCondInParens -> SupportsCondInParens -> Bool # | |
| Show SupportsCondInParens Source # | |
Defined in Hasmin.Types.Stylesheet Methods showsPrec :: Int -> SupportsCondInParens -> ShowS # show :: SupportsCondInParens -> String # showList :: [SupportsCondInParens] -> ShowS # | |
| ToText SupportsCondInParens Source # | |
Defined in Hasmin.Types.Stylesheet Methods toText :: SupportsCondInParens -> Text Source # | |
| Minifiable SupportsCondInParens Source # | |
Defined in Hasmin.Types.Stylesheet Methods minify :: SupportsCondInParens -> Reader Config SupportsCondInParens Source # | |
collapse :: [Declaration] -> [Declaration] Source #
Given a list of declarations, gathers the longhands, and if every longhand of a given shorthand is present, "collapses" them into the shorthand (i.e. replaces all the declarations for an equivalent shorthand).
mergeRules :: [Rule] -> [Rule] Source #