Wagtail with django-tailwind

I am just exploring Wagtail (actually CodeRed CMS) and try to combine that with Tailwind CSS. The modul django-tailwind seems to be handy for that. I was able to install it and it works in general, i. e. changes in template files are recognized and the static/css/dist/styles.css file is rebuild automatically.

But if I change the HTML in the database, let’s say I change the home page and add a class like text-red-600 somewhere, Tailwind obviously does not recognize that something has changed and the class is not added to styles.css.

Did I miss something or is this simply not working (yet)?

This would probably be better as an issue for django-tailwind. Its creator Timo may have some suggestions.

This doesn’t work because Tailwind looks through your text files to find which classes you’ve used. It doesn’t look through your database.

If there’s a limited set of classes you want to allow in your CMS content, it could work to put them in a Python file.