Tailwind forms styling not applied correctly
See original GitHub issueHi
I’ve installed tailwind, crispy_forms & crispy_tailwind but the form styling doesn’t seem to be working and I get huge SVG arrow appearing underneath.
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tailwind',
'theme',
'crispy_forms',
'crispy_tailwind',
'accs',
'user',
]
...
CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"
CRISPY_TEMPLATE_PACK = "tailwind"
...
my_form_template.html
{% extends 'core/base.html' %}
{% load tailwind_filters %}
{% block content %}
<div class="container mx-auto">
<h2 class="text-lg text-gray-900 font-bold text-xl pt-4">Edit Payee</h2>
<hr class="pt-4 border-gray-900">
</div>
<form action="" method="post">{% csrf_token %}
{{ form|crispy }}
<input class="text-base bg-transparent hover:bg-blue-400 text-blue-400 font-semibold hover:text-white py-2 px-4 border border-blue-400 hover:border-transparent rounded" type="submit" value="Update">
</form>
{% endblock content %}
I’ve tried with/without the form tags and with/without {% load crispy_forms_tags %}
- neither have any effect.
Any ideas what I’m missing?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
tailwind form not positioning properly as fixed element
I'm using tailwind css to style a ...
Read more >How to Style a Form With Tailwind CSS
For example, applying a class like .text-center to an element means that we're setting its text-align property to center . Simple enough, right?...
Read more >Styling Forms with Tailwind CSS - YouTube
In this video, we look at how to style form elements in Tailwind CSS using utility classes, and how the official `@tailwindcss/ forms...
Read more >Debugging Tailwind CSS and Next.js - LogRocket Blog
Not having the Tailwind directives in the main CSS file · Not assigning the CSS classes correctly to the elements · Using the...
Read more >Browser Support - Tailwind CSS
If you're using the Tailwind CLI tool, vendor prefixes like this will be added automatically. If not, we recommend that you use Autoprefixer,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem. Fixed it by overriding the
crispy_tailwind/templates/tailwind/layout/select.html
file as following -This new file will need to be saved at
templates/tailwind/layout/select.html
file. Here I have just removed thediv
containing the svg icon for the dropdown.The following is the original code from
crispy_tailwind/templates/tailwind/layout/select.html
file -Also, the following should be in your template settings.
After tinkering around with the issue, I think this should be the solution. The issue is not with crispy-tailwind. The issue is coming form the form styling of django-tailwind.
This tailwind.config.js file resides in theme/static_src directory.