Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
1006dbd
1
Parent(s): cb15587
fix dark mode issue
Browse files
app/src/content/embeds/experiment-overview.html
CHANGED
|
@@ -164,8 +164,8 @@
|
|
| 164 |
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
| 165 |
const textColor = isDark ? 'rgba(255,255,255,0.78)' : 'rgba(0,0,0,0.68)';
|
| 166 |
const mutedText = isDark ? 'rgba(255,255,255,0.35)' : 'rgba(0,0,0,0.30)';
|
| 167 |
-
const linkOpacity = isDark ? 0.20 : 0.
|
| 168 |
-
const linkHoverOpacity = isDark ? 0.50 : 0.
|
| 169 |
const fontSize = Math.max(10, Math.min(14, width / 65));
|
| 170 |
|
| 171 |
const ml = width * 0.005, mr = width * 0.01;
|
|
@@ -362,6 +362,7 @@
|
|
| 362 |
|
| 363 |
if (window.ResizeObserver) new ResizeObserver(() => render()).observe(container);
|
| 364 |
else window.addEventListener('resize', render);
|
|
|
|
| 365 |
render();
|
| 366 |
}
|
| 367 |
};
|
|
|
|
| 164 |
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
| 165 |
const textColor = isDark ? 'rgba(255,255,255,0.78)' : 'rgba(0,0,0,0.68)';
|
| 166 |
const mutedText = isDark ? 'rgba(255,255,255,0.35)' : 'rgba(0,0,0,0.30)';
|
| 167 |
+
const linkOpacity = isDark ? 0.20 : 0.35;
|
| 168 |
+
const linkHoverOpacity = isDark ? 0.50 : 0.65;
|
| 169 |
const fontSize = Math.max(10, Math.min(14, width / 65));
|
| 170 |
|
| 171 |
const ml = width * 0.005, mr = width * 0.01;
|
|
|
|
| 362 |
|
| 363 |
if (window.ResizeObserver) new ResizeObserver(() => render()).observe(container);
|
| 364 |
else window.addEventListener('resize', render);
|
| 365 |
+
new MutationObserver(() => render()).observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
|
| 366 |
render();
|
| 367 |
}
|
| 368 |
};
|