I was trying to use tailwindcss plugins tailwindcss-forms to style comment forms produced by django comments framework.
tailwindcs-forms requires tailwind styling class to be applied on <input type=""> level.
However, in django comments framework, the HTML template file (form.html for example) has no access to <input type="">, which is automatically produced during template rendering process via template variables such as {{ form.comment }}.
What should I do with this dilemma? whether styling forms produced by django comments framework using tailwindcss-forms is really possible?
You can render the fields individually. For the comment field it can be given as following :
The class attribute can then be added to the field to perform tailwind styling. Similarly the remaining fields needs to be considered.
It should be noted that there are anti-spam attributes present in the form which should be considered while using custom template : https://django-contrib-comments.readthedocs.io/en/latest/quickstart.html?#notes-on-the-comment-form
Also refer : https://django-contrib-comments.readthedocs.io/en/latest/quickstart.html?#rendering-a-custom-comment-form