Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CSS3-only layout using grid-template-rows: masonry #45

Open
martinschneider opened this issue Jun 8, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@martinschneider
Copy link
Contributor

CSS3 has built-in support for masonry grid layouts. This could be used to manage the layout of the gallery without JS. As a side-effect this would also solve issues like #35 where automatic crawlers don't find the images because they are loaded dynamically.

masonry-layout is currently only supported in Firefox, but other browsers might follow. We could keep the current approach as a fallback to ensure the gallery looks great everywhere.

I built a quick PoC based on this article and it looks promising. If there's interest to go down this path, I could invest some time to come up with a PR, or also help/review if someone else wants to build this.

@mfg92
Copy link
Owner

mfg92 commented Jun 13, 2022

That sounds interesting. Thank you for pointing that out to me.
If we do that in the future, we have to check that we do not lose any functionality like lazy loading, filtering, etc. In the examples they have the images are arranged in columns, will rows (as we have it right now) work too?

I would prevere this JS-less approach to the current one when there is support for that in FF, Chrom(ium), Edge and Safari. I think it is currently to early to start any implementation, as even in Firefox this feature is hidden behind a flag: https://caniuse.com/mdn-css_properties_grid-template-rows_masonry

Having the old and new CSS3 approach mixed could lead to hard to understand and hard to maintain code.

@mfg92 mfg92 added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants