gitui/THEMES.md
Christoph Rüßler 3c9c266c01
Simplify theme overrides (#1652)
* Simplify theme overrides

Theme overrides are now loaded the same way key overrides are loaded.
The config file, `theme.ron`, does not have to contain a complete theme
anymore. Instead, it is possible to specify only the values that are
supposed to override their corresponding default values.

* Document breaking change in changelog
* Test that override differs from default
* Convert existing theme to patch
2023-06-25 14:09:40 +02:00

1.6 KiB
Raw Blame History

Themes

default on light terminal:

To change the colors of the default theme you need to add a theme.ron file that contains the colors you want to override. Note that you dont have to specify the full theme anymore (as of 0.23). Instead, it is sufficient to override just the values that you want to differ from their default values.

The file uses the Ron format and is located at one of the following paths, depending on your operating system:

  • $HOME/.config/gitui/theme.ron (mac)
  • $XDG_CONFIG_HOME/gitui/theme.ron (linux using XDG)
  • $HOME/.config/gitui/theme.ron (linux)
  • %APPDATA%/gitui/theme.ron (Windows)

Alternatively, you can create a theme in the same directory mentioned above and use it with the -t flag followed by the name of the file in the directory. E.g. If you are on linux calling gitui -t arc.ron, this will load the theme in $XDG_CONFIG_HOME/gitui/arc.ron or $HOME/.config/gitui/arc.ron.

Example theme override:

(
    selection_bg: Some(Blue),
    selection_fg: Some(White),
)

Note that you need to wrap values in Some due to the way the overrides work (as of 0.23).

Notes:

  • rgb colors might not be supported in every terminal.
  • using a color like yellow might appear in whatever your terminal/theme defines for yellow
  • valid colors can be found in tui-rs' Color struct.
  • all customizable theme elements can be found in style.rs in the impl Default for Theme block