Problem/Motivation
no-gutters was removed from Bootstrap 5
https://getbootstrap.com/docs/5.0/layout/gutters/#no-gutters
https://github.com/twbs/bootstrap/blob/v5.1.3/dist/css/bootstrap.css
But it was in Bootstrap 4
https://github.com/twbs/bootstrap/blob/v4.6.1/dist/css/bootstrap.css#L588
rajab@vardot-dev:/var/www/html/products$ grep -rl --exclude-dir={node_modules,bower_components} "no-gutters" .
./bootstrap_layout_builder/templates/blb-section.html.twig
./bootstrap_layout_builder/src/Plugin/Layout/BootstrapLayout.php
./varbase_layout_builder/templates/vlb-section.html.twig
./vartheme_bs4/VARTHEME_BS4_SUBTHEME/css/base/bootstrap.base.css
./vartheme_bs4/css/base/bootstrap.base.css
#3246862: Remove "px-md-0" from items in Varbase Blog views
In Bootstrap 5 final computed css.
.g-0,
.gx-0 {
padding-right: 0;
padding-left: 0;
}
.g-0,
.gy-0 {
padding-top: 0;
padding-bottom: 0;
}
In Bootstrap 5 base
.g-0,
.gx-0 {
--bs-gutter-x: 0;
}
.g-0,
.gy-0 {
--bs-gutter-y: 0;
}
But no > [class*="col-"] as in Bootstrap 4
.no-gutters {
margin-right: 0;
margin-left: 0;
}
.no-gutters > .col,
.no-gutters > [class*="col-"] {
padding-right: 0;
padding-left: 0;
}
Proposed resolution
Change to no-gutters gx-0 to support both Bootstrap 5 and Bootstrap 4
And remove the logic of gutters_between_on with gx-0
Remaining tasks
- ✅ File an issue about this project
- ✅ Change from
no-gutterstono-gutters g-0 - ✅ Testing to ensure no regression
- ❌ Automated unit/functional testing coverage
- ❌ Developer Documentation support on feature change/addition
- ❌ User Guide Documentation support on feature change/addition
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ❌ Release
User interface changes
The Edit layout and the front-end changes
Edit layout - keep gutters between columns
Test keep gutters between columns
Test keep gutters between columns with Bootstrap grid
Edit layout - NO gutters between columns
Test No gutters between columns
Test NO gutters between columns with Bootstrap grid
API changes
- N/A
Data model changes
- N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | test-bootstrap5-g-0----and----bootstrap4--no-getters.zip | 299.64 KB | rajab natshah |
| #5 | test-no-gutters-bootstrap5--grid.png | 3.74 MB | rajab natshah |
| #5 | test-no-gutters-bootstrap5.png | 13.36 MB | rajab natshah |
| #5 | test-no-gutters-bootstrap4--grid.png | 3.19 MB | rajab natshah |
| #5 | test-no-gutters-bootstrap4.png | 11.82 MB | rajab natshah |






Comments
Comment #3
rajab natshahNo gutters equivalents are not working will in Bootstrap 5
https://getbootstrap.com/docs/5.0/layout/gutters/#no-gutters
Same: their example is not working too in a real case
In Bootstrap 5 final computed css.
In Bootstrap 5 base
But no
> [class*="col-"]as in Bootstrap 4Comment #4
rajab natshah-
Comment #5
rajab natshahTest bootstrap 4 and no gutters
Test bootstrap 5 and no gutters
Comment #6
rajab natshahComment #7
rajab natshahChanged to
no-gutters g-0to support both Bootstrap 5 and Bootstrap 4Comment #8
rajab natshahComment #10
rajab natshahComment #11
rajab natshahComment #12
rajab natshahChanged to
no-gutters gx-0to support both Bootstrap 5 and Bootstrap 4And removed the logic of
gutters_between_onwithgx-0Comment #13
rajab natshahComment #15
rajab natshahComment #16
rajab natshahComment #17
rajab natshahComment #19
rajab natshahComment #20
rajab natshahComment #21
rajab natshah