Skip to content

Commit 5a0b6dd

Browse files
committed
Merge branch 'fix-css-darkmode' into 'main'
Fix CSS for darkmode See merge request ExplorViz/code/code-agent!12
2 parents f71a268 + 5aae85a commit 5a0b6dd

2 files changed

Lines changed: 35 additions & 75 deletions

File tree

src/main/resources/META-INF/resources/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ <h2>Analysis Configuration</h2>
249249
Landscape Token
250250
<span class="tooltip-container">
251251
<span class="tooltip-icon">?</span>
252-
<span class="tooltip-text">The landscape token for the ExplorViz.</span>
252+
<span class="tooltip-text">The landscape token for the ExplorViz software landscape.</span>
253253
</span>
254254
</span>
255255
<input name="landscapeToken" placeholder="mytokenvalue" type="password" />

src/main/resources/META-INF/resources/styles.css

Lines changed: 34 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
BlinkMacSystemFont,
88
sans-serif;
99
--accent: #0b5fff;
10-
--surface: rgba(255, 255, 255, 0.08);
11-
--border: rgba(0, 0, 0, 0.1);
10+
--surface: light-dark(rgba(255, 255, 255, 0.08), rgba(128, 164, 255, 0.08));
11+
--border: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.08));
12+
--card-bg: light-dark(#ffffff, rgba(8, 10, 20, 0.75));
13+
--text-primary: light-dark(#111, #f3f6ff);
14+
--text-secondary: light-dark(rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.7));
15+
--status-success: light-dark(#0a6b2a, #7dffb1);
16+
--status-success-border: #2ac769;
17+
--status-error: light-dark(#981b1b, #ff9595);
18+
--status-error-border: #ff5c5c;
1219
}
1320

1421
* {
@@ -19,14 +26,7 @@ body {
1926
margin: 0;
2027
min-height: 100vh;
2128
background: radial-gradient(circle at top, #f4f7ff 0%, #e9edf7 35%, #f7f9ff 70%, #fff 100%);
22-
color: #111;
23-
}
24-
25-
body.dark {
26-
background: radial-gradient(circle at top, #202536 0%, #151828 65%, #080912 100%);
27-
color: #f3f6ff;
28-
--surface: rgba(255, 255, 255, 0.05);
29-
--border: rgba(255, 255, 255, 0.08);
29+
color: var(--text-primary);
3030
}
3131

3232
main {
@@ -37,11 +37,6 @@ main {
3737

3838
header {
3939
margin-bottom: 2rem;
40-
display: flex;
41-
flex-wrap: wrap;
42-
gap: 1rem;
43-
align-items: flex-end;
44-
justify-content: space-between;
4540
}
4641

4742
h1 {
@@ -51,13 +46,8 @@ h1 {
5146

5247
p.subtitle {
5348
margin: 0.35rem 0 0;
54-
max-width: 640px;
5549
font-size: 1rem;
56-
color: rgba(0, 0, 0, 0.7);
57-
}
58-
59-
body.dark p.subtitle {
60-
color: rgba(255, 255, 255, 0.7);
50+
color: var(--text-secondary);
6151
}
6252

6353
form {
@@ -69,16 +59,11 @@ section.card {
6959
padding: 1.5rem;
7060
border-radius: 1rem;
7161
border: 1px solid var(--border);
72-
background-color: rgba(255, 255, 255, 0.9);
62+
background-color: var(--card-bg);
7363
box-shadow: 0 20px 45px -35px rgba(15, 23, 42, 0.6);
7464
backdrop-filter: blur(6px);
7565
}
7666

77-
body.dark section.card {
78-
background-color: rgba(8, 10, 20, 0.75);
79-
box-shadow: 0 20px 45px -35px rgba(5, 5, 10, 0.9);
80-
}
81-
8267
section.card h2 {
8368
margin: 0 0 1rem;
8469
font-size: 1.25rem;
@@ -105,20 +90,12 @@ select {
10590
border: 1px solid var(--border);
10691
padding: 0.65rem 0.85rem;
10792
font: inherit;
108-
background: rgba(255, 255, 255, 0.82);
93+
background: light-dark(rgba(255, 255, 255, 0.82), rgba(12, 14, 22, 0.85));
10994
transition:
11095
border-color 0.2s ease,
11196
box-shadow 0.2s ease;
11297
}
11398

114-
body.dark input,
115-
body.dark textarea,
116-
body.dark select {
117-
background: rgba(12, 14, 22, 0.85);
118-
border-color: rgba(255, 255, 255, 0.08);
119-
color: inherit;
120-
}
121-
12299
input:focus,
123100
textarea:focus,
124101
select:focus {
@@ -191,21 +168,13 @@ button.primary:hover:not(:disabled) {
191168
}
192169

193170
.status.success {
194-
border-color: #2ac769;
195-
color: #0a6b2a;
196-
}
197-
198-
body.dark .status.success {
199-
color: #7dffb1;
171+
border-color: var(--status-success-border);
172+
color: var(--status-success);
200173
}
201174

202175
.status.error {
203-
border-color: #ff5c5c;
204-
color: #981b1b;
205-
}
206-
207-
body.dark .status.error {
208-
color: #ff9595;
176+
border-color: var(--status-error-border);
177+
color: var(--status-error);
209178
}
210179

211180
details summary {
@@ -214,16 +183,6 @@ details summary {
214183
margin-bottom: 0.5rem;
215184
}
216185

217-
footer {
218-
margin-top: 3rem;
219-
font-size: 0.9rem;
220-
color: rgba(0, 0, 0, 0.65);
221-
}
222-
223-
body.dark footer {
224-
color: rgba(255, 255, 255, 0.55);
225-
}
226-
227186
/* Tooltip styles */
228187
.tooltip-container {
229188
display: inline-flex;
@@ -251,8 +210,8 @@ body.dark footer {
251210
.tooltip-text {
252211
visibility: hidden;
253212
width: 220px;
254-
background-color: #1e293b;
255-
color: #f8fafc;
213+
background-color: light-dark(#f8fafc, #1e293b);
214+
color: light-dark(#0f172a, #f8fafc);
256215
text-align: left;
257216
border-radius: 0.5rem;
258217
padding: 0.75rem;
@@ -291,15 +250,6 @@ body.dark footer {
291250
transform: translateX(-50%) translateY(-5px);
292251
}
293252

294-
body.dark .tooltip-text {
295-
background-color: #f8fafc;
296-
color: #0f172a;
297-
}
298-
299-
body.dark .tooltip-text::after {
300-
border-color: #f8fafc transparent transparent transparent;
301-
}
302-
303253
.label-header {
304254
display: flex;
305255
align-items: center;
@@ -327,15 +277,11 @@ body.dark .tooltip-text::after {
327277
}
328278

329279
.examples-table th {
330-
background: rgba(0, 0, 0, 0.03);
280+
background: light-dark(rgba(0, 0, 0, 0.03), rgba(255, 255, 255, 0.03));
331281
font-weight: 600;
332282
color: var(--accent);
333283
}
334284

335-
body.dark .examples-table th {
336-
background: rgba(255, 255, 255, 0.03);
337-
}
338-
339285
.examples-table tr:last-child td {
340286
border-bottom: none;
341287
}
@@ -347,3 +293,17 @@ body.dark .examples-table th {
347293
border-radius: 0.35rem;
348294
font-family: ui-monospace, monospace;
349295
}
296+
297+
@media (prefers-color-scheme: dark) {
298+
body {
299+
background: radial-gradient(circle at top, #202536 0%, #151828 65%, #080912 100%);
300+
}
301+
302+
section.card {
303+
box-shadow: 0 20px 45px -35px rgba(5, 5, 10, 0.9);
304+
}
305+
306+
.tooltip-text::after {
307+
border-color: #f8fafc transparent transparent transparent;
308+
}
309+
}

0 commit comments

Comments
 (0)