charm-styling
Skill3 starsChanged 8 months agoMITView on GitHub
Lip Gloss v2 styling and layout patterns for Go. Use when creating or editing terminal styles, colors, borders, layouts, or visual components using Lip Gloss. Triggers on lipgloss.NewStyle, lipgloss.Color, JoinHorizontal, JoinVertical, Place, border usage, or any visual styling of terminal output.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- masonhuemmer/dopsword for word, first seen Mar 24, 2026
Other versions1 project uses a version of this.
Word for word · 1
- masonhuemmer/dops★ 3100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bubbletea-patternsSkill
- clean-code-boundariesSkill
- clean-code-designSkill
- clean-code-errorsSkill
- clean-code-functionsSkill
- clean-code-namingSkill
- clean-code-solidSkill
- clean-code-testingSkill
- cli-structureSkill
- create-runbookSkill
- demo-recordingSkill
- mutation-testingSkill
- shell-scriptsSkill
- spec-workflowSkill
- tdd-workflowSkill
- tui-layoutSkill
- tui-testingSkill
- wizard-formsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Every setter returns a new Style.
- Very specific: line 212
Keep styles in a dedicated file (e.g., styles.go):
- Distinctive: line 231
Do NOT scatter style definitions across View functions.
- Very specific: line 235
Do NOT use bare color strings — lipgloss.Color("#fff") not "#fff"
- Very specific: line 236
Do NOT use fmt.Println with styled output outside BubbleTea — use lipgloss.Println
- Very specific: line 237
Do NOT use style.Copy() — just assign: newStyle := style.Bold(true)
- Very specific: line 238
Do NOT use AdaptiveColor — it's removed in v2, use LightDark
- Very specific: line 239
Do NOT hardcode widths — use WindowSizeMsg and compute responsive sizes
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lip Gloss v2 Styling Patterns
Import: charm.land/lipgloss/v2
Creating Styles
Styles are value types (assignment copies). Copy() is deprecated.
style := lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#FAFAFA")).
Background(lipgloss.Color("#7D56F4")).
Padding(1, 2).
Width(40)
output := style.Render("Hello")Every setter returns a new Style. Chain freely.
Colors (v2 Change)
Colors must use lipgloss.Color() — bare strings no longer work:
lipgloss.Color("#FF00FF") // hex -> TrueColor
lipgloss.Color("205") // ANSI 256
lipgloss.Color("1") // ANSI 16
lipgloss.NoColor{} // transparentNamed constants: lipgloss.Red, lipgloss.Green, lipgloss.BrightCyan, etc.
Dark/Light Background (v2 Change)
AdaptiveColor is removed. Use LightDark:
hasDark := lipgloss.HasDarkBackground(os.Stdin, os.Stdout)
lightDark := lipgloss.LightDark(hasDark)
fg := lightDark(lipgloss.Color("#333"), lipgloss.Color("#ccc"))In BubbleTea: handle tea.BackgroundColorMsg on startup for detection.
Printing (v2 Change — Critical)
v2 does NOT auto-downsample colors. Outside BubbleTea, use lipgloss print functions:
lipgloss.Println(style.Render("text")) // auto-downsamples
lipgloss.Printf("Status: %s\n", styled)
lipgloss.Sprint(styled) // returns downsampled stringInside BubbleTea, rendering handles downsampling automatically.
Layout
// Side by side
lipgloss.JoinHorizontal(lipgloss.Top, left, right)
lipgloss.JoinHorizontal(lipgloss.Center, col1, col2, col3)
// Stacked
lipgloss.JoinVertical(lipgloss.Left, header, body, footer)
lipgloss.JoinVertical(lipgloss.Center, title, content)
// Place in a box
lipgloss.Place(80, 24, lipgloss.Center, lipgloss.Center, content)
lipgloss.PlaceHorizontal(80, lipgloss.Right, text)
lipgloss.PlaceVertical(24, lipgloss.Bottom, text)Position values: lipgloss.Top, lipgloss.Bottom, lipgloss.Left, lipgloss.Right, lipgloss.Center.
Borders
style := lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("#874BFD")).
Padding(1, 2)Built-in borders: NormalBorder(), RoundedBorder(), ThickBorder(), DoubleBorder(), BlockBorder(), HiddenBorder(), ASCIIBorder().
Per-side control:
.BorderTop(true).BorderBottom(true).BorderLeft(false).BorderRight(false)
.BorderTopForeground(lipgloss.Color("#F00"))Dimensions
.Width(40) // min width (pads with spaces)
.Height(10) // min height (pads with newlines)
.MaxWidth(80) // truncates/wraps
.MaxHeight(20) // truncatesPadding and Margin (CSS-like)
.Padding(1) // all sides
.Padding(1, 2) // top/bottom, left/right
.Padding(1, 2, 3, 4) // top, right, bottom, left (clockwise)
.PaddingLeft(4) // individual side
.Margin(1, 2)
.MarginBackground(lipgloss.Color("#333"))Frame Size Helpers
hFrame := style.GetHorizontalFrameSize() // border + padding + margin
vFrame := style.GetVerticalFrameSize()
// Responsive content width:
contentWidth := windowWidth - hFrameText Measurement
w := lipgloss.Width(rendered) // ANSI-aware cell width
h := lipgloss.Height(rendered)
w, h := lipgloss.Size(rendered)New v2 Features
Hyperlinks:
.Hyperlink("https://example.com")Underline styles:
.UnderlineStyle(lipgloss.UnderlineCurly)
.UnderlineColor(lipgloss.Color("#FF0000"))Color manipulation:
lipgloss.Darken(c, 0.2)
lipgloss.Lighten(c, 0.3)
lipgloss.Complementary(c)Gradients:
lipgloss.Blend1D(steps, color1, color2, color3)Style ranges:
lipgloss.StyleRanges(text,
lipgloss.NewRange(0, 5, boldStyle),
lipgloss.NewRange(6, 11, dimStyle),
)Table, List, Tree
import "charm.land/lipgloss/v2/table"
import "charm.land/lipgloss/v2/list"
import "charm.land/lipgloss/v2/tree"Table:
t := table.New().
Headers("Name", "Status").
Row("prod-01", "running").
Row("prod-02", "stopped").
Border(lipgloss.RoundedBorder()).
Width(60).
StyleFunc(func(row, col int) lipgloss.Style {
if row == table.HeaderRow {
return lipgloss.NewStyle().Bold(true)
}
return lipgloss.NewStyle()
})
fmt.Println(t.Render())List:
l := list.New("Item 1", "Item 2", "Item 3").
Enumerator(list.Bullet)Tree:
t := tree.Root("Root").
Child("Foo", tree.Root("Bar").Child("Baz"))Style Organization Pattern
Keep styles in a dedicated file (e.g., styles.go):
package tui
var (
titleStyle = lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#FAFAFA")).
MarginBottom(1)
errorStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("#FF0000"))
subtleStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("#666666"))
)Do NOT scatter style definitions across View functions. Centralize them for consistency.
Common Mistakes to Avoid
- Do NOT use bare color strings —
lipgloss.Color("#fff")not"#fff" - Do NOT use
fmt.Printlnwith styled output outside BubbleTea — uselipgloss.Println - Do NOT use
style.Copy()— just assign:newStyle := style.Bold(true) - Do NOT use
AdaptiveColor— it's removed in v2, useLightDark - Do NOT hardcode widths — use
WindowSizeMsgand compute responsive sizes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

