An open API service indexing awesome lists of open source software.

https://github.com/manumorante/mm-masonry

pure css masonry experiments
https://github.com/manumorante/mm-masonry

css custom-properties masonry

Last synced: 6 months ago
JSON representation

pure css masonry experiments

Awesome Lists containing this project

README

          

# Masonry Photo Gallery

![image](https://user-images.githubusercontent.com/3266486/170789547-9fcfa677-01b0-4347-9d6a-941cc34efd21.png)

## NPM package

[npmjs.com/package/mm-masonry](https://www.npmjs.com/package/mm-masonry)

## Demo

[Demo: CSS Grid + custom props](https://masonry.manumorante.com/web/01-css-grid-custom-props.html)

## Config the **column width** and **gap**

Using css selector:

```css
.mm-masonry {
--_col-width: 240;
--_gap: 8;
}
```

Or directly in the html tag:

```html

...

```

## Disable option

You can control the disable option by using the following css selector:

```css
.mm-masonry {
--_display: block; /* unset | flex | ...*/
--_gap: 0; /* Or a value */
}
```

## Using some JavaScript

**CSS Grid + image load event**

Set image dimensions when `onload` event in Javascript.

[Demo: CSS Grid + image load event](https://masonry.manumorante.com/web/02-css-grid-js-load.html)

## CSS columns

The simplest way: with CSS Columns.

[Demo: CSS columns](https://masonry.manumorante.com/web/03-css-colums.html)