2.1.0 • Published 6 months ago

@prof-dev/masonry v2.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

CSS Grid masonry polyfill

A simple, easy-to-use solution for creating masonry-style grids with CSS Grid. This library checks for support of grid-template-rows: masonry in the browser. If unsupported, it automatically adjusts item placement to simulate a masonry layout.

It supports any grid-template-columns configuration and allows flexible use of @media queries to adjust column layouts.

Note: This polyfill does not implement any packing algorithms. The original order of items will be preserved.

Demo

Installation

npm i @prof-dev/masonry

Example

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, auto));
  align-items: start;
  gap: 12px;
}
const grid = document.querySelector(".masonry-grid");

if (grid !== null) {
  new Masonry(grid);
}
2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.11

1 year ago

2.0.7

1 year ago

2.0.12

8 months ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.1.0

6 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

2 years ago

1.0.1

4 years ago

1.0.0

4 years ago