Skip to content

Commit

Permalink
feat(textarea): add helpers for default light and dark styles
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Nov 6, 2024
1 parent 148439f commit fc0fa78
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func New() Model {
vp.KeyMap = viewport.KeyMap{}
cur := cursor.New()

styles := DefaultStyles(true)
styles := DefaultDarkStyles()

m := Model{
CharLimit: defaultCharLimit,
Expand Down Expand Up @@ -348,6 +348,16 @@ func DefaultStyles(isDark bool) Styles {
return s
}

// DefaultLightStyles returns the default styles for a light background.
func DefaultLightStyles() Styles {
return DefaultStyles(false)
}

// DefaultDarkStyles returns the default styles for a dark background.
func DefaultDarkStyles() Styles {
return DefaultStyles(true)
}

// SetValue sets the value of the text input.
func (m *Model) SetValue(s string) {
m.Reset()
Expand Down

0 comments on commit fc0fa78

Please sign in to comment.