Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Feb 6, 2023
1 parent 2aa5b78 commit 580ad68
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Expand Up @@ -19,7 +19,8 @@ Users familiar with CSS will feel at home with Lip Gloss.

import "github.com/charmbracelet/lipgloss"

var style = lipgloss.NewStyle("Hello, kitty.").
var style = lipgloss.NewStyle().
SetString("Hello, kitty.").
Bold(true).
Foreground(lipgloss.Color("#FAFAFA")).
Background(lipgloss.Color("#7D56F4")).
Expand Down Expand Up @@ -173,7 +174,8 @@ var style = lipgloss.NewStyle().
Setting a minimum width and height is simple and straightforward.

```go
var style = lipgloss.NewStyle("What’s for lunch?").
var style = lipgloss.NewStyle().
SetString("What’s for lunch?").
Width(24).
Height(32).
Foreground(lipgloss.Color("63"))
Expand Down Expand Up @@ -298,15 +300,15 @@ someStyle.MaxWidth(5).MaxHeight(5).Render("yadda yadda")
Generally, you just call the `Render(string...)` method on a `lipgloss.Style`:

```go
style := lipgloss.NewStyle("Hello,").Bold(true)
style := lipgloss.NewStyle(lipgloss.WithString("Hello,")).Bold(true)
fmt.Println(style.Render("kitty.")) // Hello, kitty.
fmt.Println(style.Render("puppy.")) // Hello, puppy.
```

But you could also use the Stringer interface:

```go
var style = lipgloss.NewStyle("你好,猫咪。").Bold(true)
var style = lipgloss.NewStyle(lipgloss.WithString("你好,猫咪。")).Bold(true)

fmt.Println(style)
```
Expand Down

0 comments on commit 580ad68

Please sign in to comment.