Skip to content

Commit

Permalink
feat(help): expose function for choosing light or dark styles
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Nov 5, 2024
1 parent cc9a727 commit d791d10
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ type Styles struct {
FullSeparator lipgloss.Style
}

func newStyles(isDark bool) Styles {
// DefaultStyles returns a set of default styles for the help bubble. Light or
// dark styles can be selected by passing true or false to the isDark
// parameter.
func DefaultStyles(isDark bool) Styles {
lightDark := lipgloss.LightDark(isDark)

keyStyle := lipgloss.NewStyle().Foreground(lightDark("#909090", "#626262"))
Expand All @@ -61,12 +64,12 @@ func newStyles(isDark bool) Styles {

// DefaultDarkStyles returns a set of default styles for dark backgrounds.
func DefaultDarkStyles() Styles {
return newStyles(true)
return DefaultStyles(true)
}

// DefaultLightStyles returns a set of default styles for light backgrounds.
func DefaultLightStyles() Styles {
return newStyles(false)
return DefaultStyles(false)
}

// Model contains the state of the help view.
Expand Down

0 comments on commit d791d10

Please sign in to comment.