Menu

The grid decision that rewrote my lightbox logic
📰

The grid decision that rewrote my lightbox logic

DEV Community: css·Richard Lemon·7 days ago
#qCvgxq8D
#devtocss#devto#dev#lightbox#theme
Reading 0:00
15s threshold

The moment the grid stopped being “just layout”

The /themes page for Aftertype started as a simple responsive gallery. A few cards, some screenshots, a lightbox on click.

Then I tried to make it more flexible. Different aspect ratios. Mixed font previews. Variable image crops. A lightbox that behaved slightly differently per theme. It technically worked, but it felt like a prototype that never ended.

The turning point was a very boring decision: lock the grid to consistent aspect ratios for both fonts and images, across all breakpoints. No more “this card is special.” Once that was in place, a lot of other logic had to be rewritten, especially the lightbox. It also made the page better at doing the one thing it needs to do: sell design themes.

Aspect ratio as a product decision, not a CSS trick

Aspect ratio sounds like a visual detail, but on a product gallery it decides what people can actually compare.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.