style: make recipe card images square
Some checks failed
CI/CD Pipeline / Code Quality (push) Failing after 5m32s
CI/CD Pipeline / Run Tests (push) Failing after 1s
CI Pipeline / Lint Code (push) Failing after 5m30s
CI Pipeline / Test API Package (push) Failing after 1s
CI Pipeline / Test Shared Package (push) Has been cancelled
CI Pipeline / Build All Packages (push) Has been cancelled
CI Pipeline / Generate Coverage Report (push) Has been cancelled
Docker Build & Deploy / Deploy to Staging (push) Has been cancelled
Docker Build & Deploy / Build Docker Images (push) Has been cancelled
Docker Build & Deploy / Push Docker Images (push) Has been cancelled
Docker Build & Deploy / Deploy to Production (push) Has been cancelled
CI Pipeline / Test Web Package (push) Has been cancelled
E2E Tests / End-to-End Tests (push) Has been cancelled
E2E Tests / E2E Tests (Mobile) (push) Has been cancelled
Security Scanning / NPM Audit (push) Has been cancelled
Security Scanning / Dependency License Check (push) Has been cancelled
Security Scanning / Code Quality Scan (push) Has been cancelled
Security Scanning / Docker Image Security (push) Has been cancelled
Security Scanning / Security Summary (push) Has been cancelled
CI/CD Pipeline / Build and Push Docker Images (push) Has been skipped

- Use aspect-ratio: 1/1 for square images instead of fixed heights
- Remove inline imageStyle from recipe cards
- Images now crop to fit square format with object-fit: cover

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 06:35:22 +00:00
parent 7a0b3698a0
commit b0352fc29f
2 changed files with 2 additions and 5 deletions

View File

@@ -166,10 +166,6 @@ function RecipeList() {
gridTemplateColumns: `repeat(${columnCount}, 1fr)`,
};
const imageStyle: React.CSSProperties = {
height: `${SIZE_PRESETS[cardSize].imageHeight}px`,
};
const handlePageChange = (newPage: number) => {
setCurrentPage(newPage);
window.scrollTo({ top: 0, behavior: 'smooth' });
@@ -325,7 +321,7 @@ function RecipeList() {
onClick={() => navigate(`/recipes/${recipe.id}`)}
>
{recipe.imageUrl && (
<img src={recipe.imageUrl} alt={recipe.title} style={imageStyle} />
<img src={recipe.imageUrl} alt={recipe.title} />
)}
<div className="recipe-card-content">
<h3>{recipe.title}</h3>

View File

@@ -271,6 +271,7 @@
.recipe-grid-enhanced .recipe-card img {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
}