Skip to content

feat(ui): calibrate GUI themes for WCAG 2.2 and add 6 new themes (opencode#66521, #66528) - #1296

Merged
Hona merged 1 commit into
devfrom
upstream-g/themes-wcag-and-new
Nov 26, 2026
Merged

Hona merged 1 commit into
devfrom
upstream-g/themes-wcag-and-new

Conversation

@Hona

@Hona Hona commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Port official GUI theme updates from anomalyco/opencode dev (opencode#66521 and opencode#66528):

  • WCAG 2.2 contrast and elevation calibration (opencode#66521, 5e000543a6): regenerated apps/desktop/assets/themes.json from the calibrated OKLCH 13-step neutral scale, contrast-calibrated hue ramps, WCAG 2.2 foreground hierarchy (text-base >= 7:1, text-muted >= 4.5:1, text-faint >= 3:1, text-accent / state badges / contrast controls >= 4.5:1, border-focus >= 3:1), and v1CodeAndDiffBridge (aligning code blocks background-stronger to background-bg-layer-01 and contrast-checking syntax colors on non-default themes).
  • Six new bundled themes (opencode#66528, 04eccc3012): added alabaster (Alabaster), cyberdream (Cyberdream), modus (Modus), oxocarbon (Oxocarbon), poimandres (Poimandres), and vscode (VS Code) in alphabetical picker order after oc-2 (OpenCode): 36 -> 42 themes total.
  • apps/desktop/tools/themes.ts: updated token resolution to merge { ...v1, ...v2 } matching official's :root CSS cascade (packages/ui/src/theme/context.tsx) so unprefixed v1CodeAndDiffBridge overrides from resolveThemeVariantV2 take precedence over v1 defaults while keeping oc-2 untouched, and included the calibrated theme tokens read directly by the UI (blue-400, blue-700, blue-1100, grey-500, grey-700, red-900, yellow-900, icon-weak-base, icon-warning-base).

Note on packages/ui/src/theme/context.tsx root background update in opencode#66521: our desktop shell already fills the window background and caption color from p.bg_deep (background-bg-deep), so non-default themes pick up the calibrated root background automatically.

Verification

  • CI: run 45763334613 on exact head 8516e08350 - guardrails, build-macos, build-windows (x64), build-windows (arm64), and build-linux (x64) passed (Linux arm64 skipped).
  • Static checks: all 42 themes in apps/desktop/assets/themes.json parse cleanly, every value is a valid #rrggbbaa hex or an existing alpha-* palette entry in apps/desktop/assets/theme.json, all existing oc-2 tokens are unchanged, and all 41 non-default themes x 2 modes (82 variants) pass every WCAG 2.2 contrast and background-stronger == background-bg-layer-01 check from packages/ui/src/theme/v2/resolve.test.ts.
  • Headless verification (Windows x64 CI build from run 45763334613, fixture, no server; before = c1360881ed): all 5 cases passed:
    1. Theme picker lists all 42 themes: Settings > Appearance > Theme picker lists 42 items (OpenCode first, rest alphabetical), including all 6 new themes (Alabaster, Cyberdream, Modus, Oxocarbon, Poimandres, VS Code). Before: 36 items, none of the 6 present.
    2. New light themes render with calibrated palette: Alabaster light bg_deep #f1f1f1ff, bg_base #f7f7f7ff (before: #fafafaff / #ffffffff oc-2 fallback); Modus light bg_deep #f9f9f9ff, bg_base #ffffffff.
    3. New dark themes render with calibrated palette: Cyberdream #0b0d0eff / #16181aff (code #232527ff); Oxocarbon #0a0b0bff / #161617ff (code #232324ff); Poimandres #10121aff / #1b1e28ff (code #272a35ff); VS Code #131313ff / #1f1f1fff (code #2b2b2bff).
    4. Calibrated non-default dark themes and elevated code blocks: Everforest #21282dff / #2d353bff / code #353d43ff (before: #1a2228ff / #1c252bff / code #1a2228ff); Dracula #11121bff / #1d1e28ff / code #292a34ff (before: #12131cff / #151720ff / code #12131cff); Tokyo Night #0f0f19ff / #1a1b26ff / code #262733ff (before: #10111aff / #13141eff / code #10111aff).
    5. Default oc-2 theme unchanged: bit-identical PNG renders vs c1360881ed (oc-2 dark: 83320/83320 bytes; oc-2 light: 83442/83442 bytes).

@Hona
Hona marked this pull request as ready for review November 26, 2026 06:17
@Hona
Hona merged commit 16fe80d into dev Nov 26, 2026
7 checks passed
@Hona
Hona deleted the upstream-g/themes-wcag-and-new branch November 26, 2026 06:17
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