Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce triangle border #223

Closed
wants to merge 1 commit into from
Closed

Conversation

nervo
Copy link
Contributor

@nervo nervo commented Sep 15, 2023

This looks like this :)

◤▼▼▼▼▼▼▼▼◥
▶        ◀
▶  Foo   ◀
▶  Bar   ◀
▶        ◀
◣▲▲▲▲▲▲▲▲◢

You could say that's a bit ugly, but such a border unleash its real power when used for styling - for instance - list elements:

  Foo
▶ Bar
  Baz

In this example, normal elements got a simple PaddingLeft(2), where focus element got PaddingLeft(1).BorderStyle(lipgloss.TriangleBorder()).BorderLeft(true).

@testinfected
Copy link

Exactly what I needed for some of my use cases. Thanks!

@maaslalani
Copy link
Member

Hi @nervo, thanks for the PR and contribution! We haven't seen too much demand for the Triangle border and since we would like to keep the API surface as small as possible I think it is better if this border is added case-by-case into the code as a custom border rather than supporting it in Lip Gloss.

If many more people ask for this border however we would gladly support it and I will re-open this PR!

Thanks again for the awesome contribution!

@maaslalani maaslalani closed this Mar 5, 2024
@maaslalani
Copy link
Member

maaslalani commented Mar 5, 2024

For what it's worth, we are planning on adding a List renderer to Lip Gloss which should solve many of your use cases of this border.

@nervo nervo deleted the patch-1 branch May 12, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants