grid images scale correctly

This commit is contained in:
hugogogo
2026-11-19 16:47:44 +01:00
parent 13dce739cf
commit 15e33875a0
+9 -5
View File
@@ -22,14 +22,18 @@
gap: 10px; gap: 10px;
} }
/* dense image grid : ~200px cells, flexible down to phone widths, /* image grid, pure grid (no media queries) : the column count follows
same max width as the .cv container */ the container width automatically. min(220px, 48%) => max 4 columns
at 1100px (5x220px doesn't fit) and never less than 2 columns
(2x48% + gap always fits). Same max width as the .cv container */
.images_grid { .images_grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(min(220px, 48%), 1fr));
gap: 10px; gap: 10px;
width: auto; /* definite width tracking the viewport (the parent grid column is
max-width: 1100px; auto-sized, so width:auto would stay at max-content = 1100px),
capped at the same max width as the .cv container */
width: min(1100px, calc(100vw - 20px));
img { img {
width: 100%; width: 100%;