@@ -0,0 +1,18 @@
1+module Text.Hakyll.CompressCSS
7+-- | Compress CSS to speed up your site.
8+compressCSS :: String -> String
9+compressCSS = stripComments
11+-- | Function that strips CSS comments away.
12+stripComments :: String -> String
14+stripComments str | isPrefixOf "/*" str = stripComments $ eatComments $ drop 2 str
15+ | otherwise = (head str) : (stripComments $ tail str)
16+ where eatComments str' | null str' = []
17+ | isPrefixOf "*/" str' = drop 2 str'
18+ | otherwise = eatComments $ tail str'