Documentation
¶
Index ¶
- Variables
- func Blue(text string) string
- func Cyan(text string) string
- func Red(text string) string
- func RenderMarkup(s string) string
- func RenderMarkupWithBase(s string, base lipgloss.Style) string
- func Tokenize(str string, regex *regexp.Regexp) []string
- func White(text string) string
- func Yellow(text string) string
- type Theme
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedTags = supportedTagsRegexp()
SupportedTags is a regexp matching all supported markup tags.
Functions ¶
func RenderMarkup ¶ added in v0.12.0
RenderMarkup converts markup-tagged strings to lipgloss-styled strings. Tags like <white>, <blue>, <b> are converted to ANSI-styled text. Tags stack: <b><darkgrey> produces bold + darkgrey foreground. The </> tag (or any closing tag) resets all styles.
func RenderMarkupWithBase ¶ added in v0.12.0
RenderMarkupWithBase renders markup with a persistent base style. When tags are reset with </>, the style reverts to base rather than to an empty style. This preserves background colors through resets, avoiding ANSI nesting issues (e.g. footer text on a colored background).
Types ¶
type Theme ¶ added in v0.12.0
type Theme struct {
// Base
Fg color.Color
Bg color.Color
DarkBg color.Color
// Text hierarchy
FgMuted color.Color // secondary text
FgSubtle color.Color // de-emphasized text
// Accents
Primary color.Color // main accent (selection, focus)
Secondary color.Color // secondary accent
Tertiary color.Color // tertiary accent
// Semantic
Info color.Color
Success color.Color
Error color.Color
Warning color.Color
// UI elements
Key color.Color // labels, key hints
Prompt color.Color
Border color.Color // borders, separators
Header color.Color
CursorLineBg color.Color
}
Theme defines the color palette for the application.
Click to show internal directories.
Click to hide internal directories.