mirror of
https://github.com/charmbracelet/gum.git
synced 2024-11-05 05:46:36 +03:00
09feddcc61
Style provides a shell script interface for Lip Gloss. It allows you to use Lip Gloss to style text without needing to use Go. All of the styling options are available as flags. Let's make some text glamorous using bash: ``` gum style \ --foreground "#FF06B7" --border "double" \ --margin 2 --padding "2 4" --width 50 \ "And oh gosh, how delicious the fabulous frizzy frobscottle" \ "was! It was sweet and refreshing. It tasted of vanilla and" \ "cream, with just the faintest trace of raspberries on the" \ "edge of the flavour. And the bubbles were wonderful." ``` Output: ``` ╔══════════════════════════════════════════════════╗ ║ ║ ║ ║ ║ And oh gosh, how delicious the fabulous ║ ║ frizzy frobscottle was It was sweet and ║ ║ refreshing. It tasted of vanilla and ║ ║ cream, with just the faintest trace of ║ ║ raspberries on the edge of the flavour. ║ ║ And the bubbles were wonderful. ║ ║ ║ ║ ║ ╚══════════════════════════════════════════════════╝ ```
14 lines
375 B
Go
14 lines
375 B
Go
package style
|
|
|
|
import "github.com/charmbracelet/lipgloss"
|
|
|
|
// border maps strings to `lipgloss.Border`s
|
|
var border map[string]lipgloss.Border = map[string]lipgloss.Border{
|
|
"double": lipgloss.DoubleBorder(),
|
|
"hidden": lipgloss.HiddenBorder(),
|
|
"none": {},
|
|
"normal": lipgloss.NormalBorder(),
|
|
"rounded": lipgloss.RoundedBorder(),
|
|
"thick": lipgloss.ThickBorder(),
|
|
}
|