mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
feat(help): expose function for choosing light or dark styles
This commit is contained in:
+6
-3
@@ -41,7 +41,10 @@ type Styles struct {
|
|||||||
FullSeparator lipgloss.Style
|
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)
|
lightDark := lipgloss.LightDark(isDark)
|
||||||
|
|
||||||
keyStyle := lipgloss.NewStyle().Foreground(lightDark("#909090", "#626262"))
|
keyStyle := lipgloss.NewStyle().Foreground(lightDark("#909090", "#626262"))
|
||||||
@@ -61,12 +64,12 @@ func newStyles(isDark bool) Styles {
|
|||||||
|
|
||||||
// DefaultDarkStyles returns a set of default styles for dark backgrounds.
|
// DefaultDarkStyles returns a set of default styles for dark backgrounds.
|
||||||
func DefaultDarkStyles() Styles {
|
func DefaultDarkStyles() Styles {
|
||||||
return newStyles(true)
|
return DefaultStyles(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultLightStyles returns a set of default styles for light backgrounds.
|
// DefaultLightStyles returns a set of default styles for light backgrounds.
|
||||||
func DefaultLightStyles() Styles {
|
func DefaultLightStyles() Styles {
|
||||||
return newStyles(false)
|
return DefaultStyles(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Model contains the state of the help view.
|
// Model contains the state of the help view.
|
||||||
|
|||||||
Reference in New Issue
Block a user