Skip to content

Align Everforest themes with official palette - #806

Open
masonmcelvain wants to merge 4 commits into
modem-dev:mainfrom
masonmcelvain:everforest-alignment
Open

Align Everforest themes with official palette#806
masonmcelvain wants to merge 4 commits into
modem-dev:mainfrom
masonmcelvain:everforest-alignment

Conversation

@masonmcelvain

Copy link
Copy Markdown

Problem

The everforest-dark and everforest-light diff colors were stored pre-blended instead of real palette accents. Hunk then composited them a second time causing washed-out output.

Deleted rows in dark mode read purple-grey instead of red and in light mode addedBg was the same as addedContentBg, making word-level diff highlighting invisible.

Official Everforest palette: https://github.com/sainnhe/everforest/blob/master/palette.md

Changes

  • Store Everforest's canonical green/red/blue accents in BUNDLED_SHIKI_THEME_DIFF_COLORS, like every other bundled theme
  • Add a generic BUNDLED_SHIKI_THEME_SURFACES catalog table so a bundled theme can declare its official panel/border/diff/selection surfaces, preferred over Hunk's derived blends in buildShikiTheme
    • Nord, Gruvbox, Solarized, and Kanagawa publish official surfaces too and can adopt the same seam later. Out of scope for this PR

Tests

  • Pin every slot to its exact palette token in tests
  • Regression tests for word-level emphasis separation and red-dominant deleted rows

Caveat

The official Everforest palette sits below Hunk's global WCAG floors, but lowering Hunk's minimums would affect all 65 bundled themes. Certain Everforest slots stay guard-adjusted (e.g. light sign colors, badges, muted) to work around this.

QA

Run hunk diff --theme everforest-dark (then --theme everforest-light) on a changeset with added and removed lines and at least one intra-line edit, and confirm:

  • Deleted rows read red, added rows read green (dark mode previously showed purple-grey deletions).
  • Changed words inside changed lines are visibly highlighted in light mode (previously invisible).
  • Sidebar badges, line numbers, and the selected-hunk highlight stay readable.

Screenshots

v0.19.0 Feature
image image
image image

masonmcelvain and others added 4 commits August 18, 2026 11:51
The stored Everforest diff colors were not palette values: each one was
the real accent pre-blended onto bg0 at ~0xa0/255 alpha (the VS Code
Everforest overview-ruler colors, flattened). Hunk then composited them
onto the background a second time, and four of the six values failed
Hunk's own 3.0 diff-sign contrast guard, whose rescue blend produced
today's washed-out pink/beige output instead of Everforest's red/green.

Store the canonical palette accents like every other bundled theme does:

- everforest-dark: added = green #a7c080, removed = red #e67e80,
  modified = blue #7fbbb3
- everforest-light: added = green #8da101, removed = red #f85552,
  modified = blue #3a94c5

The green/red/blue mapping follows upstream colors/everforest.vim, which
links diffAdded/diffRemoved/diffChanged to Green/Red/Blue and composites
onto bg0 only at paint time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add an optional BUNDLED_SHIKI_THEME_SURFACES table that a bundled theme
can use to declare its own surfaces, preferred over the derived blends in
buildShikiTheme. The table is generic on purpose: Nord, Gruvbox,
Solarized, and Kanagawa also publish official diff/UI surfaces and can
adopt the same seam later.

Context: Hunk derives panel, border, row-tint, and selection surfaces
by blending each theme's accents over its editor background, which can
only ever approximate a palette that ships dedicated surface tokens.
Everforest defines bg_green/bg_red/bg_blue/bg_visual as first-class
colors, and the derived blends landed on different hues: dark deleted
rows read purple-grey (blue channel highest) instead of bg_red, and
everforest-light collapsed addedBg==addedContentBg so word-level diff
emphasis was invisible - the only bundled light theme with that defect.

Populate it for both Everforest themes from the official palette:

- panel = bg1, panelAlt = bg2, border = bg4
- addedBg/removedBg/movedBg = bg_green/bg_red/bg_blue at the hard
  contrast variant; addedContentBg/removedContentBg/accentMuted = the
  same tokens at the default medium variant (DiffAdd/DiffDelete/
  DiffChange); selectedHunk = bg_visual (Visual)
- everforest-dark lineNumberFg = grey2 #9da9a0 (5.12:1 on bg0);
  everforest-light stays guard-derived because no Everforest grey clears
  the 4.5:1 gate on #fdf6e3

Hunk needs two background steps per side (whole changed line, then the
changed words inside it) while Everforest defines one surface per
contrast variant; hard-for-row plus medium-for-content keeps both steps
as real palette tokens, keeps the emphasis step further from the context
background than the row step, and clears the 4.5:1 text gate on both
(medium-row plus soft-content fails that gate on three slots).

Text, muted, line-number, and badge guards now validate against the
declared panel surfaces instead of the neutral blends the theme no
longer uses. Declared surfaces bypass the tint guard because they are
palette facts, not derivations; the whole-catalog contrast tests still
verify them.

Everforest slots that stay guard-adjusted (light sign colors, badges,
muted) do so because the official palette sits below Hunk's global WCAG
floors; lowering those gates would silently change all 65 bundled
themes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assert the exact Everforest token for every slot the declared-surfaces
path now controls, so a future refactor of the blend math cannot
silently drift them. Also pin the two regressions the old pre-dimmed
colors caused: word-level diff emphasis must stay distinct from (and
further from context than) the row tint in both Everforest themes, and
the dark deleted-row background must stay red-dominant rather than the
purple-grey the guard rescue used to produce.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The theme guidance still pointed at src/ui/themes/<theme-id>.ts files,
but that directory only holds types.ts since themes moved to the tables
in src/core/theme/catalog.ts. Describe the catalog tables, including the
new declared-surfaces table, so agents extend the right seam.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@masonmcelvain is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@benvinegar

Copy link
Copy Markdown
Member

That does look better (the after screenshot) - just wondering why it affected this theme and not the others, and why we need a one-off for everforest. Like is there a deeper fix.

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.

2 participants