fix(theme): allow background image to show in dark mode and IDE themes

This commit is contained in:
lxk955 authored and GitHub committed 2026-10-04 16:37:28 +08:00
1 parent 7bb0431470
commit 024dc757a8
6 files changed
+39 -7

No files matched your search

+12
View File
@@ -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", () => {
@@ -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,
},