-
-
Notifications
You must be signed in to change notification settings - Fork 24
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(button): add disabled styles for danger variant #518
base: main
Are you sure you want to change the base?
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.
Thanks, Sem!
So beside adding styles to the disabled state, we will also need to lift the type restriction as currently the consumers would get a TS error if they write:
<Button variant="danger" disabled>
Button text
</Button>
For context, we have the restriction in place because we weren't sure how disabled danger and info buttons would look like, and since there weren't any use cases of those, we decided to "turn off" this feature until we have an opportunity to revisit the styles.
Anyway, to lift the restriction, we would need to:
"border-foreground-danger-disabled", | ||
"bg-background-danger-disabled", | ||
"text-foreground-danger-disabled", |
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.
@ahmaxed I'm wondering what you think about this.
We currently only allow the primary button to have disabled state, and when disabled, the button has its opacity set to 80%. This styling approach works for the primary button because the button looks grayed out when disabled. Though it doesn't really work with danger style.
I don't recommend decreasing the opacity level further, as the current level is already pretty low for a11y.
So I'm wondering if you're okay with this approach (changing the color combination) and if you have any suggestions for the color combination.
Thanks for the detailed review @huyenltnguyen, I am not sure if I got the requested colors correct, could you give it another look? |
Sorry, @Sembauke, I got myself confused also 😅 I believe the chosen color combination is I'll wait for Ahmad to weight in. Though I'll explore some other alternative combinations, too, as the |
Checklist:
Update index.md
)Closes #473
Disabled state: