Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

4.7 KB
Raw Blame
/*
 * Editor integration layer. The shared palette ships its own light and dark
 * values keyed off a `.dark` root class, which the theme runtime toggles from
 * the editor's theme; the panels deliberately keep that brand palette instead
 * of remapping every token onto --vscode-* (a full remap flattens the data
 * visualizations into editor grays). Only the pieces that must match the
 * editor chrome are bridged here: typography, neutral grounds, text, borders
 * and the focus ring. Semantic (health/risk) and data colours stay Repowise.
 */

:root {
  --font-sans: var(--vscode-font-family, ui-sans-serif, system-ui, sans-serif);
  --font-mono: var(--vscode-editor-font-family, ui-monospace, monospace);

  /* The knowledge-graph card texture layers a ruled-paper photo served from
     the web app's public folder; that path 404s inside a packaged webview.
     Drop the photo layer and render solid node cards instead (no bundled
     asset, no failed request). The .dark override below matches. */
  --kg-card-texture: none;
}

.dark {
  --kg-card-texture: none;
}

/*
 * Native neutrals. The runtime stamps `native` on the root only while the Home
 * switcher is on "auto"; pinning light or dark drops it, so a pinned choice
 * shows the Repowise palette and auto follows the editor theme (light, dark
 * and high contrast alike, since the --vscode-* values already resolve per
 * theme). The sidebar Home view sits on the sidebar ground, panels on the
 * editor ground.
 */
.native {
  --color-bg-root: var(--vscode-editor-background);
  --color-bg-surface: var(--vscode-editorWidget-background, var(--vscode-editor-background));
  --color-bg-elevated: var(--vscode-editorWidget-background, var(--vscode-editor-background));
  --color-bg-inset: var(--vscode-input-background, var(--vscode-editor-background));
  --color-bg-inset-on-overlay: var(--vscode-input-background, var(--vscode-editor-background));
  --color-bg-wash-hover: var(--vscode-list-hoverBackground);
  /* Selected rows and chips follow list selection; inactive when unfocused. */
  --color-bg-selected: var(--vscode-list-inactiveSelectionBackground, var(--vscode-list-activeSelectionBackground));
  --color-bg-selected-hover: var(--vscode-list-activeSelectionBackground, var(--vscode-list-hoverBackground));
  --color-border-default: var(--vscode-panel-border, var(--vscode-widget-border, currentColor));
  --color-text-primary: var(--vscode-foreground);
  --color-text-secondary: var(--vscode-descriptionForeground, var(--vscode-foreground));
  /* Same source as secondary; faded so the three tiers stay distinct. */
  --color-text-tertiary: color-mix(in srgb, var(--vscode-descriptionForeground, var(--vscode-foreground)) 70%, transparent);
}

.native[data-view="home"] {
  --color-bg-root: var(--vscode-sideBar-background, var(--vscode-editor-background));
}

/*
 * High contrast, both kinds. The theme runtime stamps `hc` on the root under
 * `vscode-high-contrast` and `vscode-high-contrast-light`, which previously
 * fell through to the ordinary dark and light ramps: someone who explicitly
 * asked for high contrast got the standard rgba(255,255,255,.07) hairlines and
 * the standard tertiary text.
 *
 * The brand palette is kept rather than remapped onto --vscode-*, for the same
 * reason the bridge above refuses the full remap and one more. Editor greys
 * have no vocabulary for a health band, and green/amber/red on this surface
 * carry one — a remap would trade contrast for making the map, the legend and
 * every score unreadable as data. What is bridged is the part VS Code does
 * define for this purpose: contrastBorder, contrastActiveBorder and
 * focusBorder are set only by high-contrast themes, so the fallbacks below
 * never fire outside one.
 *
 * Tertiary text is lifted to secondary rather than to a literal, so it follows
 * the ramp instead of pinning a copy of it.
 */
.hc {
  --color-border-default: var(--vscode-contrastBorder, currentColor);
  --color-border-hover: var(--vscode-contrastActiveBorder, var(--color-text-primary));
  --color-text-tertiary: var(--color-text-secondary);
}

/* One focus ring everywhere, in the editor's own focus colour. */
:focus-visible {
  outline: 1px solid var(--vscode-focusBorder, currentColor);
  outline-offset: 2px;
}

/* HC themes mark the selected item with an outline, not a tint. */
.hc [aria-current="page"],
.hc [aria-selected="true"],
.hc [aria-pressed="true"] {
  outline: 1px solid var(--vscode-contrastActiveBorder, currentColor);
  outline-offset: -1px;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--color-bg-root);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
}

#root {
  height: 100%;
}

/* The sidebar is ~300px wide; its body copy matches native tree rows. */
[data-view="home"] body {
  font-size: 12px;
}