From 0eec7cf58eb24d2f280c1552f705df5e077bfc31 Mon Sep 17 00:00:00 2001 From: Anika Raemer Date: Sun, 7 Sep 2025 09:43:55 +0200 Subject: [PATCH] css and adding cancel button to editor --- frontend/src/App.css | 99 +++++++++++-------- .../src/components/IngredientListEditor.tsx | 12 +-- frontend/src/components/RecipeDetailView.tsx | 12 +-- frontend/src/components/RecipeEditor.tsx | 33 ++++--- frontend/src/index.css | 17 ++-- 5 files changed, 102 insertions(+), 71 deletions(-) diff --git a/frontend/src/App.css b/frontend/src/App.css index 507e3cd..0c60b20 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -4,55 +4,76 @@ /* Custom recipe app styles */ @layer components{ -.app-container { - @apply p-4 flex; -} + .app-container { + @apply p-4 flex; + } -.sidebar { - @apply min-w-[16rem] bg-gray-50 p-4 w-1/3 border-r pr-4; -} + .sidebar { + @apply min-w-[16rem] bg-gray-50 p-4 w-1/3 border-r pr-4; + } -.sidebar-title { - @apply text-blue-900 font-bold mb-2; -} + .sidebar-title { + @apply text-blue-900 font-bold mb-2; + } -.sidebar-link { - @apply block bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition -} + .sidebar-link { + @apply block bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition + } -.sidebar-item-text { - @apply font-semibold text-blue-400 -} + .sidebar-item-text { + @apply font-semibold text-blue-400; + } -.content-title{ - @apply text-xl font-black mb-16 text-blue-300 -} + .content-title{ + @apply text-3xl font-black mb-8 text-blue-400; + } -.main-view { - @apply w-2/3 pl-4; -} + .main-view { + @apply w-2/3 pl-4; + } -.recipe-title { - @apply text-2xl font-bold; -} + .recipe-image { + @apply my-4 w-64; + } -.recipe-image { - @apply my-4 w-64; -} + .section-heading { + @apply text-xl font-bold mb-2; + } -.section-heading { - @apply text-2xl font-bold; -} + .subsection-heading { + @apply font-semibold mb-2; + } -.primary-button { - @apply bg-blue-300 px-4 py-2 shadow-md rounded-lg hover:bg-blue-400 text-gray-600 -} + /* buttons */ + .primary-button { + @apply bg-blue-300 px-4 py-2 shadow-md rounded-lg hover:bg-blue-400 text-gray-600 + } -.default-button{ - @apply bg-gray-300 px-4 py-2 shadow-md rounded-lg hover:bg-gray-400 text-gray-600 -} + .default-button{ + @apply bg-gray-300 px-4 py-2 shadow-md rounded-lg hover:bg-gray-400 text-gray-600 + } -.input-field { - @apply border p-2 w-full mb-2; -} + .dark-button{ + @apply bg-gray-600 text-white rounded px-4 py-2 + } + + /* input field */ + .input-field { + @apply border p-2 w-full mb-2 rounded; + } + + .text-area { + @apply border p-2 w-full mb-2 rounded; + } + + /* groups */ + .button-group{ + @apply flex gap-4 mt-4; + } + + /* lists */ + .default-list-item { + @apply list-disc pl-6 mb-6 + } + } \ No newline at end of file diff --git a/frontend/src/components/IngredientListEditor.tsx b/frontend/src/components/IngredientListEditor.tsx index 88f560b..cd54516 100644 --- a/frontend/src/components/IngredientListEditor.tsx +++ b/frontend/src/components/IngredientListEditor.tsx @@ -24,31 +24,31 @@ export function IngredientListEditor({ ingredients, onChange }: IngredientListEd return (
-

Ingredients

+

Ingredients

{ingredients.map((ing, index) => (
handleUpdate(index, "amount", e.target.value)} /> handleUpdate(index, "unit", e.target.value)} /> handleUpdate(index, "name", e.target.value)} />