Style definitions for nice terminal layouts đź‘„
This PR adds support for fancier borders, fixes some bugs, and adds a helper function for measuring text blocks.
With the new border support, it's possible to construct borders from multiple runes, such as this:
Size() (int, int)
for returning the width and the height of a block in one goThoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions.
This PR adds getters for all style rules, enabling you to query your style rules. This can be handy when building layouts, particularly when styles are variable, such as a component. For example:
if headerStyle.GetMarginLeft() > lipgloss.Width(spinner) + lipgloss.Width(gap) {
// jam the spinner in the left gutter
} else {
// just put the spinner on the right
}
For details on the getter API, check out the docs.
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions.
This bugfix fixes a potential data race when querying for the background color internally for the first time.
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions.
This update makes the border color API more consistent with the other color-related potions of the API by dropping the Color suffix in color-related border methods.
Changes to border foreground methods:
BorderForegroundColor
is now BorderForeground
BorderTopForegroundColor
is now BorderTopForeground
BorderRightForegroundColor
is now BorderRightForeground
BorderBottomForegroundColor
is now BorderBottomForeground
BorderLeftForegroundColor
is now BorderLeftForeground
Changes to border background methods:
BorderBackgroundColor
is now BorderBackground
BorderTopBackgroundColor
is now BorderTopBackground
BorderRightBackgroundColor
is now BorderRightBackground
BorderBottomBackgroundColor
is now BorderBottomBackground
BorderLeftBackgroundColor
is now BorderLeftBackground
Also:
UnsetBorderColor
has been removed. To unset border colors use UnsetBorderForeground
and UnsetBorderBackground
.We hope you’re enjoying Lip Gloss!
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions.
This release includes support for the Windows 10 legacy command console, which includes cmd.exe and the standalone PowerShell application on Windows. Lip Gloss should now "just work" on those consoles.
Note that ANSI already works by default in Windows Terminal.
Thoughts? Questions? Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions. We love hearing from you.
We’re excited to present Lip Gloss, a new declarative terminal styling library built with TUIs in mind. We made this library after seeing design patterns emerge while building Bubble Tea projects such as Glow.
Lip Gloss does not replace Bubble Tea. Rather, it is a Bubble Tea companion. It was designed to make building terminal user interfaces—and general terminal rendering—as simple and fun as possible, allowing you to focus on building your application rather than concerning yourself with the nuts and bolts of layout details.
Let us know what you think. Feel free to reach out on Twitter, The Fediverse or right here in GitHub Discussions. We love hearing from you.