Skip to content

Build your personal knowledge base with Trilium Notes

client/icon pack/preview: fix Chromium's scrollbar color on dark theme

Adorian Doranf2ad790b36d9
diff --git a/apps/client/src/widgets/react/IsolatedFrame.tsx b/apps/client/src/widgets/react/IsolatedFrame.tsx
index c1705b87b3..4bff36e282 100644
--- a/apps/client/src/widgets/react/IsolatedFrame.tsx
+++ b/apps/client/src/widgets/react/IsolatedFrame.tsx
@@ -50,7 +50,9 @@ export default function IsolatedFrame({ className, title, css, cssVars, bodyClas
style.id = "isolated-frame-style";
doc.head.appendChild(style);
}
- style.textContent = `${buildRootVars(cssVars)}${css ?? ""}`;
+ // Forward the app's color scheme so the frame's UA-painted elements (scrollbars, form
+ // controls) match the theme instead of defaulting to light.
+ style.textContent = `:root { color-scheme: ${colorScheme}; }\n${buildRootVars(cssVars)}${css ?? ""}`;
}, [ css, cssVars, colorScheme, body ]);
useLayoutEffect(() => {