-
Notifications
You must be signed in to change notification settings - Fork 1
/
styles.go
62 lines (47 loc) · 1.47 KB
/
styles.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
)
var (
colorPrimary = lipgloss.Color("124")
colorSpecial = lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"}
url = lipgloss.NewStyle().
Foreground(colorSpecial).
Underline(true).
Render
checkMark = lipgloss.NewStyle().SetString("✓").
Foreground(colorSpecial).
PaddingRight(1).
String()
finished = func(s string) string {
sty := lipgloss.NewStyle().MarginLeft(0)
return sty.Render(checkMark + s)
}
errorMsg = func(s string) string {
sty := lipgloss.NewStyle().Foreground(colorPrimary)
return sty.Render("ERROR: ") + s
}
emph = func(s string) string {
return lipgloss.NewStyle().Foreground(colorPrimary).Render(s)
}
spinStyle = lipgloss.NewStyle().
MarginLeft(1).
Foreground(colorPrimary)
)
func decanterFormStyle() *huh.Theme {
t := huh.ThemeBase()
f := &t.Focused
f.Title = lipgloss.NewStyle().Foreground(colorPrimary)
f.Description = lipgloss.NewStyle().Foreground(lipgloss.Color("250"))
f.Base.Foreground(colorPrimary).BorderForeground(colorPrimary)
f.Directory = lipgloss.NewStyle().Foreground(colorSpecial)
f.SelectedOption = lipgloss.NewStyle().Foreground(colorPrimary)
f.UnselectedOption = lipgloss.NewStyle()
ti := &f.TextInput
ti.Cursor = lipgloss.NewStyle().Foreground(colorPrimary)
b := &t.Blurred
b.MultiSelectSelector = lipgloss.NewStyle().SetString(" ")
b.SelectSelector = lipgloss.NewStyle().SetString(" ")
return t
}