Documentation
¶
Overview ¶
Package theme holds the lipgloss styles shared by the model and its panels: a rounded-border panel box (bright when focused, dim otherwise), a panel title, and the status line.
Kept tiny and dependency-free so both ux and panels can import it without a cycle.
Index ¶
- func Accent() lipgloss.Style
- func Chip() lipgloss.Style
- func Dir() lipgloss.Style
- func Follower() lipgloss.Style
- func Gutter() lipgloss.Style
- func Match() lipgloss.Style
- func Modal() lipgloss.Style
- func Panel(w, h int, focused bool) lipgloss.Style
- func Selected() lipgloss.Style
- func SevError() lipgloss.Style
- func SevHint() lipgloss.Style
- func SevWarn() lipgloss.Style
- func Stale() lipgloss.Style
- func Status() lipgloss.Style
- func Syntax(k SyntaxKind) lipgloss.Style
- func Title(focused bool) lipgloss.Style
- type Span
- type SyntaxKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chip ¶
Chip styles a small standing badge in the header — currently the "h: help" hint, which has to survive a crowded header line without being mistaken for one more status field.
func Follower ¶
Follower styles a cross-ref line in the pane that is MIRRORING the driver.
A muted tint of Selected, so at a glance it is obvious which pane leads and which one is being dragged along (design §6.5).
func Gutter ¶
Gutter styles the link markers in the spec pane's and source viewer's gutter.
Dim on purpose: they are a hint about what is navigable, not content.
func Panel ¶
Panel returns a rounded-border box style whose OUTER dimensions are w×h (the border consumes one cell on each side).
The border is bright when focused and dim otherwise.
func Selected ¶
Selected styles the cursor row in a navigable panel — the DRIVER line, i.e. the one the user is actually moving.
Strong reverse-video bar (design §6.5).
func SevError ¶
SevError, SevWarn, and SevHint style a diagnostic's severity label in the diagnostics pane (red / amber / blue), matching grammar.Severity order.
func Stale ¶
Stale styles the follow-mode badge shown while the source buffer has unsaved edits, i.e. while cross-ref positions are older than what is on screen.
func Syntax ¶
func Syntax(k SyntaxKind) lipgloss.Style
Syntax returns the style for a syntax class.
The diagnostic classes underline as well as recolour: underline is the terminal's squiggle, and it survives a palette where the severity colour is close to a syntax one.
Types ¶
type Span ¶
type Span struct {
Col int // 1-based column of the run's first character
Kind SyntaxKind
}
Span is one lexical run on a rendered line, identified by where it STARTS.
A run extends to the next span's column (or the end of the line), which is what lets the renderer slice raw text at known boundaries instead of truncating already-coloured output — the operation that corrupts escapes.
type SyntaxKind ¶
type SyntaxKind uint8
SyntaxKind classifies a lexical run for highlighting.
It is deliberately source-language-neutral: the JSON/YAML lexers and go/scanner both map onto it, so the renderer and the palette are shared rather than duplicated per pane.
const ( SyntaxPlain SyntaxKind = iota SyntaxKey SyntaxString SyntaxNumber SyntaxKeyword SyntaxPunct SyntaxComment SyntaxDiagError SyntaxDiagWarn SyntaxDiagHint )
The syntax classes.
Plain is the zero value, so an unmapped token simply renders unstyled rather than wrong.
The Diag* classes are the exception to "lexical": they are not what a token IS but what the scanner said ABOUT it, overlaid on the run the diagnostic points at. They ride the same span mechanism because a diagnostic and a token address the same thing — a (line, column) run — and giving them a second mechanism would mean two ways to paint one line.