django-crispy-forms / crispy-tailwind

A Tailwind template pack for django-crispy-forms
MIT License
331 stars 56 forks source link

#Enhancements# Support for Dark mode + Capitalize field label #75

Closed AliMejbar closed 3 years ago

AliMejbar commented 3 years ago

Hello, Since I've just heard about this repository and i'm super enthusiastic about it I thought of two enhancements to it if they're not already planned :

I could work on these if someone would navigate me on how to edit the templates because i read the django-crispy-forms documentation about it and i didn't understand a single word.

smithdc1 commented 3 years ago

Hi @AliMejbar

Sorry for taking a few days to come back to this.

Dark Mode I think dark mode could be interesting, but potentially out of scope. Tailwind is utility first so everyone's take on "dark mode" will be different. None the less I'd be happy to review a patch.

I think this would involve creating a container of classes for the "dark mode", here is the current classes. https://github.com/django-crispy-forms/crispy-tailwind/blob/master/crispy_tailwind/templatetags/tailwind_field.py#L81

We could then allow folk to override the default styles with the packaged dark mode. Folk would then have something like.

form = SampleForm()
form.helper = FormHelper()
form.helper.css_container = dark_mode

Capitalise Would this not be done in folk's forms.py? Not sure that we should be giving an opinion on this? What do you think?

AliMejbar commented 3 years ago

Hi @smithdc1 , I agree with you , if I ever happen to try smth out i'll do a pull request .