theme

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package theme defines the visual styles used by the renderer. A Theme is a flat bag of lipgloss.Style values, one per markdown construct, so the renderer never hard-codes colors. Default returns an adaptive palette (Catppuccin Latte on light terminals, Mocha on dark); DefaultDark returns the fixed dark palette used by tests. The package imports only lipgloss.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Theme

type Theme struct {
	H1, H2, H3, H4, H5, H6                    lipgloss.Style
	Bold, Italic, CodeSpan, Strike, Highlight lipgloss.Style
	CodeBlock, CodeBlockBorder                lipgloss.Style
	Link, WikiLink, BrokenLink                lipgloss.Style // BrokenLink: red fg
	Quote, Callout, CalloutTitle              lipgloss.Style
	Bullet, TaskDone, TaskOpen                lipgloss.Style
	Table, TableHeader                        lipgloss.Style
	Frontmatter, ThematicBreak                lipgloss.Style
	Text, RawBlock                            lipgloss.Style // RawBlock: subtle bg on the raw block under the cursor
	Selection                                 lipgloss.Style // selected text in the editor (S0)
	StatusBar, StatusBarError                 lipgloss.Style

	// Status bar segments: file name, dirty marker, key hints, transient
	// success flash. All share the StatusBar background.
	StatusBarName, StatusBarDirty lipgloss.Style
	StatusBarHint, StatusBarOK    lipgloss.Style

	// PromptBar is the destructive/confirmation bar (high-contrast alert
	// background); PromptKey highlights the answer keys inside it.
	PromptBar, PromptKey lipgloss.Style

	// Menu styles cover popup overlays (autocomplete, help): body text,
	// selected row, border, and title.
	Menu, MenuSelected, MenuBorder, MenuTitle lipgloss.Style

	// Dim is applied to background content while an overlay (finder, help)
	// is focused.
	Dim lipgloss.Style

	// ChromaStyle is the name of the chroma highlighting style used for fenced
	// code blocks. It is not a lipgloss.Style; it selects a chroma palette.
	ChromaStyle string
}

Theme holds one lipgloss.Style per renderable markdown construct. All fields are value types, so a Theme is cheap to copy into a render.Context.

func Default

func Default() Theme

Default returns the adaptive theme: Latte colors on a light terminal background, Mocha on a dark one (including the chroma code-block palette).

func DefaultDark

func DefaultDark() Theme

DefaultDark returns the built-in fixed dark theme.

Jump to

Keyboard shortcuts

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