-- 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 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 where toText = toStrict . toLazyText . toBuilder toBuilder = fromText . toText 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) 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.Show.Show Hasmin.Types.RepeatStyle.RSKeyword instance GHC.Classes.Eq 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.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] -- | 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: -- --
    --
  1. <https://drafts.csswg.org/css-values-3/#percentages CSS -- Value and Units Module Level 3 (§4.3)
  2. -- --
  3. <https://www.w3.org/TR/CSS2/syndata.html#percentage-units -- CSS2.1 (§4.3.3)
  4. --
  5. <https://www.w3.org/TR/CSS1/#percentage-units CSS1 -- (§6.2)
  6. --
newtype Percentage Percentage :: Rational -> Percentage toPercentage :: Real a => a -> Percentage -- | The <number> data type. Real numbers, possibly with a fractional -- component. When written literally, a number is either an integer, or -- zero or more decimal digits followed by a dot (.) followed by one or -- more decimal digits and optionally an exponent composed of "e" or -- E and an integer. It corresponds to the <number-token> -- production in the CSS Syntax Module [CSS3SYN]. As with integers, the -- first character of a number may be immediately preceded by - or + to -- indicate the number’s sign. Specifications: -- --
    --
  1. CSS Values and Units Module Level 3 (§4.2)
  2. --
  3. CSS2.1 (§4.3.1)
  4. --
  5. CSS1 (6 Units)
  6. --
newtype Number Number :: Rational -> Number [getRational] :: Number -> Rational toNumber :: Real a => a -> Number fromNumber :: Fractional a => Number -> a -- | The <alphavalue> data type. Syntactically a <number>. It -- is the uniform opacity setting to be applied across an entire object. -- Any values outside the range 0.0 (fully transparent) to 1.0 (fully -- opaque) are clamped to this range. Specification: -- --
    --
  1. <https://www.w3.org/TR/css3-color/#transparency CSS -- Color Module Level 3 (§3.2)
  2. --
newtype Alphavalue Alphavalue :: Rational -> Alphavalue toAlphavalue :: Real a => a -> Alphavalue mkAlphavalue :: Rational -> Alphavalue instance GHC.Real.RealFrac Hasmin.Types.Numeric.Percentage instance GHC.Real.Real Hasmin.Types.Numeric.Percentage instance GHC.Real.Fractional Hasmin.Types.Numeric.Percentage instance GHC.Num.Num Hasmin.Types.Numeric.Percentage instance GHC.Classes.Ord Hasmin.Types.Numeric.Percentage instance GHC.Show.Show Hasmin.Types.Numeric.Percentage instance GHC.Classes.Eq Hasmin.Types.Numeric.Percentage instance GHC.Real.RealFrac Hasmin.Types.Numeric.Alphavalue instance GHC.Real.Real Hasmin.Types.Numeric.Alphavalue instance GHC.Classes.Ord Hasmin.Types.Numeric.Alphavalue instance GHC.Show.Show Hasmin.Types.Numeric.Alphavalue instance GHC.Classes.Eq Hasmin.Types.Numeric.Alphavalue instance GHC.Real.RealFrac Hasmin.Types.Numeric.Number instance GHC.Real.Real Hasmin.Types.Numeric.Number instance GHC.Real.Fractional Hasmin.Types.Numeric.Number instance GHC.Num.Num Hasmin.Types.Numeric.Number instance GHC.Classes.Ord Hasmin.Types.Numeric.Number instance GHC.Show.Show Hasmin.Types.Numeric.Number instance GHC.Classes.Eq Hasmin.Types.Numeric.Number instance Hasmin.Class.ToText Hasmin.Types.Numeric.Number instance GHC.Num.Num Hasmin.Types.Numeric.Alphavalue instance Hasmin.Class.ToText Hasmin.Types.Numeric.Alphavalue instance GHC.Enum.Bounded Hasmin.Types.Numeric.Alphavalue instance GHC.Real.Fractional Hasmin.Types.Numeric.Alphavalue instance Hasmin.Class.ToText Hasmin.Types.Numeric.Percentage 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 -- | CSS Dimension data types: <length> (distance), <angle>, -- <duration>, <frequency>, and <resolution>. Provides -- conversion of absolute dimensions into other equivalent dimensions. module Hasmin.Types.Dimension -- | The <length> CSS data type data Length Length :: Number -> LengthUnit -> Length NullLength :: Length data LengthUnit IN :: LengthUnit CM :: LengthUnit MM :: LengthUnit Q :: LengthUnit PC :: LengthUnit PT :: LengthUnit PX :: LengthUnit EM :: LengthUnit EX :: LengthUnit CH :: LengthUnit VH :: LengthUnit VW :: LengthUnit VMIN :: LengthUnit VMAX :: LengthUnit REM :: LengthUnit -- | The <angle> CSS data type data Angle Angle :: Number -> AngleUnit -> Angle NullAngle :: Angle data AngleUnit Deg :: AngleUnit Grad :: AngleUnit Rad :: AngleUnit Turn :: AngleUnit -- | The <duration> CSS data type data Duration Duration :: Number -> DurationUnit -> Duration data DurationUnit S :: DurationUnit Ms :: DurationUnit -- | The <frequency> CSS data type data Frequency Frequency :: Number -> FrequencyUnit -> Frequency data FrequencyUnit Hz :: FrequencyUnit Khz :: FrequencyUnit -- | The <resolution> CSS data type data Resolution Resolution :: Number -> ResolutionUnit -> Resolution data ResolutionUnit Dpi :: ResolutionUnit Dpcm :: ResolutionUnit Dppx :: ResolutionUnit toInches :: Number -> LengthUnit -> Number toPixels :: Number -> LengthUnit -> Number toRadians :: Number -> AngleUnit -> Number isRelative :: LengthUnit -> Bool isRelativeLength :: Length -> Bool isZeroLen :: Length -> Bool isZeroAngle :: Angle -> Bool instance GHC.Show.Show Hasmin.Types.Dimension.Resolution instance GHC.Classes.Eq Hasmin.Types.Dimension.ResolutionUnit instance GHC.Show.Show Hasmin.Types.Dimension.ResolutionUnit instance GHC.Show.Show Hasmin.Types.Dimension.Frequency instance GHC.Classes.Eq Hasmin.Types.Dimension.FrequencyUnit instance GHC.Show.Show Hasmin.Types.Dimension.FrequencyUnit instance GHC.Show.Show Hasmin.Types.Dimension.Duration instance GHC.Classes.Eq Hasmin.Types.Dimension.DurationUnit instance GHC.Show.Show Hasmin.Types.Dimension.DurationUnit instance GHC.Show.Show Hasmin.Types.Dimension.Angle instance GHC.Classes.Eq Hasmin.Types.Dimension.AngleUnit instance GHC.Show.Show Hasmin.Types.Dimension.AngleUnit instance GHC.Show.Show Hasmin.Types.Dimension.Length instance GHC.Classes.Eq Hasmin.Types.Dimension.LengthUnit instance GHC.Show.Show Hasmin.Types.Dimension.LengthUnit instance GHC.Classes.Eq Hasmin.Types.Dimension.Length instance Hasmin.Class.Minifiable Hasmin.Types.Dimension.Length instance Hasmin.Class.ToText Hasmin.Types.Dimension.Length instance GHC.Classes.Eq Hasmin.Types.Dimension.Angle instance Hasmin.Class.Minifiable Hasmin.Types.Dimension.Angle instance Hasmin.Class.ToText Hasmin.Types.Dimension.Angle instance GHC.Classes.Eq Hasmin.Types.Dimension.Duration instance Hasmin.Class.Minifiable Hasmin.Types.Dimension.Duration instance Hasmin.Class.ToText Hasmin.Types.Dimension.Duration instance GHC.Classes.Eq Hasmin.Types.Dimension.Frequency instance Hasmin.Class.Minifiable Hasmin.Types.Dimension.Frequency instance Hasmin.Class.ToText Hasmin.Types.Dimension.Frequency instance GHC.Classes.Eq Hasmin.Types.Dimension.Resolution instance Hasmin.Class.Minifiable Hasmin.Types.Dimension.Resolution instance Hasmin.Class.ToText Hasmin.Types.Dimension.Resolution instance Hasmin.Class.ToText Hasmin.Types.Dimension.LengthUnit instance Hasmin.Types.Dimension.Unit Hasmin.Types.Dimension.LengthUnit instance Hasmin.Class.ToText Hasmin.Types.Dimension.AngleUnit instance Hasmin.Types.Dimension.Unit Hasmin.Types.Dimension.AngleUnit instance Hasmin.Class.ToText Hasmin.Types.Dimension.DurationUnit instance Hasmin.Types.Dimension.Unit Hasmin.Types.Dimension.DurationUnit instance Hasmin.Class.ToText Hasmin.Types.Dimension.FrequencyUnit instance Hasmin.Types.Dimension.Unit Hasmin.Types.Dimension.FrequencyUnit instance Hasmin.Class.ToText Hasmin.Types.Dimension.ResolutionUnit instance Hasmin.Types.Dimension.Unit Hasmin.Types.Dimension.ResolutionUnit module Hasmin.Types.FilterFunction -- | CSS <filter-function> data type. data FilterFunction Blur :: Length -> FilterFunction Brightness :: (Either Number Percentage) -> FilterFunction Contrast :: (Either Number Percentage) -> FilterFunction Grayscale :: (Either Number Percentage) -> FilterFunction Invert :: (Either Number Percentage) -> FilterFunction Opacity :: (Either Number Percentage) -> FilterFunction Saturate :: (Either Number Percentage) -> FilterFunction Sepia :: (Either Number Percentage) -> 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 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 Hasmin.Class.ToText 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 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 instance GHC.Show.Show Hasmin.Types.Position.Position instance GHC.Show.Show Hasmin.Types.Position.PosKeyword instance GHC.Classes.Eq Hasmin.Types.Position.PosKeyword instance Hasmin.Class.ToText 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 module Hasmin.Types.TimingFunction -- | CSS <single-transition-timing-function> data type. data TimingFunction CubicBezier :: Number -> Number -> Number -> Number -> TimingFunction Steps :: Int -> (Maybe StepPosition) -> TimingFunction Ease :: TimingFunction EaseIn :: TimingFunction EaseInOut :: TimingFunction EaseOut :: TimingFunction Linear :: TimingFunction StepEnd :: TimingFunction StepStart :: TimingFunction -- | A step position, as used by the step timing function. data StepPosition Start :: StepPosition End :: StepPosition instance GHC.Show.Show Hasmin.Types.TimingFunction.TimingFunction instance GHC.Show.Show Hasmin.Types.TimingFunction.StepPosition instance GHC.Classes.Eq Hasmin.Types.TimingFunction.StepPosition instance GHC.Classes.Eq Hasmin.Types.TimingFunction.TimingFunction instance Hasmin.Class.ToText Hasmin.Types.TimingFunction.StepPosition instance Hasmin.Class.ToText Hasmin.Types.TimingFunction.TimingFunction instance Hasmin.Class.Minifiable Hasmin.Types.TimingFunction.TimingFunction module Hasmin.Types.TransformFunction -- | CSS <transform-function> data type. data TransformFunction Mat :: (Matrix Number) -> TransformFunction Mat3d :: (Matrix Number) -> TransformFunction Perspective :: Length -> TransformFunction Rotate :: Angle -> TransformFunction RotateX :: Angle -> TransformFunction RotateY :: Angle -> TransformFunction RotateZ :: Angle -> TransformFunction Rotate3d :: Number -> Number -> Number -> Angle -> TransformFunction Scale :: Number -> (Maybe Number) -> TransformFunction ScaleX :: Number -> TransformFunction ScaleY :: Number -> TransformFunction ScaleZ :: Number -> TransformFunction Scale3d :: Number -> Number -> Number -> TransformFunction Skew :: Angle -> (Maybe Angle) -> TransformFunction SkewX :: Angle -> TransformFunction SkewY :: Angle -> TransformFunction Translate :: PercentageLength -> (Maybe PercentageLength) -> TransformFunction TranslateX :: PercentageLength -> TransformFunction TranslateY :: PercentageLength -> TransformFunction TranslateZ :: Length -> TransformFunction Translate3d :: PercentageLength -> PercentageLength -> Length -> TransformFunction mkMat :: [Number] -> TransformFunction mkMat3d :: [Number] -> TransformFunction -- | Combines consecutive <transform-functions> whenever -- possible, leaving translate functions that can't be converted to a -- matrix (because they use percentages or relative units) as they are, -- in the position they are in the list (since matrix multiplication -- isn't commutative) Example: -- --
--   >>> 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.Value -- | A CSS value. data Value Inherit :: Value Initial :: Value Unset :: Value NumberV :: Number -> Value PercentageV :: Percentage -> Value LengthV :: Length -> Value AngleV :: Angle -> Value DurationV :: Duration -> 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 BgSizeV :: BgSize -> Value BgLayer :: (Maybe Value) -> (Maybe Position) -> (Maybe BgSize) -> (Maybe RepeatStyle) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe TextV) -> Value FinalBgLayer :: (Maybe Value) -> (Maybe Position) -> (Maybe BgSize) -> (Maybe RepeatStyle) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe TextV) -> (Maybe Color) -> Value SingleTransition :: (Maybe TextV) -> (Maybe Duration) -> (Maybe TimingFunction) -> (Maybe Duration) -> Value SingleAnimation :: (Maybe Duration) -> (Maybe TimingFunction) -> (Maybe Duration) -> (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 GHC.Classes.Eq Hasmin.Types.Value.TextV instance Hasmin.Class.ToText Hasmin.Types.Value.TextV instance Hasmin.Class.ToText Hasmin.Types.Value.Url instance Hasmin.Class.Minifiable Hasmin.Types.Value.Url 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 -- | 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 textualvalue :: Parser Value 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 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.Minifiable Hasmin.Types.Stylesheet.MediaQuery instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.MediaQuery instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.Expression instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.Expression instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.KeyframeSelector instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.KeyframeSelector instance Hasmin.Class.ToText Hasmin.Types.Stylesheet.KeyframeBlock instance Hasmin.Class.Minifiable Hasmin.Types.Stylesheet.KeyframeBlock instance Hasmin.Class.ToText 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.Minifiable [Hasmin.Types.Stylesheet.Rule] 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 -- | 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