-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | CSS Minifier -- -- A CSS minifier which not only aims at reducing the amount of bytes of -- the output, but also at improving gzip compression. It may be used as -- a library, or a stand-alone executable. For the library, refer to the -- Hasmin module documentation. For the program: the output is the -- minified CSS file, but hasmin allows also its compression into gzip -- using Google's Zopfli library. -- -- To use it: ./hasmin input.css > output.css -- -- By default, most minification techniques are enabled. For a list of -- available flags, do: ./hasmin --help @package hasmin @version 1.0.2 module Hasmin.Config -- | The configuration used for minifying. data Config Config :: ColorSettings -> DimensionSettings -> GradientSettings -> Bool -> Bool -> Bool -> Bool -> Bool -> FontWeightSettings -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> LetterCase -> SortingMethod -> SortingMethod -> RulesMergeSettings -> Config [colorSettings] :: Config -> ColorSettings [dimensionSettings] :: Config -> DimensionSettings [gradientSettings] :: Config -> GradientSettings [shouldUsePropertyTraits] :: Config -> Bool [shouldCleanRules] :: Config -> Bool [shouldMinifyTimingFunctions] :: Config -> Bool [shouldMinifyFilterFunctions] :: Config -> Bool [shouldRemoveQuotes] :: Config -> Bool [fontweightSettings] :: Config -> FontWeightSettings [shouldMinifyTransformOrigin] :: Config -> Bool [shouldMinifyMicrosyntax] :: Config -> Bool [shouldMinifyKeyframeSelectors] :: Config -> Bool [shouldMinifyTransformFunction] :: Config -> Bool [shouldConvertEscaped] :: Config -> Bool [shouldConvertNullPercentages] :: Config -> Bool [shouldRemoveEmptyBlocks] :: Config -> Bool [shouldRemoveDuplicateSelectors] :: Config -> Bool [shouldNormalizeQuotes] :: Config -> Bool [letterCase] :: Config -> LetterCase [selectorSorting] :: Config -> SortingMethod [declarationSorting] :: Config -> SortingMethod [rulesMergeSettings] :: Config -> RulesMergeSettings data ColorSettings ColorMinOff :: ColorSettings ColorMinOn :: ColorSettings data DimensionSettings DimMinOff :: DimensionSettings DimMinOn :: DimensionSettings data GradientSettings GradientMinOff :: GradientSettings GradientMinOn :: GradientSettings data FontWeightSettings FontWeightMinOff :: FontWeightSettings FontWeightMinOn :: FontWeightSettings data LetterCase -- | Leave letter casing as is. Original :: LetterCase -- | Lowercase whatever possible to improve gzip compression. Lowercase :: LetterCase data SortingMethod NoSorting :: SortingMethod Lexicographical :: SortingMethod -- | A default config with most settings enabled. Used by the minify -- function, mainly for testing purposes. defaultConfig :: Config data RulesMergeSettings MergeRulesOn :: RulesMergeSettings MergeRulesOff :: RulesMergeSettings instance GHC.Show.Show Hasmin.Config.Config instance GHC.Classes.Eq Hasmin.Config.RulesMergeSettings instance GHC.Show.Show Hasmin.Config.RulesMergeSettings instance GHC.Classes.Eq Hasmin.Config.FontWeightSettings instance GHC.Show.Show Hasmin.Config.FontWeightSettings instance GHC.Classes.Eq Hasmin.Config.SortingMethod instance GHC.Show.Show Hasmin.Config.SortingMethod instance GHC.Classes.Eq Hasmin.Config.LetterCase instance GHC.Show.Show Hasmin.Config.LetterCase instance GHC.Classes.Eq Hasmin.Config.GradientSettings instance GHC.Show.Show Hasmin.Config.GradientSettings instance GHC.Classes.Eq Hasmin.Config.DimensionSettings instance GHC.Show.Show Hasmin.Config.DimensionSettings instance GHC.Classes.Eq Hasmin.Config.ColorSettings instance GHC.Show.Show Hasmin.Config.ColorSettings module Hasmin.Class -- | Class for types that can be converted to Text. Used for printing the -- minified results. class ToText a toText :: ToText a => a -> Text toBuilder :: ToText a => a -> Builder -- | Class for types that can be minified class Minifiable a minify :: Minifiable a => a -> Reader Config a instance Hasmin.Class.ToText GHC.Word.Word8 instance Hasmin.Class.ToText GHC.Types.Int instance Hasmin.Class.ToText Data.Text.Internal.Text instance (Hasmin.Class.ToText a, Hasmin.Class.ToText b) => Hasmin.Class.ToText (Data.Either.Either a b) -- | Parsers for very basic CSS grammar tokens. module Hasmin.Parser.Primitives ident :: Parser Text escape :: Parser Builder unicode :: Parser Builder nmstart :: Parser Builder nmchar :: Parser Builder -- | Parser for <integer>: [+|-][0-9]+ int :: Parser Int -- | <integer> data type parser, but into a String instead of an Int, -- for other parsers to use (e.g.: see the parsers int, or rational) int' :: Parser String -- | Parser one or more digits. digits :: Parser String module Hasmin.Types.RepeatStyle -- | CSS <repeat-style> data type, used in the properties -- background-repeat and background. data RepeatStyle RepeatX :: RepeatStyle RepeatY :: RepeatStyle RepeatStyle1 :: RSKeyword -> RepeatStyle RepeatStyle2 :: RSKeyword -> RSKeyword -> RepeatStyle data RSKeyword RsRepeat :: RSKeyword RsSpace :: RSKeyword RsRound :: RSKeyword RsNoRepeat :: RSKeyword instance GHC.Show.Show Hasmin.Types.RepeatStyle.RepeatStyle instance GHC.Enum.Bounded Hasmin.Types.RepeatStyle.RSKeyword instance GHC.Enum.Enum Hasmin.Types.RepeatStyle.RSKeyword instance GHC.Classes.Eq Hasmin.Types.RepeatStyle.RSKeyword instance GHC.Show.Show Hasmin.Types.RepeatStyle.RSKeyword instance Hasmin.Class.ToText Hasmin.Types.RepeatStyle.RepeatStyle instance Hasmin.Class.Minifiable Hasmin.Types.RepeatStyle.RepeatStyle instance GHC.Classes.Eq Hasmin.Types.RepeatStyle.RepeatStyle instance Hasmin.Class.ToText Hasmin.Types.RepeatStyle.RSKeyword module Hasmin.Types.String removeQuotes :: StringType -> Either Text StringType unquoteUrl :: StringType -> Either Text StringType unquoteFontFamily :: StringType -> Either Text StringType -- | Parse and convert any escaped unicode to its underlying Char. convertEscaped :: Parser Text mapString :: (Text -> Reader Config Text) -> StringType -> Reader Config StringType -- | The <string> data type. It represents a string, formed by -- Unicode characters, delimited by either double (") or single (') -- quotes. data StringType DoubleQuotes :: Text -> StringType SingleQuotes :: Text -> StringType instance GHC.Classes.Eq Hasmin.Types.String.StringType instance GHC.Show.Show Hasmin.Types.String.StringType instance Hasmin.Class.ToText Hasmin.Types.String.StringType instance Hasmin.Class.Minifiable Hasmin.Types.String.StringType -- | Parsers for CSS <string> values. module Hasmin.Parser.String -- | Parse and convert any escaped unicode to its underlying Char. convertEscaped :: Parser Text stringtype :: Parser StringType module Hasmin.Utils epsilon :: Rational eps :: Rational fromLeft' :: Either a b -> a fromRight' :: Either a b -> b mconcatIntersperse :: Monoid b => (a -> b) -> b -> [a] -> b restrict :: Ord a => a -> a -> a -> a textualLength :: ToText a => a -> Int replaceAt :: Int -> a -> [a] -> [a] mzip :: Applicative f => f a -> f b -> f (a, b) reduceTRBL :: Eq a => NonEmpty a -> NonEmpty a -- | CSS Numeric data types: <number>, <percentage>, and -- <alphavalue>. All Rational newtypes to ensure dimension -- conversion precision. module Hasmin.Types.Numeric -- | The <percentage> data type. Many CSS properties can take -- percentage values, often to define sizes in terms of parent objects. -- Percentages are formed by a <number> immediately followed by the -- percentage sign %. There is no space between the % and the -- number. Specification: -- --
-- >>> import Control.Monad.Reader -- -- >>> let t10 = Translate (Right (Length 10 PX)) Nothing -- -- >>> let s45 = Skew (Angle 45 Deg) Nothing -- -- >>> let sx5 = ScaleX 5 -- -- >>> let f x = runReader (combine x) defaultConfig ---- --
-- >>> fmap toText $ f [t10, s45, sx5] -- ["matrix(5,0,1,1,10,0)"] ---- --
-- >>> let tp = Translate (Left (Percentage 100)) Nothing -- -- >>> fmap toText $ f [s45,tp,sx5,sx5,sx5] -- ["skew(45deg)","translate(100%)","scale(125)"] --combine :: [TransformFunction] -> Reader Config [TransformFunction] -- | Simplifies a <transform-function> without converting it to a 4x4 -- matrix, by doing some simple conversions between the different -- functions, or minifying the dimension arguments (<length> and -- <angle> values) simplify :: TransformFunction -> Reader Config TransformFunction instance GHC.Show.Show Hasmin.Types.TransformFunction.TransformFunction instance GHC.Classes.Eq Hasmin.Types.TransformFunction.TransformFunction instance Hasmin.Class.Minifiable Hasmin.Types.TransformFunction.TransformFunction instance Hasmin.Class.ToText Hasmin.Types.TransformFunction.TransformFunction module Hasmin.Types.Position data Position Position :: Maybe PosKeyword -> Maybe PercentageLength -> Maybe PosKeyword -> Maybe PercentageLength -> Position [origin1] :: Position -> Maybe PosKeyword [offset1] :: Position -> Maybe PercentageLength [origin2] :: Position -> Maybe PosKeyword [offset2] :: Position -> Maybe PercentageLength data PosKeyword PosCenter :: PosKeyword PosLeft :: PosKeyword PosRight :: PosKeyword PosTop :: PosKeyword PosBottom :: PosKeyword minifyPosition :: Position -> Position p50 :: Maybe PercentageLength l0 :: Maybe PercentageLength centerpos :: Position instance GHC.Show.Show Hasmin.Types.Position.Position instance GHC.Enum.Bounded Hasmin.Types.Position.PosKeyword instance GHC.Enum.Enum Hasmin.Types.Position.PosKeyword instance GHC.Classes.Eq Hasmin.Types.Position.PosKeyword instance GHC.Show.Show Hasmin.Types.Position.PosKeyword instance Hasmin.Class.Minifiable Hasmin.Types.Position.Position instance Hasmin.Class.ToText Hasmin.Types.Position.Position instance GHC.Classes.Eq Hasmin.Types.Position.Position instance Hasmin.Class.ToText Hasmin.Types.Position.PosKeyword module Hasmin.Types.BgSize -- | CSS <bg-size> data type, used by the -- background-size and background properties. data BgSize Cover :: BgSize Contain :: BgSize BgSize1 :: (Either PercentageLength Auto) -> BgSize BgSize2 :: (Either PercentageLength Auto) -> (Either PercentageLength Auto) -> BgSize -- | The CSS auto keyword. data Auto Auto :: Auto instance GHC.Show.Show Hasmin.Types.BgSize.BgSize instance GHC.Show.Show Hasmin.Types.BgSize.Auto instance GHC.Classes.Eq Hasmin.Types.BgSize.Auto instance GHC.Classes.Eq Hasmin.Types.BgSize.BgSize instance Hasmin.Class.ToText Hasmin.Types.BgSize.BgSize instance Hasmin.Class.Minifiable Hasmin.Types.BgSize.BgSize instance Hasmin.Class.ToText Hasmin.Types.BgSize.Auto -- | Parsers for CSS dimensions, i.e. <length>, <time>, etc. module Hasmin.Parser.Dimension distance :: Parser Length angle :: Parser Angle time :: Parser Time timeConstructorsList :: [(Text, Number -> Time)] angleConstructorsList :: [(Text, Number -> Angle)] distanceConstructorsList :: [(Text, Number -> Length)] dimensionParser :: Map Text (Number -> a) -> a -> Parser a module Hasmin.Parser.PercentageLength percentageLength :: Parser PercentageLength -- | Parsers for CSS values. module Hasmin.Parser.TransformFunction matrix :: Parser TransformFunction matrix3d :: Parser TransformFunction rotate3d :: Parser TransformFunction -- | Parser of scale() function. Assumes "scale(" has been already parsed scale :: Parser TransformFunction scale3d :: Parser TransformFunction skew :: Parser TransformFunction -- | Assumes "translate(" has been already parsed translate :: Parser TransformFunction translate3d :: Parser TransformFunction -- | Parsers for CSS <position> values. module Hasmin.Parser.Position -- | Parser for <position>. position :: Parser Position module Hasmin.Types.Color -- | CSS <color> data type. data Color Named :: Text -> Color mkHex3 :: Char -> Char -> Char -> Color mkHex4 :: Char -> Char -> Char -> Char -> Color mkHex6 :: String -> String -> String -> Color mkHex8 :: String -> String -> String -> String -> Color mkNamed :: Text -> Maybe Color mkHSL :: Int -> Percentage -> Percentage -> Color mkHSLA :: Int -> Percentage -> Percentage -> Alphavalue -> Color mkRGBInt :: Word8 -> Word8 -> Word8 -> Color mkRGBPer :: Percentage -> Percentage -> Percentage -> Color mkRGBAInt :: Word8 -> Word8 -> Word8 -> Alphavalue -> Color mkRGBAPer :: Percentage -> Percentage -> Percentage -> Alphavalue -> Color -- | Pairs of color keywords, and their equivalent hexadecimal value. keywordColors :: [(Text, Color)] minifyColor :: Color -> Color instance GHC.Show.Show Hasmin.Types.Color.Color instance GHC.Classes.Eq Hasmin.Types.Color.Color instance GHC.Classes.Ord Hasmin.Types.Color.Color instance Hasmin.Class.Minifiable Hasmin.Types.Color.Color instance Hasmin.Class.ToText Hasmin.Types.Color.Color module Hasmin.Types.FilterFunction -- | CSS <filter-function> data type. data FilterFunction Blur :: Length -> FilterFunction Brightness :: Amount -> FilterFunction Contrast :: Amount -> FilterFunction Grayscale :: Amount -> FilterFunction Invert :: Amount -> FilterFunction Opacity :: Amount -> FilterFunction Saturate :: Amount -> FilterFunction Sepia :: Amount -> FilterFunction HueRotate :: Angle -> FilterFunction DropShadow :: Length -> Length -> (Maybe Length) -> (Maybe Color) -> FilterFunction minifyPseudoShadow :: (Minifiable b, Minifiable t1, Minifiable t2, Traversable t) => (t2 -> t1 -> Maybe Length -> t b -> b1) -> t2 -> t1 -> Maybe Length -> t b -> Reader Config b1 instance GHC.Show.Show Hasmin.Types.FilterFunction.FilterFunction instance GHC.Classes.Eq Hasmin.Types.FilterFunction.FilterFunction instance Hasmin.Class.ToText Hasmin.Types.FilterFunction.FilterFunction instance Hasmin.Class.Minifiable Hasmin.Types.FilterFunction.FilterFunction -- | Parsers for CSS <color> values. module Hasmin.Parser.Color hex :: Parser Color rgb :: Parser Color rgba :: Parser Color hsl :: Parser Color hsla :: Parser Color -- | Parser for <color>. color :: Parser Color namedColorsParsersMap :: Map Text (Parser Color) colorFunctionsParsers :: [(Text, Parser Color)] functionPar :: Map Text (Parser a) -> Text -> Parser a colorFunctionParser :: Text -> Parser Color module Hasmin.Types.BorderRadius data BorderRadius BorderRadius :: (NonEmpty PercentageLength) -> [PercentageLength] -> BorderRadius isZeroBR :: BorderRadius -> Bool instance GHC.Show.Show Hasmin.Types.BorderRadius.BorderRadius instance GHC.Classes.Eq Hasmin.Types.BorderRadius.BorderRadius instance Hasmin.Class.Minifiable Hasmin.Types.BorderRadius.BorderRadius instance Hasmin.Class.ToText Hasmin.Types.BorderRadius.BorderRadius -- | Parsers for CSS values. module Hasmin.Parser.BorderRadius borderRadius :: Parser BorderRadius module Hasmin.Types.BasicShape -- | CSS <basic-shape> data type. data BasicShape Inset :: (NonEmpty ShapeArg) -> (Maybe BorderRadius) -> BasicShape Circle :: (Maybe ShapeRadius) -> (Maybe Position) -> BasicShape Ellipse :: (AtMost2 ShapeRadius) -> (Maybe Position) -> BasicShape Polygon :: (Maybe FillRule) -> (NonEmpty (ShapeArg, ShapeArg)) -> BasicShape data ShapeRadius SRLength :: Length -> ShapeRadius SRPercentage :: Percentage -> ShapeRadius SRClosestSide :: ShapeRadius SRFarthestSide :: ShapeRadius data AtMost2 a None :: AtMost2 a One :: a -> AtMost2 a Two :: a -> a -> AtMost2 a data FillRule NonZero :: FillRule EvenOdd :: FillRule instance GHC.Show.Show Hasmin.Types.BasicShape.BasicShape instance Data.Traversable.Traversable Hasmin.Types.BasicShape.AtMost2 instance Data.Foldable.Foldable Hasmin.Types.BasicShape.AtMost2 instance GHC.Base.Functor Hasmin.Types.BasicShape.AtMost2 instance GHC.Classes.Eq Hasmin.Types.BasicShape.FillRule instance GHC.Show.Show Hasmin.Types.BasicShape.FillRule instance GHC.Classes.Eq Hasmin.Types.BasicShape.ShapeRadius instance GHC.Show.Show Hasmin.Types.BasicShape.ShapeRadius instance GHC.Show.Show a => GHC.Show.Show (Hasmin.Types.BasicShape.AtMost2 a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Hasmin.Types.BasicShape.AtMost2 a) instance GHC.Classes.Eq Hasmin.Types.BasicShape.BasicShape instance Hasmin.Class.Minifiable Hasmin.Types.BasicShape.BasicShape instance Hasmin.Class.ToText Hasmin.Types.BasicShape.BasicShape instance Hasmin.Class.ToText Hasmin.Types.BasicShape.FillRule instance Hasmin.Class.ToText Hasmin.Types.BasicShape.ShapeRadius module Hasmin.Types.Value -- | A CSS value. data Value Inherit :: Value Initial :: Value Unset :: Value NumberV :: Number -> Value PercentageV :: Percentage -> Value LengthV :: Length -> Value AngleV :: Angle -> Value TimeV :: Time -> Value FrequencyV :: Frequency -> Value ResolutionV :: Resolution -> Value ColorV :: Color -> Value GradientV :: Text -> Gradient -> Value GenericFunc :: Text -> Values -> Value TransformV :: TransformFunction -> Value TimingFuncV :: TimingFunction -> Value FilterV :: FilterFunction -> Value ShadowV :: Shadow -> Value ShadowText :: Length -> Length -> (Maybe Length) -> (Maybe Color) -> Value PositionV :: Position -> Value RepeatStyleV :: RepeatStyle -> Value BorderRadiusV :: BorderRadius -> Value BasicShapeV :: BasicShape -> Value BgSizeV :: BgSize -> Value BgLayer :: Maybe Value -> Maybe Position -> Maybe BgSize -> Maybe RepeatStyle -> Maybe TextV -> Maybe TextV -> Maybe TextV -> Value [_bgimage] :: Value -> Maybe Value [_bgposition] :: Value -> Maybe Position [_bgsize] :: Value -> Maybe BgSize [_bgrepeat] :: Value -> Maybe RepeatStyle [_bgattachment] :: Value -> Maybe TextV [_bgbox1] :: Value -> Maybe TextV [_bgbox2] :: Value -> Maybe TextV FinalBgLayer :: (Maybe Value) -> (Maybe Position) -> (Maybe BgSize) -> (Maybe RepeatStyle) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe Color) -> Value SingleTransition :: Maybe TextV -> Maybe Time -> Maybe TimingFunction -> Maybe Time -> Value [_transitionproperty] :: Value -> Maybe TextV [_time1] :: Value -> Maybe Time [_transitiontimingfunction] :: Value -> Maybe TimingFunction [_time2] :: Value -> Maybe Time SingleAnimation :: (Maybe Time) -> (Maybe TimingFunction) -> (Maybe Time) -> (Maybe Value) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe Value) -> Value FontV :: (Maybe TextV) -> (Maybe TextV) -> (Maybe Value) -> (Maybe TextV) -> Value -> (Maybe Value) -> [Value] -> Value StringV :: StringType -> Value UrlV :: Url -> Value Format :: [StringType] -> Value Local :: (Either Text StringType) -> Value Rect :: Length -> Length -> Length -> Length -> Value -- | Unrecognized text Other :: TextV -> Value data Values Values :: Value -> [(Separator, Value)] -> Values -- | Redefines equality to be case-insensitive, since CSS literal values -- such as "auto", "none", etc. are so. newtype TextV TextV :: Text -> TextV [getText] :: TextV -> Text -- | A value separator. data Separator Space :: Separator Slash :: Separator Comma :: Separator newtype Url Url :: (Either Text StringType) -> Url mkOther :: Text -> Value mkValues :: [Value] -> Values valuesToList :: Values -> [Value] optimizeFontFamily :: Value -> Reader Config Value lowercaseText :: Text -> Reader Config Text instance GHC.Show.Show Hasmin.Types.Value.Value instance GHC.Classes.Eq Hasmin.Types.Value.Value instance GHC.Classes.Eq Hasmin.Types.Value.Values instance GHC.Show.Show Hasmin.Types.Value.Values instance GHC.Classes.Eq Hasmin.Types.Value.Separator instance GHC.Show.Show Hasmin.Types.Value.Separator instance GHC.Show.Show Hasmin.Types.Value.Url instance GHC.Classes.Eq Hasmin.Types.Value.Url instance Data.String.IsString Hasmin.Types.Value.TextV instance GHC.Classes.Ord Hasmin.Types.Value.TextV instance GHC.Show.Show Hasmin.Types.Value.TextV instance Hasmin.Class.ToText Hasmin.Types.Value.Value instance Hasmin.Class.Minifiable Hasmin.Types.Value.Value instance Hasmin.Class.ToText Hasmin.Types.Value.Values instance Hasmin.Class.Minifiable Hasmin.Types.Value.Values instance Hasmin.Class.ToText Hasmin.Types.Value.Separator instance Hasmin.Class.ToText Hasmin.Types.Value.Url instance Hasmin.Class.Minifiable Hasmin.Types.Value.Url instance GHC.Classes.Eq Hasmin.Types.Value.TextV instance Hasmin.Class.ToText Hasmin.Types.Value.TextV module Hasmin.Parser.Selector -- | Parse a list of comma-separated selectors, ignoring whitespace and -- comments. selectors :: Parser [Selector] -- | Parser for CSS complex selectors (see Selector for more -- details). selector :: Parser Selector -- | Parsers for CSS <gradient> values. module Hasmin.Parser.Gradient radialgradient :: Parser Gradient -- | Assumes "linear-gradient(", or one of its prefixed equivalents, has -- been parsed. : [angle|to side-or-corner ,]? -- color-stop [, color-stop]+ lineargradient :: Parser Gradient sideOrCorner :: Parser (Side, Maybe Side) colorStopList :: Parser [ColorStop] colorStop :: Parser ColorStop -- | Parsers for CSS <basic-shape> values. module Hasmin.Parser.BasicShape inset :: Parser BasicShape circle :: Parser BasicShape ellipse :: Parser BasicShape polygon :: Parser BasicShape shapeRadius :: Parser ShapeRadius -- | Parsers for CSS values. module Hasmin.Parser.Value -- | Given a propery name, it returns a specific parser of values for that -- property. Fails if no specific parser is found. valuesFor :: Text -> Parser Values -- | For cases when CSS hacks are used, e.g.: margin-top: 1px \9;. valuesFallback :: Parser Values value :: Parser Value valuesInParens :: Parser Values stringOrUrl :: Parser (Either StringType Url) -- | Parser for <percentage>. percentage :: Parser Percentage -- | Parser for <url>. Assumes "url(" has already -- been parsed. url :: Parser Url stringtype :: Parser StringType stringvalue :: Parser Value -- | Parser for <shadow> values, used in the -- box-shadow property. shadowList :: Parser Values -- | Parser for <single-timing-function>. timingFunction :: Parser TimingFunction -- | Parser for <repeat-style>, used in -- background-repeat and background. repeatStyle :: Parser RepeatStyle -- | Parser for <position>. position :: Parser Position -- | Parser for <color>. color :: Parser Color -- | Parser for <number>. number :: Parser Number -- | Parser for <font-style>, used in the font-style -- and font properties. fontStyle :: Parser Value textualvalue :: Parser Value borderRadius :: Parser BorderRadius instance GHC.Show.Show Hasmin.Parser.Value.FontProperty instance GHC.Classes.Eq Hasmin.Parser.Value.FontProperty module Hasmin.Types.Declaration -- | A CSS <declaration>. data Declaration Declaration :: Text -> Values -> Bool -> Bool -> Declaration -- | Property name of the declaration. [propertyName] :: Declaration -> Text -- | Values used in the declaration. [valueList] :: Declaration -> Values -- | Whether the declaration is "!important" (i.e. ends with it). [isImportant] :: Declaration -> Bool -- | Whether the declaration ends with the "\9" IE hack. [hasIEhack] :: Declaration -> Bool -- | Removes longhand rules overwritten by their shorthand further down in -- the declaration list, and merges shorthand declarations with longhand -- properties later declared. clean :: [Declaration] -> [Declaration] instance GHC.Show.Show Hasmin.Types.Declaration.Declaration instance GHC.Classes.Eq Hasmin.Types.Declaration.Declaration instance Hasmin.Class.ToText Hasmin.Types.Declaration.Declaration instance GHC.Classes.Ord Hasmin.Types.Declaration.Declaration instance Hasmin.Class.Minifiable Hasmin.Types.Declaration.Declaration module Hasmin.Types.Stylesheet data Expression Expression :: Text -> (Maybe Value) -> Expression InvalidExpression :: Text -> Expression -- | Data type for media queries. For the syntax, see media query -- syntax. data MediaQuery -- | First possibility in the grammar MediaQuery1 :: Text -> Text -> [Expression] -> MediaQuery -- | Second possibility in the grammar MediaQuery2 :: [Expression] -> MediaQuery -- | A CSS rule, either a normal style rule, or one of the many possible -- at-rules. data Rule AtCharset :: StringType -> Rule AtImport :: (Either StringType Url) -> [MediaQuery] -> Rule AtNamespace :: Text -> (Either StringType Url) -> Rule AtMedia :: [MediaQuery] -> [Rule] -> Rule AtKeyframes :: VendorPrefix -> Text -> [KeyframeBlock] -> Rule AtSupports :: SupportsCondition -> [Rule] -> Rule AtBlockWithRules :: Text -> [Rule] -> Rule AtBlockWithDec :: Text -> [Declaration] -> Rule StyleRule :: [Selector] -> [Declaration] -> Rule data KeyframeSelector From :: KeyframeSelector To :: KeyframeSelector KFPercentage :: Percentage -> KeyframeSelector data KeyframeBlock KeyframeBlock :: [KeyframeSelector] -> [Declaration] -> KeyframeBlock data SupportsCondition Not :: SupportsCondInParens -> SupportsCondition And :: SupportsCondInParens -> (NonEmpty SupportsCondInParens) -> SupportsCondition Or :: SupportsCondInParens -> (NonEmpty SupportsCondInParens) -> SupportsCondition Parens :: SupportsCondInParens -> SupportsCondition data SupportsCondInParens ParensCond :: SupportsCondition -> SupportsCondInParens ParensDec :: Declaration -> SupportsCondInParens minifyRules :: [Rule] -> Reader Config [Rule] -- | 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). collapse :: [Declaration] -> [Declaration] mergeRules :: [Rule] -> [Rule] instance GHC.Show.Show Hasmin.Types.Stylesheet.Rule instance GHC.Classes.Eq Hasmin.Types.Stylesheet.Rule instance GHC.Show.Show Hasmin.Types.Stylesheet.SupportsCondition instance GHC.Classes.Eq Hasmin.Types.Stylesheet.SupportsCondition instance GHC.Show.Show Hasmin.Types.Stylesheet.SupportsCondInParens instance GHC.Classes.Eq Hasmin.Types.Stylesheet.SupportsCondInParens instance GHC.Show.Show Hasmin.Types.Stylesheet.KeyframeBlock instance GHC.Classes.Eq Hasmin.Types.Stylesheet.KeyframeBlock instance GHC.Show.Show Hasmin.Types.Stylesheet.KeyframeSelector instance GHC.Classes.Eq Hasmin.Types.Stylesheet.KeyframeSelector instance GHC.Classes.Eq Hasmin.Types.Stylesheet.MediaQuery instance GHC.Show.Show Hasmin.Types.Stylesheet.MediaQuery instance GHC.Classes.Eq Hasmin.Types.Stylesheet.Expression instance GHC.Show.Show Hasmin.Types.Stylesheet.Expression instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.Rule instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.Rule instance Hasmin.Class.Minifiable [Hasmin.Types.Stylesheet.Rule] instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.SupportsCondition instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.SupportsCondition instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.SupportsCondInParens instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.SupportsCondInParens instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.KeyframeBlock instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.KeyframeBlock instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.KeyframeSelector instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.KeyframeSelector instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.MediaQuery instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.MediaQuery instance Hasmin.Class.Minifiable [Hasmin.Types.Stylesheet.MediaQuery] instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.Expression instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.Expression module Hasmin.Parser.Internal -- | Parse a stylesheet, starting by the @charset, @import and @namespace -- rules, followed by the list of rules, and ignoring any unneeded -- whitespace and comments. stylesheet :: Parser [Rule] -- | Parser for CSS at-rules (e.g. @keyframes, @media) atRule :: Parser Rule atMedia :: Parser Rule -- | Parses a CSS style rule, e.g. body { padding: 0; } styleRule :: Parser Rule -- | Parser for a CSS rule, which can be either an at-rule (e.g. @charset), -- or a style rule. rule :: Parser Rule -- | Parser for CSS rules (both style rules, and at-rules), which can be -- separated by whitespace or comments. rules :: Parser [Rule] -- | Parser for a declaration, starting by the property name. declaration :: Parser Declaration -- | Parser for a list of declarations, ignoring spaces, comments, and -- empty declarations (e.g. ; ;) declarations :: Parser [Declaration] -- | Parser for CSS complex selectors (see Selector for more -- details). selector :: Parser Selector -- | Parser for a supports_condition, needed by @supports -- rules. supportsCondition :: Parser SupportsCondition -- | Recommended module to use the library. module Hasmin -- | Minify Text CSS, using a default set of configurations (with -- most minification techniques enabled). minifyCSS is equivalent -- to minifyCSSWith defaultConfig. minifyCSS :: Text -> Either String Text -- | Minify Text, based on a Config. To just use a default set of -- configurations (i.e. defaultConfig), use minifyCSS. minifyCSSWith :: Config -> Text -> Either String Text