Skip to content

Commit

Permalink
chore(docs): links + minor grammar fixes (#409)
Browse files Browse the repository at this point in the history
Co-authored-by: Ayman Bagabas <[email protected]>
  • Loading branch information
bashbunni and aymanbagabas authored Dec 4, 2024
1 parent 8f4aab7 commit 59cbf28
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
7 changes: 4 additions & 3 deletions color.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,14 @@ type LightDarkFunc func(light, dark color.Color) color.Color
// In practice, there are slightly different workflows between Bubble Tea and
// Lip Gloss standalone.
//
// In Bubble Tea listen for tea.BackgroundColorMsg, which automatically
// flows through Update on start, and whenever the background color changes:
// In Bubble Tea, listen for tea.BackgroundColorMsg, which automatically
// flows through Update on start. This message will be received whenever the
// background color changes:
//
// case tea.BackgroundColorMsg:
// m.hasDarkBackground = msg.IsDark()
//
// Later, when you're rendering:
// Later, when you're rendering use:
//
// lightDark := lipgloss.LightDark(m.hasDarkBackground)
// red, blue := lipgloss.Color("#ff0000"), lipgloss.Color("#0000ff")
Expand Down
4 changes: 2 additions & 2 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func BackgroundColor(in *os.File, out *os.File) (bg color.Color, err error) {
// lightDark := LightDark(hasDarkBG)
// myHotColor := lightDark("#ff0000", "#0000ff")
//
// This is intedded for use in standalone Lip Gloss only. In Bubble Tea, listen
// for tea.BackgroundColorMsg in your update function.
// This is intended for use in standalone Lip Gloss only. In Bubble Tea, listen
// for tea.BackgroundColorMsg in your Update function.
//
// case tea.BackgroundColorMsg:
// hasDarkBackground = msg.IsDark()
Expand Down
2 changes: 1 addition & 1 deletion set.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (s Style) Italic(v bool) Style {

// Underline sets an underline rule. By default, underlines will not be drawn on
// whitespace like margins and padding. To change this behavior set
// UnderlineSpaces.
// [Style.UnderlineSpaces].
func (s Style) Underline(v bool) Style {
s.set(underlineKey, v)
return s
Expand Down
7 changes: 3 additions & 4 deletions size.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// ignored and characters wider than one cell (such as Chinese characters and
// emojis) are appropriately measured.
//
// You should use this instead of len(string) len([]rune(string) as neither
// You should use this instead of len(string) or len([]rune(string) as neither
// will give you accurate results.
func Width(str string) (width int) {
for _, l := range strings.Split(str, "\n") {
Expand All @@ -24,9 +24,8 @@ func Width(str string) (width int) {
}

// Height returns height of a string in cells. This is done simply by
// counting \n characters. If your strings use \r\n for newlines you should
// convert them to \n first, or simply write a separate function for measuring
// height.
// counting \n characters. If your output has \r\n, that sequence will be
// replaced with a \n in [Style.Render].
func Height(str string) int {
return strings.Count(str, "\n") + 1
}
Expand Down
6 changes: 3 additions & 3 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (p props) has(k propKey) bool {
}

// NewStyle returns a new, empty Style. While it's syntactic sugar for the
// Style{} primitive, it's recommended to use this function for creating styles
// [Style]{} primitive, it's recommended to use this function for creating styles
// in case the underlying implementation changes.
func NewStyle() Style {
return Style{}
Expand Down Expand Up @@ -155,10 +155,10 @@ func joinString(strs ...string) string {
}

// SetString sets the underlying string value for this style. To render once
// the underlying string is set, use the Style.String. This method is
// the underlying string is set, use the [Style.String]. This method is
// a convenience for cases when having a stringer implementation is handy, such
// as when using fmt.Sprintf. You can also simply define a style and render out
// strings directly with Style.Render.
// strings directly with [Style.Render].
func (s Style) SetString(strs ...string) Style {
s.value = joinString(strs...)
return s
Expand Down

0 comments on commit 59cbf28

Please sign in to comment.