Skip to content

Commit 426a706

Browse files
authored
Fix(Fall Hacks 2025): Gallery not centered on small screens (#206)
Issue: On smaller screens, when the gallery images wrapped to a single column, the images would become left-aligned. Root cause: The size of the images were hard coded to be 17.5rem. This meant that if the gallery wrapped the images would be aligned to the left. Solution: Changed the gallery to use grid instead. The images will now attempt to grow to fill the column, unless the column has 17.5rem or higher of horizontal space. At that point, a new column will be made and the row will accommodate another image.
1 parent 585806d commit 426a706

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

public/fall-hacks/2025/style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ s {
3838
}
3939

4040
.img-container {
41-
display: flex;
42-
flex-direction: row;
43-
flex-wrap: wrap;
41+
display: grid;
42+
grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
43+
margin: 0 auto;
4444
gap: 1rem;
4545
}
4646

4747
img {
48-
width: 17.5rem;
48+
width: 100%;
4949
aspect-ratio: 1.33 / 1;
5050
object-fit: cover;
5151
border: 1px solid gray;
@@ -65,7 +65,7 @@ img {
6565
}
6666

6767
.hero__year {
68-
color: darkgreen;
68+
color: #006400;
6969
font-size: clamp(1.5rem, 3vw, 4rem);
7070
}
7171

0 commit comments

Comments
 (0)