mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-08-17 18:00:46 +03:00
feat: add BlockBorder
, OuterHalfBlockBorder
, and InnerHalfBlockBorder
border styles (#120)
This commit is contained in:
parent
c85c4f4456
commit
9ee8b6e19f
48
borders.go
48
borders.go
@ -84,6 +84,39 @@ var (
|
||||
BottomRight: "╯",
|
||||
}
|
||||
|
||||
blockBorder = Border{
|
||||
Top: "█",
|
||||
Bottom: "█",
|
||||
Left: "█",
|
||||
Right: "█",
|
||||
TopLeft: "█",
|
||||
TopRight: "█",
|
||||
BottomLeft: "█",
|
||||
BottomRight: "█",
|
||||
}
|
||||
|
||||
outerHalfBlockBorder = Border{
|
||||
Top: "▀",
|
||||
Bottom: "▄",
|
||||
Left: "▌",
|
||||
Right: "▐",
|
||||
TopLeft: "▛",
|
||||
TopRight: "▜",
|
||||
BottomLeft: "▙",
|
||||
BottomRight: "▟",
|
||||
}
|
||||
|
||||
innerHalfBlockBorder = Border{
|
||||
Top: "▄",
|
||||
Bottom: "▀",
|
||||
Left: "▐",
|
||||
Right: "▌",
|
||||
TopLeft: "▗",
|
||||
TopRight: "▖",
|
||||
BottomLeft: "▝",
|
||||
BottomRight: "▘",
|
||||
}
|
||||
|
||||
thickBorder = Border{
|
||||
Top: "━",
|
||||
Bottom: "━",
|
||||
@ -129,6 +162,21 @@ func RoundedBorder() Border {
|
||||
return roundedBorder
|
||||
}
|
||||
|
||||
// BlockBorder returns a border that takes the whole block.
|
||||
func BlockBorder() Border {
|
||||
return blockBorder
|
||||
}
|
||||
|
||||
// OuterHalfBlockBorder returns a half-block border that sits outside the frame.
|
||||
func OuterHalfBlockBorder() Border {
|
||||
return outerHalfBlockBorder
|
||||
}
|
||||
|
||||
// InnerHalfBlockBorder returns a half-block border that sits inside the frame.
|
||||
func InnerHalfBlockBorder() Border {
|
||||
return innerHalfBlockBorder
|
||||
}
|
||||
|
||||
// ThickBorder returns a border that's thicker than the one returned by
|
||||
// NormalBorder.
|
||||
func ThickBorder() Border {
|
||||
|
5
set.go
5
set.go
@ -300,8 +300,9 @@ func (s Style) Border(b Border, sides ...bool) Style {
|
||||
// the border style, the border will be enabled for all sides during rendering.
|
||||
//
|
||||
// You can define border characters as you'd like, though several default
|
||||
// styles are included: NormalBorder(), RoundedBorder(), ThickBorder(), and
|
||||
// DoubleBorder().
|
||||
// styles are included: NormalBorder(), RoundedBorder(), BlockBorder(),
|
||||
// OuterHalfBlockBorder(), InnerHalfBlockBorder(), ThickBorder(),
|
||||
// and DoubleBorder().
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user