charmbracelet / charmbracelet/glow
Allow separate light and dark themes while preserving automatic style detection
- Dominant language
- Go
- Stars
- 27.3k
- Forks
- 762
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
### Feature request
Please allow `style` to accept an object containing separate `light` and `dark` themes:
```yaml
style:
light: /path/to/light-theme.json
dark: /path/to/dark-theme.json
```
Using the object form would preserve the automatic behavior of `style: auto`: Glow would detect whether the terminal background is light or dark, then use the corresponding configured theme.
The values could support the same inputs accepted by the current string-valued `style` option, such as a built-in style name or a path to a custom JSON style.
If either key is omitted, Glow could fall back to its current built-in style for that mode. For example:
```yaml
style:
dark: /path/to/dark-theme.json
```
Existing string values should continue to work unchanged for backward compatibility:
```yaml
style: auto
```
### Use case
Some terminals follow the operating system and switch automatically between light and dark appearances. Users should be able to use custom Glow themes for both appearances without changing their configuration or supplying a different `--style` argument after every switch.
Contributor guide
Research direction
Locate the existing string-valued style configuration and the automatic light/dark terminal detection path, then trace how the selected style is loaded. Add coverage for object-form light and dark styles, omitted keys, automatic selection, and unchanged string values; done means both configured themes work without breaking existing configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100