-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add styles section and examples
- Loading branch information
1 parent
169c012
commit a9f75d2
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/charmbracelet/lipgloss" | ||
"github.com/charmbracelet/log" | ||
) | ||
|
||
func main() { | ||
log.ErrorLevelStyle = lipgloss.NewStyle(). | ||
SetString("ERROR!!"). | ||
Padding(0, 1, 0, 1). | ||
Background(lipgloss.Color("204")). | ||
Foreground(lipgloss.Color("0")) | ||
log.KeyStyles["err"] = lipgloss.NewStyle().Foreground(lipgloss.Color("204")) | ||
logger := log.New() | ||
logger.Error("Whoops!", "err", "kitchen on fire") | ||
time.Sleep(3 * time.Second) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Output styles.gif | ||
|
||
Set Height 250 | ||
Set Width 700 | ||
|
||
Type "./styles" Sleep 500ms Enter | ||
|
||
Sleep 3s |