Documentation
¶
Overview ¶
Package twfiles implements tailwind.Dist against a filesystem. Implementations are provided against the OS filesystem and for net/http.FileSystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPFiles ¶
type HTTPFiles struct {
http.FileSystem // underlying http FileSystem
NameMapFunc func(name string) string // name conversion func, default returns name+".css"
}
HTTPFiles implements tailwind.Dist against a net/http.FileSystem. By default the file name mapings are the name of the tailwind section plus ".css", e.g. "base.css", "utilities.css", "components.css".
func New ¶
New returns a tailwind.Dist instance that reads from the underlying OS directory you provide. Implementation is done via net/http Filesystem.
func NewHTTP ¶
func NewHTTP(fs http.FileSystem) *HTTPFiles
NewHTTP returns an HTTP file instance which reads from the underlying net/http.Filesystem. Files are mapped by default so e.g. requests for "base" look for "base.css".