Skip to content

Commit 10b0e69

Browse files
Copilotthomhurst
andauthored
Fix light mode text contrast in Assertions Library page (#3752)
* Initial plan * Fix light mode text visibility in Assertions Library page Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
1 parent 993c18e commit 10b0e69

File tree

1 file changed

+107
-20
lines changed

1 file changed

+107
-20
lines changed

docs/src/components/AssertionsLibrary/styles.module.css

Lines changed: 107 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,20 @@
2222
}
2323

2424
.header p {
25-
color: #cbd5e1;
25+
color: #64748b;
2626
font-size: 1.1rem;
2727
}
2828

29+
/* Light mode specific styles */
30+
[data-theme='light'] .header p {
31+
color: #64748b;
32+
}
33+
34+
/* Dark mode specific styles */
35+
[data-theme='dark'] .header p {
36+
color: #cbd5e1;
37+
}
38+
2939
.controls {
3040
margin-bottom: 2rem;
3141
}
@@ -39,23 +49,36 @@
3949
max-width: 600px;
4050
padding: 0.875rem 1.25rem;
4151
font-size: 1rem;
42-
background: rgba(20, 184, 166, 0.1);
52+
background: rgba(20, 184, 166, 0.05);
4353
border: 2px solid rgba(20, 184, 166, 0.2);
4454
border-radius: 0.75rem;
45-
color: #f1f5f9;
55+
color: #1e293b;
4656
transition: all 0.2s ease;
4757
display: block;
4858
margin: 0 auto;
4959
}
5060

61+
[data-theme='dark'] .searchInput {
62+
background: rgba(20, 184, 166, 0.1);
63+
color: #f1f5f9;
64+
}
65+
5166
.searchInput:focus {
5267
outline: none;
5368
border-color: #14b8a6;
54-
background: rgba(20, 184, 166, 0.15);
69+
background: rgba(20, 184, 166, 0.08);
5570
box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
5671
}
5772

73+
[data-theme='dark'] .searchInput:focus {
74+
background: rgba(20, 184, 166, 0.15);
75+
}
76+
5877
.searchInput::placeholder {
78+
color: #64748b;
79+
}
80+
81+
[data-theme='dark'] .searchInput::placeholder {
5982
color: #94a3b8;
6083
}
6184

@@ -68,53 +91,76 @@
6891

6992
.categoryButton {
7093
padding: 0.5rem 1rem;
71-
background: rgba(20, 184, 166, 0.1);
94+
background: rgba(20, 184, 166, 0.05);
7295
border: 1px solid rgba(20, 184, 166, 0.2);
7396
border-radius: 0.5rem;
74-
color: #cbd5e1;
97+
color: #334155;
7598
font-weight: 500;
7699
cursor: pointer;
77100
transition: all 0.2s ease;
78101
}
79102

103+
[data-theme='dark'] .categoryButton {
104+
background: rgba(20, 184, 166, 0.1);
105+
color: #cbd5e1;
106+
}
107+
80108
.categoryButton:hover {
81-
background: rgba(20, 184, 166, 0.15);
109+
background: rgba(20, 184, 166, 0.1);
82110
border-color: rgba(20, 184, 166, 0.3);
111+
color: #1e293b;
112+
}
113+
114+
[data-theme='dark'] .categoryButton:hover {
115+
background: rgba(20, 184, 166, 0.15);
83116
color: #f1f5f9;
84117
}
85118

86119
.categoryButton.active {
87120
background: #14b8a6;
88121
border-color: #14b8a6;
89-
color: #0f172a;
122+
color: #ffffff;
90123
font-weight: 600;
91124
}
92125

126+
[data-theme='dark'] .categoryButton.active {
127+
color: #0f172a;
128+
}
129+
93130
.results {
94131
margin-top: 2rem;
95132
}
96133

97134
.resultCount {
98-
color: #94a3b8;
135+
color: #64748b;
99136
font-size: 0.95rem;
100137
margin-bottom: 1.5rem;
101138
text-align: center;
102139
}
103140

141+
[data-theme='dark'] .resultCount {
142+
color: #94a3b8;
143+
}
144+
104145
.assertionsList {
105146
display: grid;
106147
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
107148
gap: 1.5rem;
108149
}
109150

110151
.assertionCard {
111-
background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
112-
border: 1px solid rgba(20, 184, 166, 0.2);
152+
background: linear-gradient(135deg, rgba(20, 184, 166, 0.03) 0%, rgba(14, 165, 233, 0.03) 100%);
153+
border: 1px solid rgba(20, 184, 166, 0.15);
113154
border-radius: 0.75rem;
114155
padding: 1.5rem;
115156
transition: all 0.3s ease;
116157
}
117158

159+
[data-theme='dark'] .assertionCard {
160+
background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
161+
border: 1px solid rgba(20, 184, 166, 0.2);
162+
}
163+
118164
.assertionCard:hover {
119165
transform: translateY(-2px);
120166
border-color: #14b8a6;
@@ -131,44 +177,65 @@
131177
.assertionName {
132178
font-size: 1.25rem;
133179
font-weight: 600;
134-
color: #f1f5f9;
180+
color: #0f172a;
135181
margin: 0;
136182
}
137183

184+
[data-theme='dark'] .assertionName {
185+
color: #f1f5f9;
186+
}
187+
138188
.assertionCategory {
139189
font-size: 0.75rem;
140190
padding: 0.25rem 0.75rem;
141-
background: rgba(20, 184, 166, 0.2);
191+
background: rgba(20, 184, 166, 0.1);
142192
border: 1px solid rgba(20, 184, 166, 0.3);
143193
border-radius: 1rem;
144-
color: #5eead4;
194+
color: #0d9488;
145195
font-weight: 500;
146196
}
147197

198+
[data-theme='dark'] .assertionCategory {
199+
background: rgba(20, 184, 166, 0.2);
200+
color: #5eead4;
201+
}
202+
148203
.assertionDescription {
149-
color: #cbd5e1;
204+
color: #475569;
150205
margin-bottom: 1rem;
151206
font-size: 0.95rem;
152207
line-height: 1.5;
153208
}
154209

210+
[data-theme='dark'] .assertionDescription {
211+
color: #cbd5e1;
212+
}
213+
155214
.assertionSyntax {
156-
background: rgba(15, 23, 42, 0.8);
215+
background: rgba(241, 245, 249, 0.8);
157216
border: 1px solid rgba(20, 184, 166, 0.2);
158217
border-radius: 0.5rem;
159218
padding: 0.75rem;
160219
margin-bottom: 0.75rem;
161220
}
162221

222+
[data-theme='dark'] .assertionSyntax {
223+
background: rgba(15, 23, 42, 0.8);
224+
}
225+
163226
.assertionSyntax code {
164-
color: #a5f3fc;
227+
color: #0c4a6e;
165228
font-family: 'Fira Code', 'Courier New', monospace;
166229
font-size: 0.875rem;
167230
word-break: break-all;
168231
}
169232

233+
[data-theme='dark'] .assertionSyntax code {
234+
color: #a5f3fc;
235+
}
236+
170237
.assertionExample {
171-
background: rgba(168, 85, 247, 0.1);
238+
background: rgba(168, 85, 247, 0.05);
172239
border: 1px solid rgba(168, 85, 247, 0.2);
173240
border-radius: 0.5rem;
174241
padding: 0.75rem;
@@ -177,24 +244,40 @@
177244
gap: 0.5rem;
178245
}
179246

247+
[data-theme='dark'] .assertionExample {
248+
background: rgba(168, 85, 247, 0.1);
249+
}
250+
180251
.exampleLabel {
181-
color: #a855f7;
252+
color: #7c3aed;
182253
font-size: 0.8rem;
183254
font-weight: 600;
184255
text-transform: uppercase;
185256
letter-spacing: 0.05em;
186257
}
187258

259+
[data-theme='dark'] .exampleLabel {
260+
color: #a855f7;
261+
}
262+
188263
.assertionExample code {
189-
color: #e9d5ff;
264+
color: #5b21b6;
190265
font-family: 'Fira Code', 'Courier New', monospace;
191266
font-size: 0.875rem;
192267
word-break: break-all;
193268
}
194269

270+
[data-theme='dark'] .assertionExample code {
271+
color: #e9d5ff;
272+
}
273+
195274
.noResults {
196275
text-align: center;
197276
padding: 3rem 1rem;
277+
color: #64748b;
278+
}
279+
280+
[data-theme='dark'] .noResults {
198281
color: #94a3b8;
199282
}
200283

@@ -205,6 +288,10 @@
205288
.noResults p:first-child {
206289
font-size: 1.1rem;
207290
font-weight: 600;
291+
color: #475569;
292+
}
293+
294+
[data-theme='dark'] .noResults p:first-child {
208295
color: #cbd5e1;
209296
}
210297

0 commit comments

Comments
 (0)