packery
packery copied to clipboard
GutterWidth and GutterHeight options
I add the support of gutterWidth
and gutterHeight
options.
If gutter
option is provided so it will be dispatched to gutterWidth
and gutterHeight
.
If a class name is provided, I set the width
css property value to gutterWidth
option and height
css property value to gutterHeight
option.
Tell me what do you think about it.
Thanks so much for this contribution! This is tremendous work. But I'm a bit particular about the implementation. Having gutter
, gutterWidth
and gutterHeight
may be confusing. I think being able to set gutterWidth and gutterHeight via an array would be more flexible
// single value for both gutterWidth and gutterHeight
gutter: 20
// use width of element for width and height (to maintain backwards compatibility)
gutter: '.gutter-sizer'
// separate values for width and height, set as array
gutter: [ 20, 10 ]
// element width for width, element height for height
gutter: [ '.gutter-sizer', '.gutter-sizer' ]
I appreciate all the word you did here. This issue has gained enough interest that this PR would make a great addition.
Yeah an array is a better idea :) and more flexible indeed ! I will use it in my fork, and add it to this pull request. Thank you for your support !
@MrGrabazu thanks!
I made some changes in #396 so gutter
option now can be an array.