Themes
Available Themes
leaf ships with 4 color themes:
- Arctic — light, clean, cool tones
- Forest — dark, green-tinted, nature-inspired
- Ocean (default) — balanced blue palette, available in light and dark
- Solarized-Dark — classic Solarized color scheme
Switching Themes
Press Shift+T to open the theme picker with live preview. Navigate with arrow keys and press Enter to select.
Configuration
Set your default theme in ~/.config/leaf/config.toml. This can be a preset name or a path to a theme file:
theme = "ocean"
# OR
theme = "./theme/my-theme.toml"
Valid preset values: arctic, forest, ocean, solarized-dark.
Custom Themes
You can create custom color schemes by adding [themes.<name>] sections to your config.toml or by loading external TOML files.
Defining a Custom Theme
In your config.toml:
[themes.my-theme]
base = "ocean" # Optional: inherit from a preset
syntax = "base16-ocean.dark" # Optional: syntect syntax theme
[themes.my-theme.ui]
content_bg = "#1e1e1e"
status_bg = "blue"
toc_bg = [30, 30, 30] # RGB array supported
[themes.my-theme.markdown]
heading_1 = "magenta"
link_text = "#ff00ff"
Loading External Themes
Pass the path to a TOML theme file using the --theme flag:
leaf --theme ./theme/my-theme.toml README.md
You can also set an external theme file as your default in config.toml:
theme = "./theme/my-theme.toml"
External theme files use the same structure. The theme name is derived from the filename:
# my-theme.toml
base = "ocean"
[ui]
content_bg = "black"
[markdown]
text = "#00ff00"