charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

Ability to specify `huh` theme #595

Closed taismassaro closed 2 months ago

taismassaro commented 4 months ago

Is your feature request related to a problem? Please describe. I've seen some gum commands are passing the Charm theme directly to huh (e.g. gum confirm) and there is no option to change that (e.g. changing the color of gum confirm "buttons")

Describe the solution you'd like I would like to either have a flag in gum confirm to be able to pass a background to the selected option, or, ideally, to be able to choose the huh theme in my commands.

Describe alternatives you've considered I haven't found an alternative to changing the background color of the gum confirm selected option.

Additional context https://github.com/charmbracelet/gum/blob/main/confirm/command.go#L13

image
cloudyparts commented 4 months ago

+1 to this request.

I'd like to override the style of input placeholder to make it a brighter. I may be wrong but allowing for theme selection might help here.

gum input --placeholder="$(gum style --foreground="#888888" "placeholder")"
> [38;2;136;136;136mplaceholder
maaslalani commented 4 months ago

Describe alternatives you've considered I haven't found an alternative to changing the background color of the gum confirm selected option.

Hi! This could definitely be documented better but generally when you can specify the foreground of an element you can also specify the background of it.

gum confirm --selected.background="99"
meowgorithm commented 2 months ago

Hey, everyone. Closing this one for now as I believe --selected.background sorts this one out, but @taismassaro let us know if not.

With regard to Huh themes, because Huh isn't applied to Gum commands across the board (for example, gum table falls outside the realm of Huh) I don't think exposing Huh's theming settings make sense here.