Skip to content

Commit 9812630

Browse files
authored
Merge pull request #1035 from roland04/devdocs-bootstrap-nogutters
[docs] Documentation for MDL-81818
2 parents 8ce8449 + 31d47d6 commit 9812630

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/guides/bs5migration/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,49 @@ The `.card-deck` helper class has been replaced with utility classes.
202202
```
203203

204204
</ValidExample>
205+
206+
## Create a BS5 "bridge"
207+
208+
<Since version="4.5" issueNumber="MDL-79917" />
209+
210+
Some simple breaking changes could be also addressed in advance creating a BS5 "bridge". With small additions to this "bridge", we can refactor in advance the occurrences in the codebase for some dropped or changed features in BS5.
211+
212+
A new SCSS file `bs5-bridge.scss` has been created in the `theme/boost/scss/moodle` folder. This file will contain the necessary changes to make the codebase compatible with Bootstrap 5.
213+
214+
:::info Example of a bridge in `bs5-bridge.scss`
215+
216+
```css
217+
/* In Bootstrap 5 the .no-gutters class has been replaced with .g-0, so we can
218+
add a new class in the bridge file to make the codebase compatible with BS5. */
219+
.g-0 {
220+
@extend .no-gutters;
221+
}
222+
```
223+
224+
:::
225+
226+
### No gutters
227+
228+
The `.no-gutters` grid class has been replaced with `.g-0`.
229+
230+
<InvalidExample title="Don't">
231+
232+
```html
233+
<div class="row no-gutters">
234+
<div class="col-6">[...]</div>
235+
<div class="col-6">[...]</div>
236+
</div>
237+
```
238+
239+
</InvalidExample>
240+
241+
<ValidExample title="Do">
242+
243+
```html
244+
<div class="row g-0">
245+
<div class="col-6">[...]</div>
246+
<div class="col-6">[...]</div>
247+
</div>
248+
```
249+
250+
</ValidExample>

0 commit comments

Comments
 (0)