Skip to content

[Bug]: Importing light and dark theme files together removes their custom CSS #38133

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Prepare two T3 theme JSON files named Aurora Light and Aurora Dark, with their respective appearances and the same custom CSS that adds a visible border to Settings.
  2. Open Settings, then Appearance.
  3. Choose Add theme.
  4. Choose both files together in the file picker.
  5. Select the imported Aurora theme.

Expected behavior

The selected theme applies the custom CSS shared by both imported files.

Actual behavior

The palettes are imported, but the custom CSS is discarded and its visible styling is missing.

paired theme custom css

failure

Impact

Major degradation or frequent failure. People importing matching light and dark T3 theme files together lose their shared custom styling on every such import.

Version or commit

main at 25fada9351. The cause is at apps/web/src/vscodeThemeImport.ts:419.

Environment

Linux x64 boat.dev default machine, a fresh checkout.

Logs or stack traces

8px
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

--- /dev/null
+++ b/scripts/scenarios/theme-batch-pair-keeps-css.e2e.ts
@@ -0,0 +1,50 @@
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+test(
+  "Importing light and dark theme files together keeps their shared custom CSS",
+  WEB,
+  async ({ t3, app, screen, browser }) => {
+    await t3.project("demo");
+    await t3.open("/settings/appearance");
+    await screen.getByRole("button", "Add theme", { exact: true }).tap();
+    const dialog = screen.getByRole("dialog", "Add a theme");
+    await browser.evaluate(() => {
+      const input = document.querySelector<HTMLInputElement>('input[type="file"]');
+      if (!input) throw new Error("Theme file input is missing");
+      const files = new DataTransfer();
+      for (const appearance of ["light", "dark"] as const) {
+        const theme = {
+          version: 1,
+          name: `Aurora ${appearance === "light" ? "Light" : "Dark"}`,
+          appearance,
+          colors: {
+            canvas: appearance === "light" ? "#fafafa" : "#101014",
+            accent: "#6d5ae6",
+          },
+          css: "[data-settings-page-scroll] { outline: 8px solid #ff2d95; outline-offset: -8px; }",
+        };
+        files.items.add(
+          new File([JSON.stringify(theme)], `aurora-${appearance}.json`, {
+            type: "application/json",
+          }),
+        );
+      }
+      input.files = files.files;
+      input.dispatchEvent(new Event("change", { bubbles: true }));
+    });
+    await expect(dialog).toBeHidden();
+    await screen.getByRole("button", "Use Aurora theme", { exact: true }).tap();
+    await app.screenshot("paired-theme-custom-css");
+    await expect
+      .poll(() =>
+        browser.evaluate(() => {
+          const surface = document.querySelector("[data-settings-page-scroll]");
+          if (!surface) throw new Error("Settings surface is missing");
+          return getComputedStyle(surface).outlineWidth;
+        }),
+      )
+      .toBe("8px");
+  },
+);
pnpm scenarios:prove scripts/scenarios/theme-batch-pair-keeps-css.e2e.ts --base main

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions