forked from charmbracelet/mods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.go
47 lines (44 loc) · 1.73 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
package main
import "github.com/charmbracelet/lipgloss"
type styles struct {
AppName,
CliArgs,
Comment,
CyclingChars,
ErrorHeader,
ErrorDetails,
ErrPadding,
Flag,
FlagComma,
FlagDesc,
InlineCode,
Link,
Pipe,
Quote,
ConversationList,
SHA1,
Bullet,
Timeago lipgloss.Style
}
func makeStyles(r *lipgloss.Renderer) (s styles) {
const horizontalEdgePadding = 2
s.AppName = r.NewStyle().Bold(true)
s.CliArgs = r.NewStyle().Foreground(lipgloss.Color("#585858"))
s.Comment = r.NewStyle().Foreground(lipgloss.Color("#757575"))
s.CyclingChars = r.NewStyle().Foreground(lipgloss.Color("#FF87D7"))
s.ErrorHeader = r.NewStyle().Foreground(lipgloss.Color("#F1F1F1")).Background(lipgloss.Color("#FF5F87")).Bold(true).Padding(0, 1).SetString("ERROR")
s.ErrorDetails = s.Comment.Copy()
s.ErrPadding = r.NewStyle().Padding(0, horizontalEdgePadding)
s.Flag = r.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#00B594", Dark: "#3EEFCF"}).Bold(true)
s.FlagComma = r.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#5DD6C0", Dark: "#427C72"}).SetString(",")
s.FlagDesc = s.Comment.Copy()
s.InlineCode = r.NewStyle().Foreground(lipgloss.Color("#FF5F87")).Background(lipgloss.Color("#3A3A3A")).Padding(0, 1)
s.Link = r.NewStyle().Foreground(lipgloss.Color("#00AF87")).Underline(true)
s.Quote = r.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#FF71D0", Dark: "#FF78D2"})
s.Pipe = r.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#8470FF", Dark: "#745CFF"})
s.ConversationList = r.NewStyle().Padding(0, 1)
s.SHA1 = s.Flag.Copy()
s.Bullet = r.NewStyle().SetString("• ").Foreground(lipgloss.AdaptiveColor{Light: "#757575", Dark: "#777"})
s.Timeago = r.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "#999", Dark: "#555"})
return s
}