How can I customize Bootstrap 5 to have different grid gutters at different breakpoints? I don't want to use the grid spacing utility classes because those would be hard coded all over the place in markup and a pain to change.
It looks like Bootstrap 5 has this variable as the default gutter width across the board:
$grid-gutter-width: 1.5rem;
What I want is something like this (the values are just made up to illustrate the idea):
$grid-gutter-width-sm: 1rem;
$grid-gutter-width-md: 1.5rem;
$grid-gutter-width-lg: 2rem;
$grid-gutter-width-xl: 2.5rem;
This is tricky because the gutter is used to build all the
container*,rowandcol*. You can make a custom map with the gutter widths for each breakpoint, and then iterate the map to re-build the grid at each breakpoint:Bootstrap SASS on Codeply
Note: This is making a lot of extra CSS!