Skip to content

Commit 1d93821

Browse files
MDA2AVclaude
andcommitted
Improve table row styling: darker borders, theme-adaptive highlights
Use CSS selectors (html.dark) instead of JS-computed colors so all table styles — borders, hover, row highlight, scrollbar, link color — adapt automatically when toggling between light and dark mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1d944fd commit 1d93821

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

docs/static/probe/render.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,31 @@ window.ProbeRender = (function () {
1212
function injectScrollStyle() {
1313
if (scrollStyleInjected) return;
1414
scrollStyleInjected = true;
15-
var isDark = document.documentElement.classList.contains('dark');
16-
var trackBg = isDark ? '#2a2f38' : '#e5e7eb';
17-
var thumbBg = isDark ? '#4b5563' : '#94a3b8';
18-
var thumbHover = isDark ? '#6b7280' : '#64748b';
19-
var borderColor = isDark ? '#30363d' : '#d0d7de';
20-
var rowHoverBg = isDark ? '#161b22' : '#f6f8fa';
21-
var rowActiveBg = isDark ? '#1c2333' : '#ddf4ff';
22-
var linkColor = isDark ? '#58a6ff' : '#0969da';
23-
var css = '.probe-scroll{overflow-x:auto}'
15+
var css = ''
16+
// Scrollbar — light
17+
+ '.probe-scroll{overflow-x:auto;scrollbar-width:thin;scrollbar-color:#94a3b8 #e5e7eb}'
2418
+ '.probe-scroll::-webkit-scrollbar{height:8px}'
25-
+ '.probe-scroll::-webkit-scrollbar-track{background:' + trackBg + ';border-radius:4px}'
26-
+ '.probe-scroll::-webkit-scrollbar-thumb{background:' + thumbBg + ';border-radius:4px}'
27-
+ '.probe-scroll::-webkit-scrollbar-thumb:hover{background:' + thumbHover + '}'
28-
+ '.probe-scroll{scrollbar-width:thin;scrollbar-color:' + thumbBg + ' ' + trackBg + '}'
29-
+ '.probe-table thead{border-bottom:2px solid ' + borderColor + '}'
30-
+ '.probe-table tbody tr{border-bottom:1px solid ' + borderColor + '}'
19+
+ '.probe-scroll::-webkit-scrollbar-track{background:#e5e7eb;border-radius:4px}'
20+
+ '.probe-scroll::-webkit-scrollbar-thumb{background:#94a3b8;border-radius:4px}'
21+
+ '.probe-scroll::-webkit-scrollbar-thumb:hover{background:#64748b}'
22+
// Scrollbar — dark
23+
+ 'html.dark .probe-scroll{scrollbar-color:#4b5563 #2a2f38}'
24+
+ 'html.dark .probe-scroll::-webkit-scrollbar-track{background:#2a2f38}'
25+
+ 'html.dark .probe-scroll::-webkit-scrollbar-thumb{background:#4b5563}'
26+
+ 'html.dark .probe-scroll::-webkit-scrollbar-thumb:hover{background:#6b7280}'
27+
// Table rows — light
28+
+ '.probe-table thead{border-bottom:2px solid #afb8c1}'
29+
+ '.probe-table tbody tr{border-bottom:1px solid #afb8c1}'
3130
+ '.probe-server-row{cursor:pointer;transition:background 0.15s}'
32-
+ '.probe-server-row:hover{background:' + rowHoverBg + '}'
33-
+ '.probe-server-row.probe-row-active{background:' + rowActiveBg + ' !important}'
34-
+ '.probe-table thead a{color:' + linkColor + ' !important;text-decoration:underline !important;text-underline-offset:2px}';
31+
+ '.probe-server-row:hover{background:#eef1f5}'
32+
+ '.probe-server-row.probe-row-active{background:#c8ddf0 !important}'
33+
+ '.probe-table thead a{color:#0969da !important;text-decoration:underline !important;text-underline-offset:2px}'
34+
// Table rows — dark
35+
+ 'html.dark .probe-table thead{border-bottom-color:#30363d}'
36+
+ 'html.dark .probe-table tbody tr{border-bottom-color:#30363d}'
37+
+ 'html.dark .probe-server-row:hover{background:#161b22}'
38+
+ 'html.dark .probe-server-row.probe-row-active{background:#2a3a50 !important}'
39+
+ 'html.dark .probe-table thead a{color:#58a6ff !important}';
3540
var style = document.createElement('style');
3641
style.textContent = css;
3742
document.head.appendChild(style);

0 commit comments

Comments
 (0)