Open yohny opened 4 years ago
I hope that one day it just works and while I suspect many users may already a workaround, as someone coming at this fresh a few years later for visibility's sake, here is a work around for now:
From desandro's example: https://codepen.io/desandro/pen/nGLvx
isFitWidth: true
or fitWidth: true,
in latest version needs to be setcolumnWidth
needs to match the css width of your grid item.grid-wrapper
element, wrapping .grid
max-width
or width
properties are set on .grid
, but margin: 0 auto;
is (as per desandero's example).grid-wrapper {
max-width: 1200px;
width: 100%;
margin: 0 auto;
}
Currently the behavior of
fitWidth:true
option is to adjust the width of container to maximize the number of columns in container. The adjusted width is limited only by the available width of container's parent. This allows to center container usingauto
margin. It would be nice iffitWidth:true
option also respected the container'smax-width
setting. so if the container hasmax-width:90%
then the adjusted width would not exceed that, even if there is more room in the parent.