Fix component layout
This commit is contained in:
parent
c866c01dfe
commit
7c01ed5894
2 changed files with 38 additions and 39 deletions
|
|
@ -4,8 +4,9 @@
|
|||
@tailwind utilities;
|
||||
|
||||
/* Custom recipe app styles */
|
||||
@layer preflight {
|
||||
/* headlines */
|
||||
|
||||
@layer components {
|
||||
|
||||
h1 {
|
||||
@apply text-3xl font-black text-blue-900;
|
||||
}
|
||||
|
|
@ -18,18 +19,15 @@
|
|||
@apply font-semibold;
|
||||
}
|
||||
|
||||
/* labels */
|
||||
label {
|
||||
@apply text-gray-600;
|
||||
}
|
||||
|
||||
/* input fields */
|
||||
input, textarea {
|
||||
@apply p-2 w-full border rounded-md bg-white placeholder-gray-400 border-gray-600 hover:border-blue-800 transition-colors text-gray-600 focus:outline-none focus:border-blue-900;
|
||||
}
|
||||
}
|
||||
|
||||
@layer components {
|
||||
/* labels */
|
||||
label {
|
||||
@apply text-gray-600;
|
||||
}
|
||||
|
||||
/* background */
|
||||
.app-bg {
|
||||
|
|
|
|||
|
|
@ -14,27 +14,28 @@ export default function RecipeListItem({ title, targetPath, imageUrl }: RecipeLi
|
|||
return (
|
||||
<Link
|
||||
to={targetPath}
|
||||
className="h-60 w-60 block rounded-xl overflow-hidden shadow-md hover:shadow-lg transition-shadow bg-white dark:bg-gray-800"
|
||||
className="h-60 w-60 block rounded-xl overflow-hidden shadow-md hover:shadow-lg transition-shadow bg-white dark:bg-gray-800 flex flex-col"
|
||||
>
|
||||
{/* Optional recipe image */}
|
||||
{/* Image or placeholder */}
|
||||
{imageUrl ? (
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={title}
|
||||
className="w-full h-40 object-cover"
|
||||
className="w-full h-2/3 object-cover"
|
||||
/>
|
||||
)
|
||||
: <div className="bg-gray-300 w-full h-40 flex justify-center items-center">
|
||||
<label className="font-black text-gray-500" >no image</label>
|
||||
) : (
|
||||
<div className="bg-gray-300 w-full h-2/3 flex justify-center items-center">
|
||||
<label className="font-black text-gray-600">no image</label>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
|
||||
{/* Card content */}
|
||||
<div className="p-4">
|
||||
<h2 className="text-lg font-semibold text-blue-400 dark:text-gray-100">
|
||||
{/* Recipe name section (takes remaining space) */}
|
||||
<div className="flex-1 flex items-center justify-center p-2">
|
||||
<label className="text-lg font-semibold text-blue-400 dark:text-gray-100 text-center">
|
||||
{title}
|
||||
</h2>
|
||||
</label>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue