You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/guides/bs5migration/index.md
+198
Original file line number
Diff line number
Diff line change
@@ -472,3 +472,201 @@ The `.font-italic` class has been replaced with `.fst-italic` for brevity and co
472
472
```
473
473
474
474
</ValidExample>
475
+
476
+
## Bootstrap 5 upgrade
477
+
478
+
<Since version="5.0" issueNumber="MDL-75669" />
479
+
480
+
After **Refactoring BS4 features dropped in BS5** and **Create a BS5 "bridge"**, the remaining Bootstrap breaking changes will be addressed in the upgrade to Bootstrap 5.
481
+
482
+
The `bs5-bridge.scss` SCSS file will be removed as it will no longer be needed, and the Bootstrap library in theme_boost will be upgraded to version 5.3. After that the codebase will be fully compatible with Bootstrap 5.
483
+
484
+
### Refactor dropdowns positioning classes
485
+
486
+
Replace `.dropdown-menu-[left|right]` with `.dropdown-menu-[start|end]`.
487
+
488
+
<InvalidExample title="Don't">
489
+
490
+
```html
491
+
<div class="dropdown-menudropdown-menu-right">
492
+
[...]
493
+
</div>
494
+
```
495
+
496
+
</InvalidExample>
497
+
498
+
<ValidExample title="Do">
499
+
500
+
```html
501
+
<div class="dropdown-menudropdown-menu-end">
502
+
[...]
503
+
</div>
504
+
```
505
+
506
+
</ValidExample>
507
+
508
+
### Refactor custom form elements
509
+
510
+
- `.custom-check` is now `.form-check`.
511
+
- `.custom-check.custom-switch` is now `.form-check.form-switch`.
512
+
- `.custom-select` is now `.form-select`.
513
+
- `.custom-file` and `.form-file` have been replaced by custom styles on top of `.form-control`.
514
+
- `.custom-range` is now `.form-range`.
515
+
- Dropped `.input-group-append` and `.input-group-prepend`. You can now just add buttons and `.input-group-text` as direct children of the input groups.
- `media-breakpoint-down()` uses the breakpoint itself instead of the next breakpoint (e.g., `media-breakpoint-down(lg)` instead of `media-breakpoint-down(md)` targets viewports smaller than lg).
554
+
- In `media-breakpoint-between()` the second parameter also uses the breakpoint itself instead of the next breakpoint (e.g., `media-breakpoint-between(sm, lg)` instead of `media-breakpoint-between(sm, md)` targets viewports between sm and lg).
555
+
556
+
<InvalidExample title="Don't">
557
+
558
+
```css
559
+
// This will target viewports smaller than md.
560
+
@include media-breakpoint-down(sm) {
561
+
[...]
562
+
}
563
+
```
564
+
565
+
</InvalidExample>
566
+
567
+
<ValidExample title="Do">
568
+
569
+
```css
570
+
// This will target viewports smaller than md.
571
+
@include media-breakpoint-down(md) {
572
+
[...]
573
+
}
574
+
```
575
+
576
+
</ValidExample>
577
+
578
+
### Refactor BS5 data attributes
579
+
580
+
Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from our own code.
Bootstrap dropped jQuery dependency and rewrote plugins to be in regular JavaScript. This means that all the jQuery Bootstrap-related code in the Moodle codebase has been rewritten in vanilla JavaScript.
0 commit comments