github charmbracelet/lipgloss v0.2.0

latest releases: v0.10.0, v0.9.1, v0.9.0...
3 years ago

Getters

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.

The Charm logo

Don't miss a new lipgloss release

NewReleases is sending notifications on new releases.