Juicy / juicy-tile-grid

Masonry-like Custom Element for sortable tiles that packs efficiently without changing HTML structure (changes CSS only), and adapts it to CSS Grid Layout. Extended renderer for juicy-tile-list.
http://juicy.github.io/juicy-tile-grid/
MIT License
8 stars 1 forks source link

Size 0 #18

Open tomalec opened 9 years ago

tomalec commented 9 years ago

There are few questions, without clear, stated and documented answer:

  1. Should we support packing tiles with 0 given as size?
  2. If so, should we do it in some other way than currently?
  3. If no, should we block it, silently ignore, throw an error, show warning,...?
  4. Should we support conditionally visible tiles? (dependent on their content, or DOM property, not on the pre-configured JSON setup, like .hidden)
  5. If so, how should it work, how should gutter work, how should we mach setup node to the tile?

Related issues:


Current implementation:

  1. We do, as for any other tile: After packing all items with higher priority, we pick the first free slot which is wider(or equal) and taller (or equal) to given tile. Then subtract occupied space from remaining free slots/space to pack, which in facts does nothing, and other tiles may be packed at the same x,y. 0-size tile may get gutter as well.

    However it will not get separated 0-size grid track, which may become dynamic.

  2. n/a
  3. n/a
  4. Currently we don't, and we do not bother with any validation on that. All items are being wrapped by Shadow DOM tiles, and all tiles are styled according to the setup. You may add/remove items from <juicy-tile-lis> and -grid> in run-time, and they will get styles according to given setup (and ids).
    If you want to show/hide, change any other CSS property of you element your are totally free to do so, you element will behave as it should according to regular W3C rules, however the ShadowDOM tile will be there as long as your element is there. If you want to show/hide, change size, or any other layout property of a tile, you can do it as well in run-time, but you need to.. well... change the layout property, and .refresh() our element. (This is done automatically if you change entire setup attribute, or on re-size, mutation, attached events, according to custom attributes set, and you can do it manually as well)
  5. n/a

@warpech , @miyconst WDYT?