django-crispy-forms / crispy-bootstrap5

Bootstrap5 template pack for django-crispy-forms
MIT License
462 stars 76 forks source link

Unnecessary pt-0 class on labels in form-horizontal forms #173

Closed philgyford closed 6 months ago

philgyford commented 6 months ago

I noticed that the labels in my .form-horizontal form weren't lining up with the text in the fields, but were slightly higher:

Screenshot 2024-04-14 at 18 52 37

It looks like this line is adding a pt-0 class to each label if the form is a form-horizontal form. If I remove that then the labels and input field text line up.

The docs for Horizontal Forms in Bootstrap 5 only show a pt-0 added to the label for the Radio buttons shown below it.

marc-gist commented 6 months ago

Interesting, never noticed. Tried removing, i don't like the placement of the label after removing. Yes, I agree, its more in-line and 'horizontal' has the form type suggests. you could simply override the template for horizontal forms. Would be nice if it was an option like the column sizes are.

smithdc1 commented 6 months ago

Thanks for the discussion and the input. 🎁

It seems to me that there's not concensus on this. Given the escape hatch of being able to override templates is available I'd suggest that's the best solution here.