Skip to content

Commit 8f658a0

Browse files
committed
Fixed dark mode readability issue
1 parent 1c7d509 commit 8f658a0

4 files changed

Lines changed: 241 additions & 91 deletions

File tree

src/components/testimonials/TestimonialCard.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useEffect, useState } from "react";
22
import { motion } from "framer-motion";
33
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
44
import { useSafeColorMode } from "../../utils/useSafeColorMode";
@@ -54,9 +54,12 @@ const TestimonialCard: React.FC<TestimonialCardProps> = ({
5454
};
5555
};
5656

57+
const [mounted, setMounted] = useState(false);
58+
useEffect(() => setMounted(true), []);
59+
5760
return (
5861
<motion.div
59-
initial={{ opacity: 0, y: 20 }}
62+
initial={mounted ? { opacity: 0, y: 20 } : false}
6063
animate={{ opacity: 1, y: 0 }}
6164
exit={{ opacity: 0, y: -20 }}
6265
whileHover={{ y: -8 }}
@@ -95,18 +98,27 @@ const TestimonialCard: React.FC<TestimonialCardProps> = ({
9598
</Avatar>
9699

97100
<div className="flex-1">
98-
<h3 className="text-xl font-bold text-gray-900 mb-1 tracking-tight">
101+
<h3
102+
className="testimonial-author-name mb-1 text-xl font-bold leading-tight tracking-tight"
103+
style={{ color: "#111827", opacity: 1, WebkitTextFillColor: "#111827" }}
104+
>
99105
{name}
100106
</h3>
101107
{username !== "AryanGupta" && username !== "DonaldAnyamba" && (
102-
<p className="text-sm text-gray-700 font-medium mb-3">
108+
<p
109+
className="testimonial-author-role mb-3 text-sm font-medium"
110+
style={{ color: "#334155", opacity: 1, WebkitTextFillColor: "#334155" }}
111+
>
103112
{username === "VivienChen" ? "Founder @ Toastie (BC Y24)" :
104113
username === "DanielHan" ? "Founder @ Unsloth AI (YC W24, BC Y24)" :
105114
"AI Engineer @ Relevance AI"}
106115
</p>
107116
)}
108117

109-
<div className="flex items-center gap-3 text-xs text-gray-700">
118+
<div
119+
className="flex items-center gap-3 text-xs"
120+
style={{ color: "#334155", opacity: 1, WebkitTextFillColor: "#334155" }}
121+
>
110122
<span className="font-medium">{date}</span>
111123
</div>
112124
</div>

src/components/testimonials/TestimonialCarousel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export function TestimonialCarousel() {
7272
const [current, setCurrent] = useState(0);
7373
const [count, setCount] = useState(0);
7474
const { colorMode } = useSafeColorMode();
75+
const [mounted, setMounted] = useState(false);
76+
77+
useEffect(() => setMounted(true), []);
7578

7679
useEffect(() => {
7780
if (!api) {
@@ -106,7 +109,7 @@ export function TestimonialCarousel() {
106109

107110
<div className="relative mx-auto max-w-7xl px-4 z-10">
108111
<motion.div
109-
initial={{ opacity: 0, y: 30 }}
112+
initial={mounted ? { opacity: 0, y: 30 } : false}
110113
animate={{ opacity: 1, y: 0 }}
111114
transition={{ duration: 0.6 }}
112115
className="mb-16 text-center"
@@ -121,7 +124,7 @@ export function TestimonialCarousel() {
121124
</motion.div>
122125

123126
<motion.div
124-
initial={{ opacity: 0, y: 40 }}
127+
initial={mounted ? { opacity: 0, y: 40 } : false}
125128
animate={{ opacity: 1, y: 0 }}
126129
transition={{ duration: 0.6, delay: 0.2 }}
127130
>

src/css/custom.css

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,82 @@
55
color: inherit;
66
}
77

8+
/* Careers testimonials */
9+
.testimonials-section .testimonial-carousel {
10+
background: #ffffff;
11+
border: 1px solid rgba(15, 23, 42, 0.06);
12+
color: #111827;
13+
}
14+
15+
/* Ensure testimonial cards are visible by default (override animation initial states) */
16+
.testimonials-section .testimonial-carousel {
17+
opacity: 1 !important;
18+
transform: none !important;
19+
}
20+
21+
.testimonials-section .testimonial-carousel--light {
22+
background: #ffffff;
23+
border: 1px solid rgba(15, 23, 42, 0.06);
24+
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
25+
}
26+
27+
.testimonials-section .testimonial-content {
28+
color: #0f172a;
29+
}
30+
31+
.testimonials-section .testimonial-content blockquote {
32+
color: #0f172a;
33+
}
34+
35+
.testimonials-section .testimonial-author {
36+
display: inline-flex;
37+
flex-direction: column;
38+
align-items: center;
39+
gap: 0.25rem;
40+
padding: 0.85rem 1.1rem;
41+
border-radius: 1rem;
42+
background: rgba(255, 255, 255, 0.98);
43+
border: 1px solid rgba(15, 23, 42, 0.08);
44+
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
45+
opacity: 1;
46+
mix-blend-mode: normal;
47+
isolation: isolate;
48+
}
49+
50+
/* Strong override to ensure author text is always visible */
51+
.testimonials-section .testimonial-author {
52+
background: rgba(255, 255, 255, 0.98) !important;
53+
border: 1px solid rgba(15, 23, 42, 0.08) !important;
54+
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16) !important;
55+
opacity: 1 !important;
56+
mix-blend-mode: normal !important;
57+
}
58+
59+
.testimonials-section .testimonial-author-name,
60+
.testimonials-section .testimonial-author-role {
61+
color: #111827 !important;
62+
-webkit-text-fill-color: #111827 !important;
63+
opacity: 1 !important;
64+
mix-blend-mode: normal !important;
65+
text-shadow: none !important;
66+
}
67+
68+
.testimonials-section .testimonial-author-name {
69+
color: #111827;
70+
-webkit-text-fill-color: #111827;
71+
text-shadow: none;
72+
opacity: 1;
73+
mix-blend-mode: normal;
74+
font-weight: 900;
75+
}
76+
77+
.testimonials-section .testimonial-author-role {
78+
color: #334155;
79+
-webkit-text-fill-color: #334155;
80+
opacity: 1;
81+
mix-blend-mode: normal;
82+
}
83+
884
/* You can override the default Infima variables here. */
985
@import "tailwindcss";
1086

@@ -2099,7 +2175,7 @@ html[data-theme="dark"] {
20992175
}
21002176

21012177
/* TOC inner wrapper — sticky */
2102-
.blog-wrapper .col.col--2 > div {
2178+
.blog-wrapper .col.col--2>div {
21032179
position: sticky !important;
21042180
top: calc(var(--ifm-navbar-height, 60px) + 1rem) !important;
21052181
max-height: calc(100vh - var(--ifm-navbar-height, 60px) - 2rem) !important;
@@ -2232,7 +2308,7 @@ html[data-theme="dark"] .blog-post-page .markdown {
22322308
border-left: none !important;
22332309
}
22342310

2235-
.blog-wrapper .col.col--2 > div {
2311+
.blog-wrapper .col.col--2>div {
22362312
position: static !important;
22372313
max-height: none !important;
22382314
overflow-y: visible !important;

0 commit comments

Comments
 (0)