Skip to content

Instantly share code, notes, and snippets.

@mehori
Created June 20, 2026 16:59
Show Gist options
  • Select an option

  • Save mehori/ddedec6f304e7dc47917bef3a8def468 to your computer and use it in GitHub Desktop.

Select an option

Save mehori/ddedec6f304e7dc47917bef3a8def468 to your computer and use it in GitHub Desktop.
.hugo-blog-card {
display: flex;
border: 1px solid #e2e8f0;
border-radius: 8px;
overflow: hidden;
text-decoration: none;
color: inherit;
/* Added a 1rem margin to the left and right so it doesn't touch the edges */
margin: 1.5rem 1rem;
transition: transform 0.2s, box-shadow 0.2s;
background: #ffffff;
}
.hugo-blog-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.hugo-blog-card .card-image {
flex: 0 0 200px; /* 200px wide on desktop */
background-size: cover;
background-position: center;
}
.hugo-blog-card .card-content {
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: center;
/* Ensure text doesn't overflow its container */
min-width: 0;
}
.hugo-blog-card .card-title {
font-weight: bold;
font-size: 1.1rem;
margin-bottom: 0.5rem;
color: #1a202c;
/* Truncate long titles with an ellipsis if they don't fit */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.hugo-blog-card .card-desc {
font-size: 0.9rem;
color: #4a5568;
margin-bottom: 0.75rem;
/* Hide description overflow elegantly */
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.hugo-blog-card .card-url {
font-size: 0.75rem;
color: #a0aec0;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Updated Mobile Layout: Keeps them side-by-side */
@media (max-width: 600px) {
.hugo-blog-card {
/* Slightly smaller margins on mobile */
margin: 1.5rem 0.5rem;
}
.hugo-blog-card .card-image {
/* Shrink the image down to 100px wide instead of stacking it */
flex: 0 0 100px;
}
.hugo-blog-card .card-content {
/* Slightly tighter padding on mobile */
padding: 0.75rem;
}
.hugo-blog-card .card-title {
font-size: 0.95rem;
margin-bottom: 0.25rem;
}
.hugo-blog-card .card-desc {
font-size: 0.8rem;
margin-bottom: 0.5rem;
/* On very small screens, you might only want 1 line of description */
-webkit-line-clamp: 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment