packery icon indicating copy to clipboard operation
packery copied to clipboard

GutterWidth and GutterHeight options

Open MrGrabazu opened this issue 8 years ago • 3 comments

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.

MrGrabazu avatar Jun 09 '16 09:06 MrGrabazu

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.

desandro avatar Jun 10 '16 13:06 desandro

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 avatar Jun 14 '16 06:06 MrGrabazu

@MrGrabazu thanks! I made some changes in #396 so gutter option now can be an array.

mkhazov avatar Aug 09 '16 09:08 mkhazov