2022-02-05
How to use Tailwind CSS 3 with Django templates
Usage
jstoolchain/tailwind.config.js
jstoolchain/css/tailwind.css
jstoolchain/package.json
jstoolchain/
templates/base.html
Now you can use tailwind css inside django templates, but you need to go through the build process (npm run build
from above) each time new tailwind css was introduced.
In order to automate this build process, add following dev
script to the package.json
jstoolchain/package.json
jstoolchain/
Any changes in *.html files in django templates directory can trigger build script and changes will be applied without manually typing npm run build