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 css grid #299

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 grid works, but the stats from "can i use" for css grid are not great (37% Globally, 33% UK) so I'm not sure it's a useful solution (yet).

As an aside, we've introduced a Tiler class to arrange the articles into a grid as we render them in HTML, but it's possible that this class isn't needed because css-grid is able to cope. (Perhaps not with the minimal grid implementation in this PR, but maybe with some tweaks)

This is an alternative to #300

h-lame added 4 commits April 19, 2017 11:42
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 css grid [DISCUSS] Remove packery - replace with css grid Apr 20, 2017
@tomsabin
Copy link
Contributor

My preference would be for CSS grid. I'd like to not rely on JS to arrange the layout (#304) and I don't think the flexbox version works (#300).

We might be able to implement a mixture until CSS grid is well supported. We could use @supports to detect the browser support in CSS, but IE11 would unfortunately fall out of this (despite supporting CSS grid! We might have to rely on the JS implementation for a while longer...

@h-lame
Copy link
Contributor Author

h-lame commented Jun 2, 2018

So, I was reading a thing and it said CSS grid was well supported so I checked can i use again and it's effectively 84% supported now so it may be worth revisiting this. Not sure what the IE11 story is though as it's flagged on can i use as using an older version of the spec via -ms prefix.

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.

2 participants