Skip to content

feat(vscode): allow switching between built-in theme and inheriting VS Code theme#179

Open
Evoludo wants to merge 6 commits into
MoonshotAI:mainfrom
Evoludo:feature/inherit-vscode-theme
Open

feat(vscode): allow switching between built-in theme and inheriting VS Code theme#179
Evoludo wants to merge 6 commits into
MoonshotAI:mainfrom
Evoludo:feature/inherit-vscode-theme

Conversation

@Evoludo

@Evoludo Evoludo commented May 4, 2026

Copy link
Copy Markdown

PR Summary

This PR adds a kimi.themeMode setting that allows the extension's webview to optionally inherit VSCode's native theme colors instead of the built-in shadcn palette. It fixes a root cause where an unlayered * { border-color: var(--border); } rule was overriding all Tailwind border utilities, causing bright borders in high-contrast themes. The fix makes default borders transparent in VSCode mode while preserving explicit colored borders, adds computed color-mix hover highlights for buttons and menu items (replacing near-invisible bg-muted/50), and updates key components to use theme-mapped backgrounds instead of hardcoded zinc colors.

Changes

  • Added kimi.themeMode setting and .vscode-theme CSS variable mappings to --vscode-* colors
  • Fixed unlayered * border rule that was stomping Tailwind utilities; default borders are now transparent in VSCode mode
  • Added color-mix(in oklch, var(--foreground) 20%, var(--background)) hover tint to buttons, dropdown items, command items, session items, tool headers, thinking headers, and plan mode button
  • Updated token bar → theme border; input area / thinking / tool blocks → bg-input; user bubbles → bg-muted
  • Removed dark:hover:bg-muted/50 and dark:hover:bg-input/50 from shadcn button variants for consistent cross-theme hover

Resolves #162

Evoludo added 3 commits May 5, 2026 02:02
…heme mode intact

Revert component-level className changes that leaked into the built-in theme:
- ChatMessage bubbles: bg-muted -> bg-zinc-100 dark:bg-zinc-800
- ChatStatus: border-[var(--border)] -> border-border/40
- ThinkingBlock: bg-input -> original zinc colors/borders
- ToolCallCard: bg-input -> border border-border
- InputArea: bg-input -> border border-input
- button.tsx: restore dark:hover variants for outline/ghost

Instead, apply VSCode-specific styling via .vscode-theme CSS overrides
that target harmless wrapper classes (thinking-block, tool-call-card,
input-area-wrapper, user-message-bubble, steer-bubble, chat-status-bar).
These classes are no-ops in built-in mode.

This ensures the built-in theme remains pixel-identical to main while
vscode theme mode continues to work as intended.
@Evoludo

Evoludo commented May 4, 2026

Copy link
Copy Markdown
Author

Ah, looks like I broke the built-in theme with this. I'll revert it to original styling while in built-in mode.

Evoludo added 3 commits May 5, 2026 03:07
…s instead

The previous commit changed ToolRenderers classNames globally (zinc →
theme vars) which leaked into the built-in theme. Revert all styling
classes back to their original zinc values and add wrapper classes
instead:

- tool-codeblock (CodeBlock root)
- codeblock-expand (expand button)
- data-todo-status=done/empty (todo icons)

Add corresponding .vscode-theme CSS overrides in index.css so the
VSCode theme mode still gets proper theme colours while the built-in
theme remains pixel-identical to main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否让 kimi code 的 vscode 插件继承 vscode 主题的颜色?

1 participant