You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is still in its early stages of development. Any contributions to
the package would be very welcomed.
Currently the template pack allows the use of the |crispy filter to style
your form. Here is an example image.
How to install
Install via pip.
pip install crispy-tailwind
You will need to update your project's settings file to add crispy_forms
and crispy_tailwind to your project's INSTALLED_APPS setting. Also set
tailwind as an allowed template pack and as the default template pack
for your project:
The template pack includes default styles for widgets included in Django
itself. Styling of widget instances can be done by using the widget.attrs
argument when creating the widget.
For example the following form will render
<input type="text" name="name" class="customtextwidget custom-css" required id="id_name">:
class CustomTextWidget(forms.TextInput):
pass
class CustomTextWidgetForm(forms.Form):
name = forms.CharField(
widget=CustomTextWidget(attrs={"class": "custom-css"})
)