From 45a297a8e526094e8fce6e2c5c0fd89b381d1765 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 14 Apr 2026 16:37:17 +0200 Subject: i have to commit at some point! --- menu/style/style.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 menu/style/style.go (limited to 'menu/style/style.go') diff --git a/menu/style/style.go b/menu/style/style.go new file mode 100644 index 0000000..e7164e1 --- /dev/null +++ b/menu/style/style.go @@ -0,0 +1,30 @@ +package style + +import "github.com/charmbracelet/lipgloss" + +type StyleBuilder func() lipgloss.Style + +type Style struct { + style *lipgloss.Style + builder StyleBuilder +} + +func New(builder StyleBuilder) Style { + return Style{ + builder: builder, + } +} + +func (s *Style) Get() lipgloss.Style { + + if s.style == nil { + st := s.builder() + s.style = &st + } + + return *s.style +} + +func (s *Style) Render(input ...string) string { + return s.Get().Render(input...) +} -- cgit v1.3