Resume
← Blog

2026.11.06 · 4 min · git · tooling · css · open source

OmniDiff: see the one class that changed.

Change one Tailwind class and plain git diff marks the whole className line. OmniDiff v0.3.0 reads the class list and marks only the class that changed. How it splits a class list, how to wire it into git difftool, and what it doesn't do yet. As of 2026.11.

You change one Tailwind class. Plain git diff shows a - line and a + line, both about 70 characters long, and you compare them by eye to find the three characters that moved. OmniDiff v0.3.0, published 2026.11.01, reads that string as a class list and marks only the class that changed.

Watch the 60-second version on Instagram.

The problem with a line diff

Tailwind lines are long. A one-class edit looks like this to plain git diff:

nav-link.tsx
- <a className="flex items-center gap-2 rounded-md px-4 py-2 bg-blue-500 text-white">
+ <a className="flex items-center gap-2 rounded-md px-4 py-2 bg-blue-600 text-white">

Two whole lines marked, and the reviewer does the real diff. What you want marked is bg-blue-600, nothing else.

GIT DIFF · 2 LINES MARKED-flexitems-centergap-2rounded-mdpx-4py-2bg-blue-500text-white+flexitems-centergap-2rounded-mdpx-4py-2bg-blue-600text-whiteCLASS-AWARE DIFF · 1 CLASS MARKED-flexitems-centergap-2rounded-mdpx-4py-2bg-blue-500text-white+flexitems-centergap-2rounded-mdpx-4py-2bg-blue-600text-whiteILLUSTRATIVE · NOT TOOL OUTPUTFIG. 01 / TWO LINES OR ONE CLASS

The figure is my own drawing of the idea, not a screenshot of OmniDiff's output. I didn't find a captured className example from the tool itself.

What changed in v0.3.0

OmniDiff parses code with tree-sitter, for 25 languages including TSX, CSS and HTML. Parsing alone didn't solve this case, though: class lists got their own rule in v0.3.0. The tool knows that a className value is a class list, and diffs it class by class.

It applies that rule to:

  • JSX className and class values.
  • String arguments of cn, clsx, classnames, cx, twMerge, twJoin, cva and tw.

The changelog never says "Tailwind". The rule fits any class list; the test fixtures happen to come from shadcn/ui.

Spaces cut, colons and dashes don't

A class list is split on whitespace, and only on whitespace. A class is never cut at :, - or /, so hover:bg-blue-500 stays one unit. Change it to hover:bg-blue-600 and you see one changed class, not a changed 600 floating in an unchanged hover:bg-blue-.

flex items-center gap-2 hover:bg-blue-500 px-4flexitems-centergap-2hover:bg-blue-500px-4ONE CLASS · NO CUT AT : OR -CUT AT SPACES ONLYFIG. 02 / CUT AT SPACES ONLY

Reordered classes are a separate case. In the --minimal preset they stay unpainted; in --full they show as moved.

Set it up

git diff and git log -p never open OmniDiff. You run git difftool, and git needs to be told how to call a custom tool first, so git difftool --tool=omnidiff alone fails on a fresh install. From the README (I haven't run these):

setup.sh
# install, pick one
brew install ivankovic/omnidiff/omnidiff
cargo install --locked omnidiff   # needs a C compiler and rustc 1.92+
 
# tell git about it: the wizard...
omnidiff git configure
# ...or by hand (add --global for every repo)
git config difftool.omnidiff.cmd 'omnidiff "$LOCAL" "$REMOTE"'
git config difftool.prompt false   # optional: skip the per-file prompt
 
git difftool --tool=omnidiff

nix run github:ivankovic/omnidiff runs it without installing it. On Debian and Ubuntu you add the project's signed apt repo first; on Windows the README points to the release binaries.

What people get wrong

  • "Only a structural tool can do this." git diff --word-diff also splits on whitespace, and delta highlights changed words. The contrast holds against plain git diff. OmniDiff's edge is treating a class list as a class list, reordered classes included.
  • "My git diff will look different now." It won't. Only git difftool opens the viewer, so whoever reviews has to run it.
  • "It handles every way I write classes." Template literals, Vue or Svelte :class and plain HTML aren't covered by the change, so don't count on them.
  • "It's the standard now." It's v0.3.0 with about 1,100 stars. The Show HN reached 319 points, and commenters questioned the accuracy claims and reported crashes on degenerate huge files. The README itself notes substantial AI assistance and says its accuracy goals aren't met yet.

The licence is AGPL-3.0-only, with a paid commercial licence through GitHub Sponsors. If you want something MIT that also parses with tree-sitter, look at difftastic.

On a client project I'd try it as a personal review tool for Tailwind-heavy pull requests, and keep plain git diff as what the team and CI rely on until it's past 0.x.

The short version

  1. Plain git diff marks a whole className line when one class changes.
  2. OmniDiff v0.3.0 diffs class lists class by class, in JSX and in cn, clsx, cva and friends.
  3. It cuts at spaces only, so hover:bg-blue-500 stays one class.
  4. It runs through git difftool, after omnidiff git configure or a difftool.omnidiff.cmd line.
  5. It's young: AGPL, v0.3.0, self-reported accuracy. Try it, don't standardise on it yet.

Sources: OmniDiff v0.3.0 release · Changelog · Commit, diff a CSS class list class by class · OmniDiff README · crates.io · Show HN · git-diff docs · git-difftool docs · delta · difftastic