1package styles
2
3import (
4 "github.com/charmbracelet/lipgloss"
5 "github.com/opencode-ai/opencode/internal/tui/theme"
6)
7
8// Style generation functions that use the current theme
9
10// BaseStyle returns the base style with background and foreground colors
11func BaseStyle() lipgloss.Style {
12 t := theme.CurrentTheme()
13 return lipgloss.NewStyle().
14 Background(t.Background()).
15 Foreground(t.Text())
16}
17
18// Regular returns a basic unstyled lipgloss.Style
19func Regular() lipgloss.Style {
20 return lipgloss.NewStyle()
21}
22
23// Bold returns a bold style
24func Bold() lipgloss.Style {
25 return Regular().Bold(true)
26}
27
28// Padded returns a style with horizontal padding
29func Padded() lipgloss.Style {
30 return Regular().Padding(0, 1)
31}
32
33// Border returns a style with a normal border
34func Border() lipgloss.Style {
35 t := theme.CurrentTheme()
36 return Regular().
37 Border(lipgloss.NormalBorder()).
38 BorderForeground(t.BorderNormal())
39}
40
41// ThickBorder returns a style with a thick border
42func ThickBorder() lipgloss.Style {
43 t := theme.CurrentTheme()
44 return Regular().
45 Border(lipgloss.ThickBorder()).
46 BorderForeground(t.BorderNormal())
47}
48
49// DoubleBorder returns a style with a double border
50func DoubleBorder() lipgloss.Style {
51 t := theme.CurrentTheme()
52 return Regular().
53 Border(lipgloss.DoubleBorder()).
54 BorderForeground(t.BorderNormal())
55}
56
57// FocusedBorder returns a style with a border using the focused border color
58func FocusedBorder() lipgloss.Style {
59 t := theme.CurrentTheme()
60 return Regular().
61 Border(lipgloss.NormalBorder()).
62 BorderForeground(t.BorderFocused())
63}
64
65// DimBorder returns a style with a border using the dim border color
66func DimBorder() lipgloss.Style {
67 t := theme.CurrentTheme()
68 return Regular().
69 Border(lipgloss.NormalBorder()).
70 BorderForeground(t.BorderDim())
71}
72
73// PrimaryColor returns the primary color from the current theme
74func PrimaryColor() lipgloss.AdaptiveColor {
75 return theme.CurrentTheme().Primary()
76}
77
78// SecondaryColor returns the secondary color from the current theme
79func SecondaryColor() lipgloss.AdaptiveColor {
80 return theme.CurrentTheme().Secondary()
81}
82
83// AccentColor returns the accent color from the current theme
84func AccentColor() lipgloss.AdaptiveColor {
85 return theme.CurrentTheme().Accent()
86}
87
88// ErrorColor returns the error color from the current theme
89func ErrorColor() lipgloss.AdaptiveColor {
90 return theme.CurrentTheme().Error()
91}
92
93// WarningColor returns the warning color from the current theme
94func WarningColor() lipgloss.AdaptiveColor {
95 return theme.CurrentTheme().Warning()
96}
97
98// SuccessColor returns the success color from the current theme
99func SuccessColor() lipgloss.AdaptiveColor {
100 return theme.CurrentTheme().Success()
101}
102
103// InfoColor returns the info color from the current theme
104func InfoColor() lipgloss.AdaptiveColor {
105 return theme.CurrentTheme().Info()
106}
107
108// TextColor returns the text color from the current theme
109func TextColor() lipgloss.AdaptiveColor {
110 return theme.CurrentTheme().Text()
111}
112
113// TextMutedColor returns the muted text color from the current theme
114func TextMutedColor() lipgloss.AdaptiveColor {
115 return theme.CurrentTheme().TextMuted()
116}
117
118// TextEmphasizedColor returns the emphasized text color from the current theme
119func TextEmphasizedColor() lipgloss.AdaptiveColor {
120 return theme.CurrentTheme().TextEmphasized()
121}
122
123// BackgroundColor returns the background color from the current theme
124func BackgroundColor() lipgloss.AdaptiveColor {
125 return theme.CurrentTheme().Background()
126}
127
128// BackgroundSecondaryColor returns the secondary background color from the current theme
129func BackgroundSecondaryColor() lipgloss.AdaptiveColor {
130 return theme.CurrentTheme().BackgroundSecondary()
131}
132
133// BackgroundDarkerColor returns the darker background color from the current theme
134func BackgroundDarkerColor() lipgloss.AdaptiveColor {
135 return theme.CurrentTheme().BackgroundDarker()
136}
137
138// BorderNormalColor returns the normal border color from the current theme
139func BorderNormalColor() lipgloss.AdaptiveColor {
140 return theme.CurrentTheme().BorderNormal()
141}
142
143// BorderFocusedColor returns the focused border color from the current theme
144func BorderFocusedColor() lipgloss.AdaptiveColor {
145 return theme.CurrentTheme().BorderFocused()
146}
147
148// BorderDimColor returns the dim border color from the current theme
149func BorderDimColor() lipgloss.AdaptiveColor {
150 return theme.CurrentTheme().BorderDim()
151}
152