Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Bootstrap 5 documentation #15158

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

Merged
merged 1 commit into from
May 21, 2021

Conversation

ker0x
Copy link
Contributor

@ker0x ker0x commented Mar 26, 2021

This PR introduce documentation for Bootstrap 5 form template

@ker0x ker0x requested a review from xabbuh as a code owner March 26, 2021 18:08
@xabbuh xabbuh added the Waiting Code Merge Docs for features pending to be merged label Mar 27, 2021
@carsonbot carsonbot added this to the next milestone Mar 27, 2021
Copy link
Contributor

@t-richard t-richard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR and the associated feature PR 🙏

Just some minor English errors I spotted.

@ker0x
Copy link
Contributor Author

ker0x commented Mar 28, 2021

Thank you @t-richard for your review !

@javiereguiluz
Copy link
Member

Romain, thanks for this contribution!

We'll need to wait until the code PR is merged ... that will need to wait until Bootstrap 5 is released as stable.

When this happens, we'll need to reevaluate if we add this new doc article or transform the existing "bootstrap4" doc article into a generic article about all Bootstrap versions. We'll probably do that if differences between versions are not many, because that makes things easier for readers. Thanks.

@ker0x ker0x force-pushed the bootstrap-5-documentation branch from e3fac90 to 80c3549 Compare April 22, 2021 17:02
fabpot added a commit to symfony/symfony that referenced this pull request May 6, 2021
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[TwigBridge] Add form templates for Bootstrap 5

| Q             | A
| ------------- | ---
| Branch       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | [#15158](symfony/symfony-docs#15158)

This PR add support for [Bootstrap 5](https://v5.getbootstrap.com/)

* Removal of the `form-group` class as it no longer exists in Bootstrap 5. Instead, row `div` have a `mb-3` class by default that can be override with the `row_attr` option.
* Errors are no longer display inside `label` but after the `widget` (or `help` if present).
* Replace `form-control` with `form-select` in `choice_widget_collapsed` block.
* Replace `form-control` with `form-range` in `form_widget_simple` block when the type is `range`.
* Add `form-control-color` to the `widget` class if type is `color`.
* Replace `small` with `div` element for `help` and also remove the `text-muted` class.
* Update the `percent_widget` and `money_widget` to handle correctly prepend and append elements.
* Drop support for custom file input as it's no longer (or yet ?) supported in Bootstrap 5

[Bootstrap 5 forms overview](https://v5.getbootstrap.com/docs/5.0/forms/overview/)
[Bootstrap 5 migration](https://v5.getbootstrap.com/docs/5.0/migration/)

Here is the result:

![bootstrap_5_layout](https://user-images.githubusercontent.com/5331654/100088569-9e1e9d80-2e50-11eb-88bf-2596e9ae7d28.png)
![bootstrap_5_horizontal_layout](https://user-images.githubusercontent.com/5331654/100088582-a24abb00-2e50-11eb-9b0c-09336c0327cd.png)

Commits
-------

d52d096 [TwigBridge] Add form templates for Bootstrap 5
@xabbuh xabbuh removed the Waiting Code Merge Docs for features pending to be merged label May 7, 2021
@xabbuh xabbuh modified the milestones: next, 5.3 May 7, 2021
@ker0x
Copy link
Contributor Author

ker0x commented May 21, 2021

Hello @javiereguiluz

Now that the code PR has been merged and the release of 5.3 is coming, have you any feed back regarding this PR ?

@javiereguiluz javiereguiluz changed the base branch from 5.4 to 5.3 May 21, 2021 13:22
@javiereguiluz javiereguiluz force-pushed the bootstrap-5-documentation branch from 80c3549 to bcaf46a Compare May 21, 2021 13:23
@javiereguiluz javiereguiluz merged commit a80da4a into symfony:5.3 May 21, 2021
@javiereguiluz
Copy link
Member

Romain, thanks for the ping! After thinking about this, I've merged your PR "as is". There are some differences between Bootstrap 4 and 5, so it might be more clear for the reader to separate them. Thanks!

@ker0x ker0x deleted the bootstrap-5-documentation branch May 21, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants