Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/matchButton/MatchButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/plantCard/PlantCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/sidebar/Sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
color: var(--dark-pink);
}

[data-theme="dark"] .sidebar__heart {
color: #e86a8d;
}

.close-button {
display: none;
}
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/components/sortMenu/SortMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
22 changes: 9 additions & 13 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,23 @@ 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;
--sidebar-text: #2e4a3b;
--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;
Expand Down Expand Up @@ -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);
}
42 changes: 21 additions & 21 deletions frontend/src/pages/plantMatch/PlantMatchPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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 {
Expand All @@ -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;
Expand All @@ -71,14 +72,17 @@
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;
visibility: visible;
pointer-events: auto;
}

/* Hidden with Escape (see useDismissibleTooltip) */
.match-info.is-dismissed .match-info-box {
opacity: 0;
visibility: hidden;
Expand All @@ -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;
Expand Down Expand Up @@ -191,7 +193,7 @@
}

.swipe-button:disabled {
opacity: 0.25;
opacity: 0.5;
cursor: default;
}

Expand All @@ -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) {
Expand All @@ -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);

Expand Down Expand Up @@ -261,7 +261,7 @@
.match-info-box {
top: 42px;
right: 0;
width: 200px;
width: 232px;
max-width: calc(100vw - 40px);
padding: 18px 16px;
}
Expand Down
41 changes: 30 additions & 11 deletions frontend/src/pages/profile/ProfilePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
box-sizing: border-box;
}


.profile > * {
zoom: 1.1;
}
Expand Down Expand Up @@ -60,34 +59,40 @@
}

.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:
opacity 0.2s ease,
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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -226,4 +239,10 @@
.profile-tabs {
width: 350px;
}

.preferences-info-box {
top: calc(100% + 6px);
left: 0;
transform: none;
}
}
5 changes: 4 additions & 1 deletion frontend/src/pages/profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export default function ProfilePage() {
{activeTab === "editProfile" && (
<div className="edit-profile">
<h2>
<span aria-hidden="true">⚙︎</span> {t("profile.editProfile")}
<span className="edit-profile-icon" aria-hidden="true">
⚙︎
</span>
{t("profile.editProfile")}
</h2>
<div className="edit-profile-form">
<label htmlFor="profile-name"> {t("profile.enterName")} </label>
Expand Down
Loading