-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35141 from dimagi/jls/update-bootstrap-docs
Updates to bootstrap docs and migration tool
- Loading branch information
Showing
31 changed files
with
127 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
corehq/apps/hqwebapp/utils/bootstrap/changes_guide/css-file-inputs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Please add the form-control class to this input. | ||
|
||
In Bootstrap 3, `form-control` added a border and shadow that looked weird with file inputs. | ||
In Bootstrap5, `form-control` is appropriate for file inputs. |
10 changes: 10 additions & 0 deletions
10
corehq/apps/hqwebapp/utils/bootstrap/changes_guide/css-form-group.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
`form-group` has been dropped. Use grid utilities instead. | ||
|
||
Since we are opting for vertical forms (where the label is directly above the field), take the following actions: | ||
* Remove the `div` wrapper from the `form-group`'s first child, which contains the field's label. | ||
* Remove the column classes (`col-lg-2`, etc.) from the `form-group`'s first child, usually a `<label>`, | ||
which contains the field's label. Most often, this will leave the label with just the `form-label` class. | ||
* Remove the column classes (`col-lg-2`, etc.) from the `form-group`'s second child, which contains the field | ||
control (the actual input, which will often use the `form-control` class). Frequently, this will leave the `<div>` | ||
without any other classes. If so, and if it has no other attributes, it can be removed. | ||
* Replace `form-group` with `mb-3`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
corehq/apps/hqwebapp/utils/bootstrap/changes_guide/css-select-form-control.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Please replace `form-control` with `form-select`. | ||
|
||
In Bootstrap 3, selects used the `form-control` class. | ||
In Bootstrap5, selects use `form-select` instead. |
File renamed without changes.
7 changes: 0 additions & 7 deletions
7
corehq/apps/hqwebapp/utils/bootstrap/changes_guide/form-group.md
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
corehq/apps/hqwebapp/utils/bootstrap/changes_guide/inline-style.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This template uses inline styles. Please revisit this usage. | ||
|
||
Inline styles are not best practice. While replacing them is not strictly necessary for this migration, | ||
Bootstrap 5 includes a host of utility classes that can replace a lot of the imline style usage in HQ. | ||
|
||
Some common replacements: | ||
* Display styles like `display: none` can be replaced with classes like `d-none`. See https://getbootstrap.com/docs/5.0/utilities/display/ | ||
* Spacing styles like `margin-bottom: 10px` can be replaced with classes like `mb-3`. See https://getbootstrap.com/docs/5.0/utilities/spacing/ | ||
* Text alignment styles like `text-align: right` can be replaced with classes like `text-end`. See https://getbootstrap.com/docs/5.0/utilities/text/ | ||
* Usages of the `em` unit should be updated to use the `rem` unit | ||
* Layouts achieved using inline styling can sometimes be replaced with usage of flex. See https://getbootstrap.com/docs/5.0/utilities/flex/ | ||
|
||
See all of Bootstrap 5's utility classes: https://getbootstrap.com/docs/5.0/utilities/ |
Oops, something went wrong.