Skip to content

Commit 6facc8f

Browse files
drusepthclaude
andcommitted
Revert to standard Materialize grid for better card density
- Switched from CSS Grid to standard Materialize column grid - Fixed card width issues so cards properly fill available space - Ensured cards maintain consistent heights within rows - Added proper margins for better spacing between card rows - Set consistent card image heights for better visual alignment - Used flexbox approach that works better with Materialize CSS 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 60756dd commit 6facc8f

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

app/views/browse/tag.html.erb

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
<div class="row js-content-cards-list">
115115
<% content_group[:content].each do |content| %>
116-
<div class="col s12 m6 l4 xl3 js-content-card-container">
116+
<div class="col s12 m6 l4 xl3 js-content-card-container" style="margin-bottom: 20px;">
117117
<div class="hoverable card sticky-action z-depth-1" style="margin-bottom: 20px; border-radius: 8px; overflow: hidden;">
118118
<!-- Color indicator bar at top of card -->
119119
<div style="height: 4px; background-color: <%= content_group[:color] == 'grey' ? '#9e9e9e' : "var(--#{content_group[:color]})" %>;"></div>
@@ -377,37 +377,35 @@
377377
display: block;
378378
}
379379

380-
/* Card height consistency using CSS Grid */
381-
@media only screen and (min-width: 601px) {
382-
.js-content-cards-list {
383-
display: grid;
384-
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
385-
grid-gap: 20px;
386-
}
387-
388-
.js-content-card-container {
389-
margin-bottom: 0;
390-
}
391-
392-
.js-content-card-container .card {
393-
height: 100%;
394-
margin-bottom: 0;
395-
display: grid;
396-
grid-template-rows: auto 1fr auto;
397-
}
398-
399-
.card .card-image {
400-
grid-row: 1;
401-
}
402-
403-
.card .card-content {
404-
grid-row: 2;
405-
}
406-
407-
.card .card-action {
408-
grid-row: 3;
409-
align-self: end;
410-
}
380+
/* Proper card sizing and grid density - reverting to standard Material grid with fixed heights */
381+
.js-content-card-container .card {
382+
height: 100%;
383+
width: 100%;
384+
margin-bottom: 0;
385+
}
386+
387+
/* Make all cards in a row the same height */
388+
.js-content-cards-list {
389+
display: flex;
390+
flex-wrap: wrap;
391+
margin-left: -0.75rem;
392+
margin-right: -0.75rem;
393+
}
394+
395+
/* Make sure card containers take their full column width */
396+
.js-content-card-container {
397+
display: flex;
398+
}
399+
400+
/* Ensure card images maintain aspect ratio */
401+
.card .card-image .activator {
402+
height: 200px;
403+
width: 100%;
404+
}
405+
406+
/* Ensure card content expands properly */
407+
.card .card-content {
408+
flex-grow: 1;
411409
}
412410

413411
@media only screen and (max-width: 600px) {

0 commit comments

Comments
 (0)