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
+41
Original file line number
Diff line number
Diff line change
@@ -723,3 +723,44 @@ Some of the SCSS helpers and utilities available in the backwards-compatibility
723
723
724
724
All these backwards-compatible SCSS helpers and utilities will be available until the final deprecation in Moodle 6.0.
725
725
More details about the SCSS deprecation process can be found in [SCSS deprecation](/general/development/policies/deprecation/scss-deprecation).
726
+
727
+
### Bootstrap 4 old data attributes syntax silent replacement
728
+
729
+
<Sinceversion="5.0"issueNumber="MDL-84450" />
730
+
731
+
To minimize immediate breaking changes, the backwards-compatibility layer implements a silent replacement mechanism for Bootstrap 4's data attribute syntax.
732
+
733
+
As per Bootstrap's migration guide "*Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. For example, we use `data-bs-toggle` instead of `data-toggle`.*"
734
+
735
+
This feature can be used to translate old data attributes to their Bootstrap 5 equivalents, allowing existing markup to function without requiring immediate updates.
736
+
737
+
```js title="Example of bs4-compat silent replacement in amd module"
This will replace for example `data-toggle="tooltip"` with `data-bs-toggle="tooltip"`, or `data-target="#collapsableContent"` with `data-bs-target="#collapsableContent"`.
761
+
762
+
:::warning
763
+
764
+
Dynamic generated content containing old data attributes syntax will not be replaced.
0 commit comments