Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

fix(panel): ask the theme whether it is dark, not a dropped class

Shahriar2fad77b6a3b3
diff --git a/src/extension/assets/globals.css b/src/extension/assets/globals.css
index 4a6fbc7..b2ea018 100644
--- a/src/extension/assets/globals.css
+++ b/src/extension/assets/globals.css
@@ -1,7 +1,9 @@
@import "tailwindcss";
@import "tw-animate-css";
-@custom-variant dark (&:is(.dark *));
+/* Every theme but Daylight is a dark one, so `dark:` asks that rather than
+ tracking a class — a new dark theme needs no edit here. */
+@custom-variant dark (&:not([data-theme='daylight'] *));
/*
* Browsentic — the landing page’s palette, at panel scale.
diff --git a/src/lib/bridge/theme.ts b/src/lib/bridge/theme.ts
index 94013a6..aed37c2 100644
--- a/src/lib/bridge/theme.ts
+++ b/src/lib/bridge/theme.ts
@@ -22,12 +22,13 @@ export function asTheme(value: unknown): ThemeId {
return THEMES.some((theme) => theme.id === value) ? (value as ThemeId) : DEFAULT_THEME;
}
-/* index.html paints an inline ground so the frame before the stylesheet is not
- white; an inline colour outranks every rule, so hand it back to the sheet. */
export async function readTheme(): Promise<ThemeId> {
return asTheme((await browser.storage.local.get(THEME_KEY))[THEME_KEY]);
}
+/* Clearing the inline colour hands the ground back to the stylesheet: index.html
+ paints one so the frame before the sheet lands is not white, and an inline
+ colour outranks every rule that would later repaint it. */
export function applyTheme(theme: ThemeId) {
document.documentElement.dataset.theme = theme;
document.documentElement.style.backgroundColor = '';