lipgloss
lipgloss copied to clipboard
feat!(borders): add ability apply left/right borders only
Horizontal Borders Only
This set of revision fixes some quirks with the border algorithm allowing you to set left and right borders only using various logical techniques:
// Renders「你好」
s := lipgloss.NewStyle().
BorderStyle({Left: "「", Right: "」").
Render("你好")
// Renders │Hello│
s = lipgloss.NewStyle().
BorderStyle(lipgloss.NormalBorder()).
BorderLeft(true).
BorderRight(true).
Render("Hello")
fmt.Println(s)
// Renders
// │ Ciao │
// │ Bella │
s = lipgloss.NewStyle().
BorderStyle(lipgloss.NormalBorder()).
Inline(true).
Padding(1).
Render("Ciao\nBella")
This changes the way the render works slighly, but for all intents and purposes the impact should be little to none.
Also included are a series of border tests.