-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SetString and String methods
- Loading branch information
1 parent
a24cc9e
commit f25dd6a
Showing
3 changed files
with
71 additions
and
33 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 |
---|---|---|
@@ -1,26 +1,53 @@ | ||
import * as blipgloss from './src' | ||
import type { AdaptiveColor, CustomBorder } from './src' | ||
|
||
// const style = new Style() | ||
|
||
const style = blipgloss.NewStyle() | ||
.Bold(true) | ||
.Foreground("#FAFAFA") | ||
.Background("#7D56F4") | ||
// .PaddingTop(2) | ||
// .PaddingBottom(2) | ||
// .PaddingLeft(4) | ||
.Width(30) | ||
.Padding(1, 4, 2) | ||
.Align(blipgloss.Position.Right) | ||
.BorderStyle({ | ||
Top: "._.:*:", | ||
Bottom: "._.:*:", | ||
Left: "|*", | ||
Right: "|*", | ||
TopLeft: "*", | ||
TopRight: "*", | ||
BottomLeft: "*", | ||
BottomRight: "*", | ||
}) | ||
|
||
console.log(style.Render("Hello, bun clone.")) | ||
const width = 96 | ||
const columnWidth = 30 | ||
|
||
// Style definitions. | ||
|
||
// General | ||
const subtle: AdaptiveColor = { | ||
Light: '#D9DCCF', | ||
Dark: '#383838' | ||
} | ||
const highlight: AdaptiveColor = { | ||
Light: '#874BFD', | ||
Dark: '#7D56F4' | ||
} | ||
const special: AdaptiveColor = { | ||
Light: '#43BF6D', | ||
Dark: '#73F59F' | ||
} | ||
|
||
const divider = blipgloss.NewStyle() | ||
.SetString('.') | ||
.Padding(0, 11) | ||
.Foreground(subtle) | ||
.String(subtle) | ||
|
||
const url = blipgloss.NewStyle().Foreground(special).Render | ||
|
||
// Tabs. | ||
|
||
const activeTabBorder: CustomBorder = { | ||
Top: "─", | ||
Bottom: " ", | ||
Left: "│", | ||
Right: "│", | ||
TopLeft: "╭", | ||
TopRight: "╮", | ||
BottomLeft: "┘", | ||
BottomRight: "└", | ||
} | ||
|
||
const tabBorder: CustomBorder = { | ||
Top: "─", | ||
Bottom: "─", | ||
Left: "│", | ||
Right: "│", | ||
TopLeft: "╭", | ||
TopRight: "╮", | ||
BottomLeft: "┴", | ||
BottomRight: "┴", | ||
} |
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