With #22940 I unshipped the Sass map and code used to loop over those values. It generated the wrong code and isn't the approach I'd like to use moving forward. Looking at .no-gutters, I think this is the method I'd like to use鈥攎odifier classes on the row that can be customized by breakpoint.
Very Right decision @mdo... Best of luck in your progress dude :+1:
Sorry for asking, but is this option will be available in the final release?
BTW keep up the good work!
Otherwise, please explain how to add custom gutters for mobile devices.
I was searching for a way to have 5px gutter on mobile, 15 on tablet and 30 on desktop (just an example).
What is the right way foreward?
@x-christian-romeni I made a seperate scss file with custom gutters, but not tested it, so it might brake something. Not sure if it will work, maybe there was a good reason why this feature has been unshipped
$my-gutters: (
xs: 5px,
sm: 5px,
md: 15px,
lg: 30px
);
.row.custom-gutter {
@media (min-width: map-get($grid-breakpoints, lg)) {
margin-left: map-get($my-gutters, lg) *(-1);
margin-right: map-get($my-gutters, lg) *(-1);
}
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, lg) - 1px) {
margin-left: map-get($my-gutters, md) *(-1);
margin-right: map-get($my-gutters, md) *(-1);
}
margin-left: map-get($my-gutters, sm) *(-1);
margin-right: map-get($my-gutters, sm) *(-1);
}
[class^='col'].custom-gutter,
[class*=' col'].custom-gutter {
@media (min-width: map-get($grid-breakpoints, lg)) {
padding-left: map-get($my-gutters, lg);
padding-right: map-get($my-gutters, lg);
}
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, lg) - 1px) {
padding-left: map-get($my-gutters, md);
padding-right: map-get($my-gutters, md);
}
padding-left: map-get($my-gutters, sm);
padding-right: map-get($my-gutters, sm);
}
@Tyutyesz It was removed because the file size was getting too large.
@myorangeca Now I understand! Thanks!
Hi all, thanks for this.
Totally understand it's been removed, however it's still in the documentation. I spent ages trying to work out what the hell was going on!
https://v4-alpha.getbootstrap.com/layout/grid/
Could we remove it? Happy to do it myself if that helps?
Cheers,
Paul
@pauldcollins If i'm understand it correctly, then it is in the Alpha documentation, what you are reading. For the Beta, click here.
Hi @Tyutyesz - my bad, thanks for pointing that out!
any news on this?
would really want this in bs4.
It's also still in the documentation: https://getbootstrap.com/docs/4.0/layout/grid/#columns-and-gutters
...while $grid-gutter-width allows breakpoint-specific widths that are divided evenly across padding-left and padding-right for the column gutters.
@aubricus I'm sorry, but I still don't get how you could achieve breakpoint-specific gutter widths?
@ahennie
I wasn't indicating that you could. In fact, as far as I can tell it's no longer possible.
The current documentation needs to be updated to reflect that.
Can someone please update the docs if this is not implemented? I went down a rabbit hole today trying to get this to work :(
Coming back to this for v4.2 with #26825.