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
Although Bootstrap does not need jQuery anymore, it is still possible to use it in Moodle. See MDL-84324 for more information.
671
671
672
672
:::
673
+
674
+
## BS4 backwards-compatibility layer
675
+
676
+
The migration from Bootstrap 4 to Bootstrap 5 involves a transition period to allow third-party plugins to update gradually.
677
+
To facilitate this, a backwards-compatibility layer has been created, ensuring that some Bootstrap 4 syntax will continue to function until final deprecation in Moodle 6.0.
678
+
This approach aims to provide developers with sufficient time to adapt their code to the new Bootstrap 5 framework.
679
+
680
+
The BS4 backwards-compatibility layer encompasses three crucial aspects to facilitate a smooth transition for third-party contributions:
681
+
682
+
1.**Bootstrap jQuery support**: This allows existing plugins and components that rely on jQuery to continue functioning while developers work on updating their code to the new vanilla JavaScript approach.
683
+
2.**SCSS helpers and utilities**: The compatibility layer includes some SCSS helpers and utilities from Bootstrap 4, enabling developers to gradually adapt their custom styles to the new Bootstrap 5.
684
+
3.**Bootstrap 4 old data attributes syntax silent replacement**: This feature quietly replaces the old Bootstrap 4 data attribute syntax with the new Bootstrap 5 syntax, ensuring that existing markup continues to work without immediate changes.
685
+
686
+
### SCSS helpers and utilities
687
+
688
+
<Sinceversion="5.0"issueNumber="MDL-80519" />
689
+
690
+
The compatibility layer includes a selection of SCSS helpers and utilities from Bootstrap 4.
691
+
This provision enables developers to continue using familiar class names and mixins while they work on updating their custom styles to align with Bootstrap 5's new utility API system and class structure.
692
+
693
+
Some of the SCSS helpers and utilities available in the backwards-compatibility layer include:
694
+
695
+
-`.media` component
696
+
- Coloured badges using `.badge-success`, `badge-warning`, ... classes
697
+
- Inline forms using `.form-inline` class
698
+
- Spacing utilities like `.mr-1`, `.pl-2`, ...
699
+
-`.sr-only` and `.sr-only-focusable` classes
700
+
- Font utilities like `.font-weight-bold`, `.font-italic`, ...
701
+
- Custom controls in forms using `.custom-radio`, `.custom-switch`, ...
702
+
703
+
All these backwards-compatible SCSS helpers and utilities will be available until the final deprecation in Moodle 6.0.
704
+
More details about the SCSS deprecation process can be found in [SCSS deprecation](/general/development/policies/deprecation/scss-deprecation).
0 commit comments