diff --git a/frontend/src/components/matchButton/MatchButton.css b/frontend/src/components/matchButton/MatchButton.css index bb68063e..694786af 100644 --- a/frontend/src/components/matchButton/MatchButton.css +++ b/frontend/src/components/matchButton/MatchButton.css @@ -17,7 +17,7 @@ color: var(--pink-text); border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); - font-size: 14px; + font-size: 16px; white-space: nowrap; opacity: 0; visibility: hidden; diff --git a/frontend/src/components/plantCard/PlantCard.css b/frontend/src/components/plantCard/PlantCard.css index 4d73fa45..618707cb 100644 --- a/frontend/src/components/plantCard/PlantCard.css +++ b/frontend/src/components/plantCard/PlantCard.css @@ -281,6 +281,11 @@ } .plant-card-back { + /* A green border, the same color as the header. In dark mode the pink back + is too close to the dark page (2.6:1), and the border makes it stand out + (about 6:1). It is there in light mode too, so the card has the same size + inside and the text is placed the same way in both modes */ + border: 2px solid var(--dark-green); background: var(--card-back); color: var(--text-light); } @@ -377,7 +382,7 @@ .plant-card-flipper .plant-preference-chip { padding: 0.5em 0.93em; - font-size: clamp(12px, 4.5cqw, 14px); + font-size: clamp(13px, 5cqw, 15px); box-sizing: border-box; max-width: 100%; diff --git a/frontend/src/components/plantPreferenceChips/PlantPreferenceChips.css b/frontend/src/components/plantPreferenceChips/PlantPreferenceChips.css index 5791f5a5..5751786a 100644 --- a/frontend/src/components/plantPreferenceChips/PlantPreferenceChips.css +++ b/frontend/src/components/plantPreferenceChips/PlantPreferenceChips.css @@ -31,7 +31,7 @@ background: var(--light-pink); color: var(--pink-text); - font-size: 14px; + font-size: 15px; font-weight: 700; border: 2px solid var(--dark-pink); diff --git a/frontend/src/components/sidebar/Sidebar.css b/frontend/src/components/sidebar/Sidebar.css index 603891af..e41e4c86 100644 --- a/frontend/src/components/sidebar/Sidebar.css +++ b/frontend/src/components/sidebar/Sidebar.css @@ -81,6 +81,10 @@ color: var(--dark-pink); } +[data-theme="dark"] .sidebar__heart { + color: #e86a8d; +} + .close-button { display: none; } diff --git a/frontend/src/components/sortMenu/SortMenu.css b/frontend/src/components/sortMenu/SortMenu.css index aa6a8aa1..e1c81e23 100644 --- a/frontend/src/components/sortMenu/SortMenu.css +++ b/frontend/src/components/sortMenu/SortMenu.css @@ -9,8 +9,6 @@ gap: 0.5rem; height: 40px; padding: 0 0.75rem; - /* The same width on every page, so the button is easy to recognise. - It still grows if a label is longer. */ min-width: 13rem; border: 1px solid var(--dark-pink); border-radius: 8px; @@ -21,9 +19,7 @@ cursor: pointer; } -/* On My Matches the button lies on the dark pink box, where a dark pink border - is too weak in dark mode (2.6:1), so it is white there */ -[data-theme="dark"] .sort-button { +[data-theme="dark"] .my-matches-header .sort-button { border-color: var(--text-light); } diff --git a/frontend/src/index.css b/frontend/src/index.css index bf61b462..4ce02caa 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -44,8 +44,9 @@ textarea { --border: #f3f7f3; --border-soft: #ddd5c5; --border-pink: #ffe5ed; - --accent-green: #6b8f71; - --accent-green-hover: #6f9373; + --input-text: #000000; + --placeholder-text: #78716c; + --dislike-icon: var(--text-light); --light-sage: #dce1cc; --sidebar-background: var(--light-sage); --sidebar-border: #c9d0b5; @@ -53,17 +54,13 @@ textarea { --card-shadow: drop-shadow(0 6px 14px rgba(30, 40, 30, 0.18)); --card-shadow-hover: drop-shadow(0 10px 22px rgba(30, 40, 30, 0.24)); --card-box-shadow: 0 6px 20px rgba(30, 40, 30, 0.15); - /* The dark green from light mode. Not changed in dark mode, so it can be - used on white or light backgrounds there too. */ --deep-green: #2e4a3b; --cream: #f5f1e8; --soft-green: #a9b48a; - /* Front of the plant card: dark green with light text in light mode */ --card-front: var(--deep-green); --card-hint: var(--cream); } -/* The round "i" button that shows a help text, used on Plant Match and Profile */ .info-button { display: flex; align-items: center; @@ -109,17 +106,16 @@ textarea { --border: #2e2c29; --border-soft: #46423d; --border-pink: #5a3340; - --accent-green: #6b8f71; - --accent-green-hover: #7a9e7e; + --input-text: var(--text-dark); + --placeholder-text: #b8b0a6; + --dislike-icon: #f4a3b9; --light-sage: var(--light-green); --sidebar-background: var(--light-sage); --sidebar-border: var(--border-soft); --sidebar-text: var(--text-dark); - /* No shadows in dark mode. The cards get a light border instead (PlantCard.css) */ - --card-shadow: none; - --card-shadow-hover: none; - --card-box-shadow: none; - /* Front of the plant card: light with dark green text in dark mode */ + --card-shadow: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55)); + --card-shadow-hover: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.65)); + --card-box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); --card-front: var(--cream); --card-hint: var(--deep-green); } diff --git a/frontend/src/pages/plantMatch/PlantMatchPage.css b/frontend/src/pages/plantMatch/PlantMatchPage.css index f85f2cd6..46da52e9 100644 --- a/frontend/src/pages/plantMatch/PlantMatchPage.css +++ b/frontend/src/pages/plantMatch/PlantMatchPage.css @@ -16,7 +16,6 @@ align-items: center; margin-top: 12px; gap: 20px; - /* Shows the card and the skip/like buttons 10 % bigger */ zoom: 1.1; } @@ -35,8 +34,8 @@ } [data-theme="dark"] .plant-card-container { - --card-shadow: none; - --card-shadow-hover: none; + --card-shadow: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65)); + --card-shadow-hover: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.75)); } .match-info { @@ -55,13 +54,15 @@ .match-info-box { position: absolute; top: 50px; - right: -20px; - width: 320px; - padding: 28px 30px; - background: var(--light-background); + right: 5px; + width: calc(var(--plant-card-width) + 20px); + padding: 24px 24px; + box-sizing: border-box; + border: 2px solid var(--dark-pink); + background: var(--light-pink); border-radius: 18px; text-align: center; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); opacity: 0; visibility: hidden; pointer-events: none; @@ -71,6 +72,10 @@ z-index: 30; } +[data-theme="dark"] .match-info-box { + box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6); +} + .match-info:hover .match-info-box, .match-info:focus-within .match-info-box { opacity: 1; @@ -78,7 +83,6 @@ pointer-events: auto; } -/* Hidden with Escape (see useDismissibleTooltip) */ .match-info.is-dismissed .match-info-box { opacity: 0; visibility: hidden; @@ -99,8 +103,6 @@ line-height: 1.6; } -/* .plant-card.empty-plant-card, because PlantCard.css is loaded after this file - and its .plant-card background would win otherwise */ .plant-card.empty-plant-card { display: flex; align-items: center; @@ -191,7 +193,7 @@ } .swipe-button:disabled { - opacity: 0.25; + opacity: 0.5; cursor: default; } @@ -206,15 +208,16 @@ color: var(--text-on-green); } -/* In dark mode the buttons are white and the icons get the button colors */ [data-theme="dark"] .dislike-button { - background-color: var(--text-light); - color: var(--dark-pink); + border: 3px solid var(--dark-pink); + background-color: var(--light-pink); + color: var(--dislike-icon); } [data-theme="dark"] .like-button { - background-color: var(--text-light); - color: var(--deep-green); + border: 3px solid var(--dark-green); + background-color: var(--light-green); + color: var(--dark-green); } @media (max-width: 767px) { @@ -226,10 +229,7 @@ overflow-x: hidden; } - /* On mobile the card takes the whole first row and the skip/like buttons - sit side by side underneath it */ .plant-match { - /* A slightly smaller card so the card and the buttons fit better on screen */ --plant-card-width: min(250px, 66vw); --plant-card-height: min(450px, 62vh); @@ -261,7 +261,7 @@ .match-info-box { top: 42px; right: 0; - width: 200px; + width: 232px; max-width: calc(100vw - 40px); padding: 18px 16px; } diff --git a/frontend/src/pages/profile/ProfilePage.css b/frontend/src/pages/profile/ProfilePage.css index 18e0222f..c819bb1b 100644 --- a/frontend/src/pages/profile/ProfilePage.css +++ b/frontend/src/pages/profile/ProfilePage.css @@ -4,7 +4,6 @@ box-sizing: border-box; } - .profile > * { zoom: 1.1; } @@ -60,20 +59,23 @@ } .preferences-info-box { + /* To the right of the info button, vertically centered on it */ position: absolute; - top: 100%; - left: 0; + top: 50%; + left: calc(100% + 12px); + transform: translateY(-50%); z-index: 30; width: 280px; max-width: calc(100vw - 48px); - margin: 6px 0 0; + margin: 0; padding: 14px 16px; + border: 2px solid var(--dark-pink); border-radius: 12px; - background: var(--light-background); + background: var(--light-pink); color: var(--text-dark); font-size: 0.95rem; line-height: 1.5; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); opacity: 0; visibility: hidden; transition: @@ -81,13 +83,16 @@ visibility 0.2s ease; } +[data-theme="dark"] .preferences-info-box { + box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6); +} + .preferences-info:hover .preferences-info-box, .preferences-info:focus-within .preferences-info-box { opacity: 1; visibility: visible; } -/* Hidden with Escape (see useDismissibleTooltip) */ .preferences-info.is-dismissed .preferences-info-box { opacity: 0; visibility: hidden; @@ -142,6 +147,12 @@ display: flex; align-items: center; justify-content: center; + gap: 0.5rem; +} + +.edit-profile-icon { + font-size: 1.4em; + line-height: 1; } .edit-profile-form { @@ -163,15 +174,17 @@ border-radius: 8px; box-sizing: border-box; font-size: 1rem; + background-color: var(--light-background); + color: var(--input-text); } .edit-profile-form input::placeholder { - color: var(--text-dark); + color: var(--placeholder-text); } -/* The inputs stay white in dark mode, so the placeholder needs a dark color */ -[data-theme="dark"] .edit-profile-form input::placeholder { - color: #57534e; +.edit-profile-form input:focus { + outline: none; + box-shadow: 0 0 0 2px var(--dark-green); } .edit-profile-form h3 { @@ -226,4 +239,10 @@ .profile-tabs { width: 350px; } + + .preferences-info-box { + top: calc(100% + 6px); + left: 0; + transform: none; + } } diff --git a/frontend/src/pages/profile/ProfilePage.tsx b/frontend/src/pages/profile/ProfilePage.tsx index 71e96f1b..71f80848 100644 --- a/frontend/src/pages/profile/ProfilePage.tsx +++ b/frontend/src/pages/profile/ProfilePage.tsx @@ -147,7 +147,10 @@ export default function ProfilePage() { {activeTab === "editProfile" && (

- {t("profile.editProfile")} + + {t("profile.editProfile")}