tsweb-0.1.2: An API binding Web.Spock to Database.Beam

Safe HaskellNone
LanguageHaskell2010

TsWeb.Routing.Clay

Description

This defines a helper function, clay, which will serve a Css instance from a labeled URL prefix.

Synopsis

Documentation

clay Source #

Arguments

:: (KeyDoesNotExist l lts, RecCopy lts lts (Sort ((l := Path '[] Open) ': lts)), KnownNat (RecSize lts), KnownNat ((RecSize (Sort ((l := Path '[] Open) ': lts)) - RecTyIdxH 0 l (Sort ((l := Path '[] Open) ': lts))) - 1), KnownSymbol l) 
=> FldProxy l

Label to access this stylesheet

-> String

Base URL for this sheet

-> Css

Css instance to serve

-> (ReadWritePool, Rec lts, TsSpockCtxT lts0 xs sess ()) 
-> (ReadWritePool, Record ((l := Path '[] Open) ': lts), TsSpockCtxT lts0 xs sess ()) 

Serve a Css instance. The rendered CSS will be served from a .css file whose name is derived from the rendered sheet's contents. This has two results: changing the stylesheet will change the sheet's full URL, and the stylesheet really needs to be referenced by label, using something like showPath. The first one of those is actually really nice, since browsers are so aggressive about caching css. The second one is more convenient anyhow, so this function is just pretty nice.