Skip to content

feat: add github dark mode variant switchable in user settings#10002

Draft
Guilhem-lm wants to merge 1 commit into
mainfrom
glm/dark-mode
Draft

feat: add github dark mode variant switchable in user settings#10002
Guilhem-lm wants to merge 1 commit into
mainfrom
glm/dark-mode

Conversation

@Guilhem-lm

Copy link
Copy Markdown
Contributor

Summary

Adds a GitHub dark theme variant alongside the existing dark mode, switchable per-user from User settings → Theme → Dark variant (Default / GitHub). The choice is persisted client-side and applied on load. The variant retints the whole app chrome — surfaces, sidebar rail, splitpanes, borders — and the Monaco editors, using GitHub's dark palette.

How it works

The default dark theme is baked into html.dark { … } at build time. To support a second dark theme switchable at runtime with no rebuild, the variant is layered as html.dark.github-dark { … } (higher specificity) that re-emits the color variables. A github-dark class lives permanently on <html> (via a small localStorage-backed helper), gated on .dark so it's inert in light mode.

Changes

  • tokens.json — new github-dark token set (same 33 keys as the default dark set).
  • tailwind.config.cjs — generates the github-dark CSS variables under html.dark.github-dark; adds a theme-driven --sidebar-bg-dark var; converts the hardcoded .dark .splitpanes__pane / __splitter backgrounds to rgb(var(--color-…)) so they follow the active theme (behavior-identical for light/dark).
  • darkModeVariant.ts (new) — get/set/applyDarkModeVariant helper: reads/writes dark-mode-variant in localStorage and toggles the github-dark class.
  • (root)/+layout.svelte — applies the variant on load.
  • UserSettings.svelte — Default/GitHub toggle in the Theme row (visible in both light and dark).
  • vscode.ts / EditorTheme.svelte / utils.ts — matching github-dark Monaco editor theme; editor theme selection centralized in getEditorTheme(); getCssColor gains a hex-github-dark format. Switching the variant retints open editors live via the existing DarkModeObserver.
  • ScriptEditor.svelte — editor wrapper dark:bg-[#272D38]dark:bg-surface-secondary so it adapts.
  • sidebarChrome.tsSIDEBAR_BG_DARKvar(--sidebar-bg-dark) so the rail adapts across variants.

Test plan

  • In dark mode, open User settings → Theme and toggle Dark variant between Default and GitHub; confirm surfaces, sidebar rail, and splitpanes panes/splitters repaint to the GitHub palette with no reload.
  • Reload and confirm the choice persists.
  • With a script/flow editor open, flip the variant and confirm the Monaco editor retints to the github-dark theme live.
  • Toggle dark mode off/on while "GitHub" is selected; confirm the variant is inert in light mode and re-activates in dark.
  • Confirm the Default variant and light mode are visually unchanged.

Screenshots

Not attached — the Playwright MCP screenshot tool repeatedly exceeded its 5s call limit on the running dev server in this session (page reached "fonts loaded" then the encode ran past the cap). The UI was verified instead by reading computed --color-* variables and rendered backgroundColor/boxShadow across all three themes (light / default dark / github dark), including the sidebar rail, splitpanes panes, the separator, and the Monaco editor background. I'll add screenshots once the tooling recovers.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7bd8101
Status: ✅  Deploy successful!
Preview URL: https://752d48ad.windmill.pages.dev
Branch Preview URL: https://glm-dark-mode.windmill.pages.dev

View logs

@Guilhem-lm Guilhem-lm force-pushed the glm/dark-mode branch 9 times, most recently from cf01981 to e0aa04a Compare July 8, 2026 08:57
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant