
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black
A Tailwind CSS
_ template pack for the wonderful django-crispy-forms_.
WARNING
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.
.. image:: https://django-crispy-forms.github.io/crispy-tailwind/_images/crispy_form.png
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::
INSTALLED_APPS = (
...
"crispy_forms",
"crispy_tailwind",
...
)
CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"
CRISPY_TEMPLATE_PACK = "tailwind"
This project is still in its early stages.
Current functionality allows the |crispy
filter to be used to style your
form. In your template:
{% load tailwind_filters %}
{{ form|crispy }}
We can also use the {% crispy %}
tag to allow usage of crispy-forms'
FormHelper
and Layout
. In your template:
{% load crispy_forms_tags %}
FormHelper
to your form and use crispy-forms to set-up your form{% crispy form %}
in your templateThe documentation for this project is available here: https://django-crispy-forms.github.io/crispy-tailwind/index.html
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"})
)
.. _Styling of widget instances
: https://docs.djangoproject.com/en/dev/ref/forms/widgets/#styling-widget-instances
.. _Tailwind CSS: https://tailwindcss.com/
.. _django-crispy-forms: https://github.com/django-crispy-forms/django-crispy-forms
FAQs
Tailwind CSS for Django Crispy Forms
We found that crispy-tailwind demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.