theme

package
v0.36.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accent

func Accent() lipgloss.Style

Accent styles the app name / emphasised header text.

func Chip

func Chip() lipgloss.Style

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 Dir

func Dir() lipgloss.Style

Dir styles a directory row in the source tree.

func Follower

func Follower() lipgloss.Style

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

func Gutter() lipgloss.Style

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 Match

func Match() lipgloss.Style

Match styles a search hit in the spec pane.

func Modal() lipgloss.Style

Modal styles a centered popup box (e.g. the scanner-options dialog).

func Panel

func Panel(w, h int, focused bool) lipgloss.Style

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

func Selected() lipgloss.Style

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

func SevError() lipgloss.Style

SevError, SevWarn, and SevHint style a diagnostic's severity label in the diagnostics pane (red / amber / blue), matching grammar.Severity order.

func SevHint

func SevHint() lipgloss.Style

SevHint styles a hint-severity diagnostic label.

func SevWarn

func SevWarn() lipgloss.Style

SevWarn styles a warning-severity diagnostic label.

func Stale

func Stale() lipgloss.Style

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 Status

func Status() lipgloss.Style

Status styles the bottom status/help line.

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.

func Title

func Title(focused bool) lipgloss.Style

Title styles a panel's header line.

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.

Jump to

Keyboard shortcuts

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