Skip to content

feat(but): add experimental light theme - #13446

Merged
slarse merged 1 commit into
masterfrom
GB-1305/but-light
Apr 21, 2026
Merged

slarse merged 1 commit into
masterfrom
GB-1305/but-light

Conversation

@slarse

@slarse slarse commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

The theme is activated by defining the environment variable EXPERIMENTAL_BUT_LIGHT_THEME with any value. The reason it is prefixed "EXPERIMENTAL" is that this isn't the way we want to enable the theme, it's just a temporary way of enabling it.

To justify the need for this, here's the dark theme on a light background:

dark_on_light

And here's the light theme on light background:

light_theme

There are most certainly small pieces I've missed, but this at least makes the TUI significantly more usable on a light background. While not very evident from the screenshots, the context lines of the diff view were entirely invisible, for one.

Copilot AI review requested due to automatic review settings April 21, 2026 19:57
@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Apr 21, 2026
@slarse
slarse force-pushed the GB-1305/but-light branch from 5fb2efa to 2f43516 Compare April 21, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an experimental light theme option to the but CLI/TUI, toggled via the EXPERIMENTAL_BUT_LIGHT_THEME environment variable, including a matching light syntax-highlighting theme for the TUI details diff view.

Changes:

  • Switch Theme::default() to choose between dark/light palettes based on EXPERIMENTAL_BUT_LIGHT_THEME, and introduce default_dark() / default_light() builders.
  • Add a light Syntect theme (Monokai Extended Light.tmTheme) and select it for syntax highlighting in the TUI details view when the env var is set.
  • Adjust white/gray foreground/background mapping for ANSI styling output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
crates/but/src/theme.rs Adds light theme defaults and selects light/dark palette at runtime via env var.
crates/but/src/command/legacy/status/tui/details/mod.rs Adds light syntax theme asset loading and switches Syntect theme selection based on env var.
crates/but/assets/syntax-highlighting-themes/Monokai Extended Light.tmTheme New light syntax-highlighting theme asset.
crates/but/assets/syntax-highlighting-themes/Monokai Extended License Updates license notice to cover both dark and light theme files.

Comment thread crates/but/src/theme.rs Resolved
Comment thread crates/but/src/theme.rs Resolved
The theme is activated by defining the environment variable
EXPERIMENTAL_BUT_LIGHT_THEME with any value. The reason it is prefixed
"EXPERIMENTAL" is that this isn't the way we want to enable the theme,
it's just a temporary way of enabling it.
@slarse
slarse force-pushed the GB-1305/but-light branch from 2f43516 to 741ceaf Compare April 21, 2026 20:10
@slarse
slarse enabled auto-merge April 21, 2026 20:17
@slarse
slarse merged commit 257dbfb into master Apr 21, 2026
37 checks passed
@slarse
slarse deleted the GB-1305/but-light branch April 21, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants