styles

package
v0.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderHeight = 3
	FooterHeight = 2
)

Variables

This section is empty.

Functions

func AllThemes added in v0.0.26

func AllThemes() map[string]ThemeFunc

Types

type OutputLevel added in v0.0.24

type OutputLevel string
const (
	OutputLevelSuccess OutputLevel = "success"
	OutputLevelNotice  OutputLevel = "notice"
	OutputLevelInfo    OutputLevel = "info"
	OutputLevelWarning OutputLevel = "warning"
	OutputLevelError   OutputLevel = "error"

	// LogNoticeLevel is a custom log level for notices.
	LogNoticeLevel = log.InfoLevel + 1
)

type Theme

type Theme struct {
	Name        string          `json:"-" yaml:"-"`
	SpinnerType spinner.Spinner `json:"-" yaml:"-"`
	// see https://github.com/alecthomas/chroma
	ChromaCodeStyle string `json:"chromaCodeStyle" yaml:"chromaCodeStyle"`

	BodyColor      lipgloss.Color `json:"bodyColor"      yaml:"bodyColor"`
	EmphasisColor  lipgloss.Color `json:"emphasisColor"  yaml:"emphasisColor"`
	BorderColor    lipgloss.Color `json:"borderColor"    yaml:"borderColor"`
	PrimaryColor   lipgloss.Color `json:"primaryColor"   yaml:"primaryColor"`
	SecondaryColor lipgloss.Color `json:"secondaryColor" yaml:"secondaryColor"`
	TertiaryColor  lipgloss.Color `json:"tertiaryColor"  yaml:"tertiaryColor"`
	SuccessColor   lipgloss.Color `json:"successColor"   yaml:"successColor"`
	WarningColor   lipgloss.Color `json:"warningColor"   yaml:"warningColor"`
	ErrorColor     lipgloss.Color `json:"errorColor"     yaml:"errorColor"`
	InfoColor      lipgloss.Color `json:"infoColor"      yaml:"infoColor"`
	White          lipgloss.Color `json:"white"          yaml:"white"`
	Gray           lipgloss.Color `json:"gray"           yaml:"gray"`
	Black          lipgloss.Color `json:"black"          yaml:"black"`
}

func BaseTheme

func BaseTheme() Theme

func DarkTheme added in v0.0.26

func DarkTheme() Theme

DarkTheme Use colors from Glamour Dracula theme See https://raw.githubusercontent.com/charmbracelet/glamour/refs/heads/master/styles/dark.json

func DraculaTheme added in v0.0.26

func DraculaTheme() Theme

DraculaTheme Use colors from Glamour Dracula theme See https://raw.githubusercontent.com/charmbracelet/glamour/refs/heads/master/styles/dracula.json

func EverforestTheme added in v0.0.9

func EverforestTheme() Theme

EverforestTheme Uses the colors from the Everforest color scheme See https://gogh-co.github.io/Gogh/

func LightTheme added in v0.0.26

func LightTheme() Theme

LightTheme Use colors from Glamour Light theme See https://raw.githubusercontent.com/charmbracelet/glamour/refs/heads/master/styles/light.json

func TokyoNightTheme added in v0.0.26

func TokyoNightTheme() Theme

TokyoNightTheme Use colors from Glamour Tokyo Night theme See https://raw.githubusercontent.com/charmbracelet/glamour/refs/heads/master/styles/tokyo-night.json

func (Theme) Box added in v0.0.4

func (t Theme) Box() lipgloss.Style

func (Theme) Collection

func (t Theme) Collection() lipgloss.Style

func (Theme) EntityView

func (t Theme) EntityView() lipgloss.Style

func (Theme) HuhTheme added in v0.0.22

func (t Theme) HuhTheme() *huh.Theme

func (Theme) ListItemStyles

func (t Theme) ListItemStyles() list.DefaultItemStyles

func (Theme) ListStyles

func (t Theme) ListStyles() list.Styles

func (Theme) LoggerStyles

func (t Theme) LoggerStyles() *log.Styles

func (Theme) MarkdownStyleJSON

func (t Theme) MarkdownStyleJSON() (string, error)

func (Theme) RenderBold

func (t Theme) RenderBold(text string) string

func (Theme) RenderEmphasis added in v0.0.9

func (t Theme) RenderEmphasis(text string) string

func (Theme) RenderError

func (t Theme) RenderError(text string) string

func (Theme) RenderFooter added in v0.0.9

func (t Theme) RenderFooter(text string, width int) string

func (Theme) RenderHeader added in v0.0.9

func (t Theme) RenderHeader(appName, stateKey, stateVal string, width int) string

func (Theme) RenderInContainer

func (t Theme) RenderInContainer(text string) string

func (Theme) RenderInfo

func (t Theme) RenderInfo(text string) string

func (Theme) RenderInputForm

func (t Theme) RenderInputForm(text string) string

func (Theme) RenderKeyAndValue added in v0.0.22

func (t Theme) RenderKeyAndValue(key, value string) string

func (Theme) RenderKeyAndValueWithBreak added in v0.0.22

func (t Theme) RenderKeyAndValueWithBreak(key, value string) string

func (Theme) RenderLevel added in v0.0.24

func (t Theme) RenderLevel(str string, lvl OutputLevel) string

func (Theme) RenderNotice added in v0.0.9

func (t Theme) RenderNotice(text string) string

func (Theme) RenderSuccess

func (t Theme) RenderSuccess(text string) string

func (Theme) RenderUnknown

func (t Theme) RenderUnknown(text string) string

func (Theme) RenderWarning

func (t Theme) RenderWarning(text string) string

func (Theme) Spinner

func (t Theme) Spinner() lipgloss.Style

type ThemeFunc added in v0.0.26

type ThemeFunc func() Theme

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL