-
Notifications
You must be signed in to change notification settings - Fork 486
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
feat: custom styles for the confirm
component
#1789
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. Here are a few change requests:
- The "no" button shouldn't use the same style as the "yes" button (i.e.,
reversed = true
). This reduces distinction between the two, making it hard to identify the current selection and potentially introducing safety risks. - There should be a way to style the "no" and "yes" buttons separately, rather than applying the same style to both.
- Please merge the two labels into a single option, like this:
[" [Y]es ", " (N)o "]
. - Please remove
show_scrollbar
andshow_separators
. Scrollbars only appear when needed (i.e., when the content is long enough to require scrolling), so disabling them isn't very meaningful. As forshow_separators
, it reduces clarity between the content and buttons and isn't visually appealing — this will also make it harder to distinguish onceya.confirm()
API is introduced since it will allow arbitrary styles and alignment of its content.
Hopefully all your requests are now satisfied @sxyazi. This brought us back to the correct default: While still allowing us to customize to fit our themes: [confirm]
button_labels = ["Yes", "No"]
border = { fg = "darkgray" }
title = { fg = "darkgray" }
content = { fg = "gray" }
list = { fg = "reset" }
button_yes = { fg = "gray" }
button_no = { fg = "darkgray" } |
5df499d
to
79b4304
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me now, thank you so much for contributing this feature @GrzegorzKozub!
confirm
component
Thank you! |
While preserving the original design if we don't provide any config, this change let's us customize the confirm component further by:
The default design looks like this:
And we can achieve a more minimalistic look that fits the color scheme with the following config:
What do you think?
I'm not sure how to add the new config to the schema.