-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Add form templates for Bootstrap 5 #39157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_5_layout.html.twig
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_5_layout.html.twig
Outdated
Show resolved
Hide resolved
d0a8fd0
to
b046e30
Compare
I just updated the PR to add support for floating labels and to fix input-groups in the horizontal layout |
Hi, Would it be possible to get it in Symfony 5.2 when Bootstrap 5 is released? Best regards, |
A new form theme is a new feature which means that it cannot go in any already released version. Thus, the earliest version this can be released in is 5.3. |
src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig
Show resolved
Hide resolved
50d8080
to
4491311
Compare
@ker0x it looks like you need to fix a conflict |
@garak yes I will looked into it this week! |
22a02e0
to
fdddda1
Compare
Tests are failing on Appveyor but it seems to be unrelated to my changes 😕 |
PR for documentation is open |
fdddda1
to
b02d979
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your work here :) 👍
src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_5_horizontal_layout.html.twig
Show resolved
Hide resolved
I am new. If I understood correctly the tests were successful and the theme will be available in the next version? 5.3? |
src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_5_horizontal_layout.html.twig
Outdated
Show resolved
Hide resolved
b02d979
to
b605fb3
Compare
@94noni Mostlycode review to see if I've done anything wrong and of course approvals from core members so that it can be merged. If needed, I can bootstrap a basic symfony project if people want to test it localy. @dd2424 It will depend on when bootstrap 5 will be fully released, which should happen very soon and then if this PR is merged. If both are done before 5.3 release, this will be available at this time, otherwise it should wait until 5.4! |
FYI - it looks like bootstrap 5 HAS now been released. But I think we’re too late for 5.3. |
Why it's too late? 5.3 is not released yet |
Bootstrap 5 support in Symfony 5.3 would be great. What can i do to help ? |
b605fb3
to
d52d096
Compare
Thank you @ker0x. |
Will it be available for version 5.3? |
Yes it will - it snuck in past the feature freeze - it's a bit of a special case since we were waiting for Bootstrap 5's release (which came after feature freeze) |
This PR was submitted for the 5.4 branch but it was squashed and merged into the 5.3 branch instead. Discussion ---------- [Form] Bootstrap 5 documentation This PR introduce documentation for [Bootstrap 5 form template](symfony/symfony#39157) Commits ------- bcaf46a [Form] Bootstrap 5 documentation
Thanks @ker0x Just a small hint for <5.3-users: The only thing I've needed to change/remove so far is "label_html" as it was introduced in sf 5.1. So just put the templates into your templates/ folder and configure twig to use it:
|
This PR add support for Bootstrap 5
form-group
class as it no longer exists in Bootstrap 5. Instead, rowdiv
have amb-3
class by default that can be override with therow_attr
option.label
but after thewidget
(orhelp
if present).form-control
withform-select
inchoice_widget_collapsed
block.form-control
withform-range
inform_widget_simple
block when the type isrange
.form-control-color
to thewidget
class if type iscolor
.small
withdiv
element forhelp
and also remove thetext-muted
class.percent_widget
andmoney_widget
to handle correctly prepend and append elements.Bootstrap 5 forms overview
Bootstrap 5 migration
Here is the result: