Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

[DISCUSS] Remove packery - replace with flexbox #300

Open
wants to merge 4 commits into
base: production
Choose a base branch
from

Conversation

h-lame
Copy link
Contributor

@h-lame h-lame commented Apr 20, 2017

We're using the packery library to layout the blog posts in a condensed gird, something that at the time of development was impossible to do with pure css. However, I'm almost certain that we've not paid the license fee to be allowed to do so on the site, so we should remove it. Using CSS flexbox works to a degree - there are still holes in the grid where packery would shuffle things up (e.g. a small followed by two large and another small would leave a hole under the first small one:

+-+-+-+
|s|b|b|
+-+-+-+
| |b|b|
+-+-+-+
|b|b|s|
+-+-+-+
|b|b| |
+-+-+-+

When what our Tiler would give us, and what we'd want is:

+-+-+-+
|s|b|b|
+-+-+-+
|s|b|b|
+-+-+-+
|b|b| |
+-+-+-+
|b|b| |
+-+-+-+

We still have two slots, but they can be filled by other tiles in the 2nd example, but won't be in the 1st example.

I'm not 100% sure I've got the flexbox stuff correct, so we might be able to tweak some more and get better results.

This is an alternative to #299

I don't think we've been using it in correct terms of the license, and I also
think it has some performance issues in the browser as it condenses the
grid.
This class is to replace packery by doing the tiling at html render time,
rather than in JS on the browser.  We construct a Tiler with a number of
rows and columns.  When we add a tile we say what size it is (default is
1x1) and when we layout the tiles the tiler will fit things in and fill
up spaces created by adding larger tiles using any future smaller
tiles if possible.
@h-lame h-lame changed the title Remove packery - replace with flexbox [DISCUSS] Remove packery - replace with flexbox Apr 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant