theme

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 1 Imported by: 0

README

Theme

Token palette every glyph component reads from.

theme preview

Install

glyph add theme

This copies theme.go (and its test file) into your repo at the path your glyph.json aliases declare. After install, the file is yours: edit it, refactor it, rename it. There is no theme library to keep in sync.

Hello, world

package main

import (
	"fmt"

	"github.com/truffle-dev/glyph/components/theme"
)

func main() {
	t := theme.Default     // dark
	// t := theme.Light    // warm paper
	fmt.Println(t.Primary) // lipgloss.Color
}

API surface

Package: theme

Types

  • Theme

Dependencies

  • github.com/charmbracelet/lipgloss@v1.1.0

Notes

Edit tokens.go to retheme. Default is a dark terminal palette; Light is a warm-paper alternative.

See also

License

MIT, same as the rest of glyph.

Documentation

Overview

Package theme provides the token palette every glyph component reads from.

Components reference the Default theme; consumers replace tokens by editing this file or constructing their own Theme value.

Index

Constants

This section is empty.

Variables

View Source
var Default = Theme{
	Bg:            lipgloss.Color("#0e0e10"),
	Surface:       lipgloss.Color("#16171b"),
	SurfaceStrong: lipgloss.Color("#1f2026"),
	Border:        lipgloss.Color("#2a2c34"),
	BorderStrong:  lipgloss.Color("#3a3c46"),
	Text:          lipgloss.Color("#e6e6ea"),
	TextMuted:     lipgloss.Color("#9a9aa6"),
	TextInverse:   lipgloss.Color("#0e0e10"),

	Primary:       lipgloss.Color("#5e6ad2"),
	PrimaryStrong: lipgloss.Color("#7a86e6"),
	Accent:        lipgloss.Color("#d57e5e"),

	Success: lipgloss.Color("#41b883"),
	Warning: lipgloss.Color("#d8a83c"),
	Error:   lipgloss.Color("#e25555"),
	Info:    lipgloss.Color("#5e9bd2"),
}

Default is the dark terminal theme. Edit this file to retheme the entire app.

View Source
var Light = Theme{
	Bg:            lipgloss.Color("#fbf6ec"),
	Surface:       lipgloss.Color("#f4ecdb"),
	SurfaceStrong: lipgloss.Color("#e8dcc1"),
	Border:        lipgloss.Color("#d6c8a8"),
	BorderStrong:  lipgloss.Color("#a6987a"),
	Text:          lipgloss.Color("#2a261f"),
	TextMuted:     lipgloss.Color("#7d7460"),
	TextInverse:   lipgloss.Color("#fbf6ec"),

	Primary:       lipgloss.Color("#5e6ad2"),
	PrimaryStrong: lipgloss.Color("#7a86e6"),
	Accent:        lipgloss.Color("#d57e5e"),

	Success: lipgloss.Color("#41b883"),
	Warning: lipgloss.Color("#d8a83c"),
	Error:   lipgloss.Color("#e25555"),
	Info:    lipgloss.Color("#5e9bd2"),
}

Light is the light-paper theme. Most components target Default; Light is a drop-in replacement when the consumer's terminal background is bright.

Functions

This section is empty.

Types

type Theme

type Theme struct {
	// Foundational
	Bg            lipgloss.Color
	Surface       lipgloss.Color
	SurfaceStrong lipgloss.Color
	Border        lipgloss.Color
	BorderStrong  lipgloss.Color
	Text          lipgloss.Color
	TextMuted     lipgloss.Color
	TextInverse   lipgloss.Color

	// Accents
	Primary       lipgloss.Color
	PrimaryStrong lipgloss.Color
	Accent        lipgloss.Color

	// Status
	Success lipgloss.Color
	Warning lipgloss.Color
	Error   lipgloss.Color
	Info    lipgloss.Color
}

Theme is the token palette shared across glyph components.

Jump to

Keyboard shortcuts

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