yesod-static-1.5.0: Static file serving subsite for Yesod Web Framework.

Safe HaskellNone
LanguageHaskell98

Yesod.EmbeddedStatic.Css.AbsoluteUrl

Contents

Description

Manipulate CSS urls.

  • Make relative urls absolute (useful when combining assets)

Synopsis

Absolute urls

absoluteUrls :: FilePath -> Generator Source

Equivalent to passing the same string twice to absoluteUrlsAt.

absoluteUrlsAt :: Location -> FilePath -> Generator Source

Equivalent to passing return to absoluteUrlsWith.

absoluteUrlsWith Source

Arguments

:: Location

The location the CSS file should appear in the static subsite

-> FilePath

Path to the CSS file.

-> Maybe (CssGeneration -> IO ByteString)

Another filter function run after this one (for example return . yuiCSS . cssContent) or other CSS filter that runs after this filter.

-> Generator 

Automatically make relative urls absolute

During development, leave CSS as is.

When CSS is organized into a directory structure, it will work properly for individual requests for each file. During production, we want to combine and minify CSS as much as possible. The combination process combines files from different directories, messing up relative urls. This pre-processor makes relative urls absolute

absCssUrlsFileProd Source

Arguments

:: FilePath

Anchor relative urls to here

-> FilePath 
-> IO ByteString 

Anchors relative CSS image urls

absCssUrlsProd Source

Arguments

:: FilePath

Anchor relative urls to here

-> Text 
-> Text