Repository navigation
Conversation
Themes define diff colors too inconsistently to rely on (missing keys, translucent gutter colors, git decoration colors that aren't green or red), so the old fallback chain produced washed-out or invisible highlights in many themes. Take only the editor foreground, background, selection, and hunk header colors from the theme. Added/removed lines and changed words use fixed green/red accents as translucent tints, so they sit on any theme background, with stronger changed-word highlights. Changed lines within diffed patch files are colored by mixing the accents with the theme foreground instead of a stacked background. Drops chroma-js, which was only used for theme color math.
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Changed lines get a bar in the accent at the left edge of the row, which lets their tint be lighter so syntax colors stay readable on it. Changed words get a lighter tint with an underline instead of a strong rounded fill.
jpenilla
force-pushed
the
fix/diff-colors
branch
from
October 27, 2026 03:00
2a282c6 to
ea2ae0b
Compare
jpenilla
marked this pull request as ready for review
October 27, 2026 03:03
This branch was successfully deployed
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.
Themes define diff colors too inconsistently to rely on: many are missing the keys entirely, gutter colors are often translucent, and git decoration colors aren't always green/red (gruvbox uses cream and near-black, Slack uses yellow). The old fallback chain worked around this per color, and still produced washed-out or invisible highlights in many themes. Changed-word highlights in particular were nearly invisible in dark mode.
Now the theme only provides the editor foreground, background, selection, and hunk header colors. Diff colors are our own:
Known limitation: syntax colors close in hue to the accent (e.g. a purple token on a removed line) can still be harder to read on changed-word highlights. Fixing that properly means adjusting token colors per background, which is left for later.
Also drops chroma-js, which was only used for the theme color math.
Screenshots
Before on the left, after on the right.