Align Everforest themes with official palette - #806
Open
masonmcelvain wants to merge 4 commits into
Open
Conversation
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>
Contributor
|
PR author is not in the allowed authors list. |
|
@masonmcelvain is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
everforest-darkandeverforest-lightdiff 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
addedBgwas the same asaddedContentBg, making word-level diff highlighting invisible.Official Everforest palette: https://github.com/sainnhe/everforest/blob/master/palette.md
Changes
BUNDLED_SHIKI_THEME_DIFF_COLORS, like every other bundled themeBUNDLED_SHIKI_THEME_SURFACEScatalog table so a bundled theme can declare its official panel/border/diff/selection surfaces, preferred over Hunk's derived blends inbuildShikiThemeTests
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:Screenshots