cl-djula-tailwind

2022-11-07

Tailwind classes for Djula templates

Upstream URL

github.com/rajasegar/cl-djula-tailwind

Author

Rajasegar Chandran

License

MIT
README

1cl-djula-tailwind

https://github.com/rajasegar/cl-djula-tailwind/workflows/CI/badge.svg http://quickdocs.org/badge/cl-djula-tailwind.svg https://img.shields.io/badge/license-MIT-blue.svg

Use TailwindCSS classe in your Djula templates without any JavaScript or Node.js tooling

1.1Usage

Create a new Caveman project
(ql:quickload :caveman2)
(caveman2:make-project #P"~/quicklisp/local-projects/cl-tw-demo")
  • Add cl-djula-tailwind as system dependency
Add a placeholder for the stylesheet in the default template templates/layouts/default.html
<style>{{ tailwind | safe }}</style>

Define a new function called render-stylesheet in src/web.lisp

(defun render-stylesheet (template)
	(setf (getf djula:*default-template-arguments* :tailwind) (cl-djula-tailwind:get-stylesheet template *template-directory*)))

Call this function in your routes with the template name as the argument

(defroute "/" ()
	(render-stylesheet #P"index.html")
  (render #P"index.html"))

1.2Installation

You can install it from quicklisp
(ql:quickload :cl-djula-tailwind)

1.3Author

  • Rajasegar Chandran

1.4Copyright

Copyright (c) 2022 Rajasegar Chandran

Dependencies (5)

  • cl-css
  • cl-minify-css
  • cl-ppcre
  • djula
  • rove

Dependents (0)

    • GitHub
    • Quicklisp