styles.go (2924B)
1 package tui 2 3 import "github.com/charmbracelet/lipgloss" 4 5 // The chrome follows the user's terminal theme: text uses the terminal's 6 // default foreground and background (nothing paints a background), accents 7 // are the 16 ANSI palette slots, and highlighted bars use reverse video, so 8 // the same styles read right in light and dark themes. Only content with its 9 // own fixed colors keeps them: the truecolor logo, tech tags (each a fixed 10 // fg/bg pair) and language colors. 11 var ( 12 colorFg lipgloss.TerminalColor = lipgloss.NoColor{} // terminal default 13 colorDim lipgloss.TerminalColor = lipgloss.Color("8") // bright black 14 colorBorder lipgloss.TerminalColor = lipgloss.Color("8") 15 colorAccent lipgloss.TerminalColor = lipgloss.Color("3") // yellow 16 colorGreen lipgloss.TerminalColor = lipgloss.Color("2") 17 colorRed lipgloss.TerminalColor = lipgloss.Color("1") 18 colorBlue lipgloss.TerminalColor = lipgloss.Color("4") 19 colorCyan lipgloss.TerminalColor = lipgloss.Color("6") 20 colorMagenta lipgloss.TerminalColor = lipgloss.Color("5") 21 22 headerStyle = lipgloss.NewStyle(). 23 BorderBottom(true). 24 BorderForeground(colorBorder). 25 Foreground(colorFg). 26 Padding(0, 1) 27 28 footerStyle = lipgloss.NewStyle(). 29 BorderTop(true). 30 BorderForeground(colorBorder). 31 Foreground(colorDim). 32 Padding(0, 1) 33 34 panelStyle = lipgloss.NewStyle(). 35 Border(lipgloss.NormalBorder()). 36 BorderForeground(colorBorder). 37 Padding(0, 1) 38 39 panelActiveStyle = panelStyle. 40 BorderForeground(colorAccent) 41 42 panelTitleStyle = lipgloss.NewStyle().Foreground(colorAccent).Bold(true) 43 bootTitleStyle = lipgloss.NewStyle().Foreground(colorAccent).Bold(true) 44 bootSubtitleStyle = lipgloss.NewStyle(). 45 Foreground(colorDim) 46 47 promptStyle = lipgloss.NewStyle().Foreground(colorDim) 48 promptUserStyle = lipgloss.NewStyle().Foreground(colorGreen) 49 promptHostStyle = lipgloss.NewStyle().Foreground(colorAccent) 50 promptPathStyle = lipgloss.NewStyle().Foreground(colorCyan) 51 promptDollarStyle = lipgloss.NewStyle().Foreground(colorGreen) 52 promptCmdStyle = lipgloss.NewStyle().Foreground(colorFg) 53 54 selectedRowStyle = lipgloss.NewStyle().Foreground(colorAccent).Bold(true) 55 // reverse video: the accent becomes the bar, the terminal background the text 56 tabActiveStyle = lipgloss.NewStyle().Foreground(colorAccent).Reverse(true).Bold(true) 57 rowStyle = lipgloss.NewStyle().Foreground(colorFg) 58 dimStyle = lipgloss.NewStyle().Foreground(colorDim) 59 titleStyle = lipgloss.NewStyle().Foreground(colorAccent).Bold(true) 60 fetchKeyStyle = lipgloss.NewStyle().Foreground(colorAccent) 61 linkStyle = lipgloss.NewStyle().Foreground(colorBlue) 62 infoStyle = lipgloss.NewStyle().Foreground(colorCyan) 63 footerTimeStyle = lipgloss.NewStyle().Foreground(colorCyan) 64 footerWakaStyle = lipgloss.NewStyle().Foreground(colorMagenta) 65 footerDimStyle = lipgloss.NewStyle().Foreground(colorDim) 66 )