-
Notifications
You must be signed in to change notification settings - Fork 51
/
style.go
56 lines (44 loc) · 2.08 KB
/
style.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
package main
import (
"strings"
"github.com/charmbracelet/lipgloss"
)
const accentColor = lipgloss.Color("99")
const yellowColor = lipgloss.Color("#ECFD66")
const whiteColor = lipgloss.Color("255")
const grayColor = lipgloss.Color("241")
const darkGrayColor = lipgloss.Color("236")
const lightGrayColor = lipgloss.Color("247")
var (
activeTextStyle = lipgloss.NewStyle().Foreground(whiteColor)
textStyle = lipgloss.NewStyle().Foreground(lightGrayColor)
activeLabelStyle = lipgloss.NewStyle().Foreground(accentColor)
labelStyle = lipgloss.NewStyle().Foreground(grayColor)
placeholderStyle = lipgloss.NewStyle().Foreground(darkGrayColor)
cursorStyle = lipgloss.NewStyle().Foreground(whiteColor)
paddedStyle = lipgloss.NewStyle().Padding(1)
errorHeaderStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#F1F1F1")).Background(lipgloss.Color("#FF5F87")).Bold(true).Padding(0, 1).SetString("ERROR")
errorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF5F87"))
commentStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#757575")).PaddingLeft(1)
sendButtonActiveStyle = lipgloss.NewStyle().Background(accentColor).Foreground(yellowColor).Padding(0, 2)
sendButtonInactiveStyle = lipgloss.NewStyle().Background(darkGrayColor).Foreground(lightGrayColor).Padding(0, 2)
sendButtonStyle = lipgloss.NewStyle().Background(darkGrayColor).Foreground(grayColor).Padding(0, 2)
inlineCodeStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF5F87")).Background(lipgloss.Color("#3A3A3A")).Padding(0, 1)
linkStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#00AF87")).Underline(true)
)
// emailSummary returns a summary of the email that was sent. It is used when
// the user has sent an email successfully.
func emailSummary(to []string, subject string) string {
var s strings.Builder
s.WriteString("\n Email ")
s.WriteString(activeTextStyle.Render("\"" + subject + "\""))
s.WriteString(" sent to ")
for i, t := range to {
if i > 0 {
s.WriteString(", ")
}
s.WriteString(linkStyle.Render(t))
}
s.WriteString("\n\n")
return s.String()
}