From fc0fa7807e6ac38428f5eee1bfad258a337b56c1 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 5 Nov 2024 21:38:29 -0500 Subject: [PATCH] feat(textarea): add helpers for default light and dark styles --- textarea/textarea.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index 199502ef..b5e3aa34 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -290,7 +290,7 @@ func New() Model { vp.KeyMap = viewport.KeyMap{} cur := cursor.New() - styles := DefaultStyles(true) + styles := DefaultDarkStyles() m := Model{ CharLimit: defaultCharLimit, @@ -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()