diff --git a/apps/desktop/src/composables/__tests__/useBackgroundImageLifecycle.spec.ts b/apps/desktop/src/composables/__tests__/useBackgroundImageLifecycle.spec.ts
index a042be59a2..b2a9679d0a 100644
--- a/apps/desktop/src/composables/__tests__/useBackgroundImageLifecycle.spec.ts
+++ b/apps/desktop/src/composables/__tests__/useBackgroundImageLifecycle.spec.ts
@@ -429,4 +429,18 @@ describe("background image theme and scope lifecycle", () => {
expect(createObjectURL).toHaveBeenCalledTimes(1);
expect(revokeObjectURL).not.toHaveBeenCalled();
});
+
+ it("clears body, #root, outer app shell, welcome screen and CodeMirror scroller in globals.css", async () => {
+ const fs = await import("node:fs");
+ const path = await import("node:path");
+ const globalsCss = fs.readFileSync(path.resolve(__dirname, "../../styles/globals.css"), "utf8");
+ expect(globalsCss).toContain("html.dbx-bg-active,");
+ expect(globalsCss).toContain("html.dbx-bg-active body,");
+ expect(globalsCss).toContain("html.dbx-bg-active #root,");
+ expect(globalsCss).toContain("html.dbx-bg-active [data-app-shell],");
+ expect(globalsCss).toContain("html.dbx-bg-active [data-welcome-screen],");
+ expect(globalsCss).toContain("html.dbx-bg-active .cm-editor,");
+ expect(globalsCss).toContain("html.dbx-bg-active .cm-gutters,");
+ expect(globalsCss).toContain("html.dbx-bg-active .cm-scroller");
+ });
});
diff --git a/apps/desktop/src/lib/__tests__/editorThemes.spec.ts b/apps/desktop/src/lib/__tests__/editorThemes.spec.ts
index c826862302..3475dabd3a 100644
--- a/apps/desktop/src/lib/__tests__/editorThemes.spec.ts
+++ b/apps/desktop/src/lib/__tests__/editorThemes.spec.ts
@@ -194,6 +194,18 @@ describe("Cursor editor theme selection", () => {
expect(wcagContrastRatio(dark.foreground, dark.selection), `cursor-dark text on selection`).toBeGreaterThanOrEqual(3.0);
expect(wcagContrastRatio(light.foreground, light.selection), `cursor-light text on selection`).toBeGreaterThanOrEqual(3.0);
});
+
+ it("does not paint an opaque background on .cm-scroller so background images can show through", async () => {
+ const ideThemes = ["idea-dark", "idea-light", "jetbrains-dark", "jetbrains-light", "cursor-dark", "cursor-light", "claude-dark", "claude-light"] as const;
+
+ for (const theme of ideThemes) {
+ const extension = (await loadEditorTheme(theme, "dark")) as any;
+ const themeFacet = extension[0]?.find((ext: any) => ext?.value?.rules);
+ expect(themeFacet).toBeDefined();
+ const scrollerRule = themeFacet.value.rules.find((r: string) => r.includes(".cm-scroller {") && r.includes("background"));
+ expect(scrollerRule, `${theme} should not set an opaque background on .cm-scroller`).toBeUndefined();
+ }
+ });
});
describe("SQL completion theme", () => {
diff --git a/apps/desktop/src/lib/editor/editorThemes.ts b/apps/desktop/src/lib/editor/editorThemes.ts
index 3fe24ff518..51b7ba7eee 100644
--- a/apps/desktop/src/lib/editor/editorThemes.ts
+++ b/apps/desktop/src/lib/editor/editorThemes.ts
@@ -535,9 +535,6 @@ function createIdeEditorTheme(EditorView: typeof import("@codemirror/view").Edit
[EDITOR_SELECTION_BACKGROUND_CSS_VAR]: c.selection,
[SQL_TABLE_COLOR_CSS_VAR]: c.table,
},
- ".cm-scroller": {
- backgroundColor: c.background,
- },
".cm-content": {
caretColor: c.cursor,
},
diff --git a/apps/desktop/src/styles/globals.css b/apps/desktop/src/styles/globals.css
index 4cf968792d..b91c8a70a9 100644
--- a/apps/desktop/src/styles/globals.css
+++ b/apps/desktop/src/styles/globals.css
@@ -3067,8 +3067,17 @@ body.dbx-is-resizing .panel-resize-handle::before {
CodeMirror themes paint opaque editor backgrounds via EditorView.theme, so
clear them app-wide to let the background image show through. Active line,
selection, and search-highlight layers keep their own translucent colors
- and stay readable on top. */
+ and stay readable on top.
+ Also clear outer body/root/shell wrappers and scrollers so translucent
+ surfaces don't compound opacity over the wallpaper layer. */
+html.dbx-bg-active,
+html.dbx-bg-active body,
+html.dbx-bg-active #root,
+html.dbx-bg-active [data-app-shell],
+html.dbx-bg-active [data-welcome-screen],
html.dbx-bg-active .cm-editor,
-html.dbx-bg-active .cm-gutters {
+html.dbx-bg-active .cm-gutters,
+html.dbx-bg-active .cm-scroller {
background-color: transparent !important;
}
+