Question: retrocompatibility with spacing from Bootstrap 4 #34320
-
I noticed on my site that migrating from B4 to 5 moved everything a bit, playing and comparing the code I can revert that by using the following code (at the end), but I wonder can the new default be made so that resembles the exact position of elements without using retro code? and how wise is to use this snippet in terms of good practices? Edit : most likely I should adjust the values of the variables to match the old behavior instead? I apologize for the ignorance. This is the code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That snippet is fine. The main reason we migrated our spacing is alignment with our own utilities—so |
Beta Was this translation helpful? Give feedback.
-
Thank you for explaining :)
Understood more consistent behavior.
Question if I want to do that can I just change the variable in css to $grid-gutter-width: 30px; |
Beta Was this translation helpful? Give feedback.
That snippet is fine. The main reason we migrated our spacing is alignment with our own utilities—so
.gx-3
is the same as.mx-3
, and the default grid spacing can be restored or modified with ease. Previously this wasn't possible with Bootstrap 4, so changing back to that will remove that capability unless you modify the utilities as well.