-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Button: Remove default border from the destructive button #53607
Conversation
Size Change: -8 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
<MenuItem onClick={ () => removePage() } isDestructive> | ||
<MenuItem | ||
onClick={ () => removePage() } | ||
isDestructive | ||
variant="secondary" | ||
> |
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.
Since this button has no variations, a default border is expected. Therefore, the secondary variation has been added. However, this border will be removed in the future in order to unify the style of the delete button in #52597.
<MenuItem | ||
isDestructive | ||
isTertiary | ||
onClick={ () => setIsModalOpen( true ) } | ||
> | ||
<MenuItem isDestructive onClick={ () => setIsModalOpen( true ) }> |
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.
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.
Looks good!
Thanks for the review, @mirka! |
This PR was created based on the discussion in this comment.
What?
This PR removes the default border from the destructive button.
Why?
There are several delete buttons that combine destructive and tertiary statuses, mainly in the Site Editor drop-down menus, in order to unify the style with the default buttons without borders.
However, an unintended tertiary variation background color is applied on mouseover, even though we should only expect the default border to be removed.
If we want to apply a default border to the destructive button, we believe that a default border is unnecessary, because it can be achieved by combining secondary status.
How?
I removed the default box shadow. At the same time, I adjusted the destructive buttons in the codebase to maintain their current behavior.
StoryBook
"variant" variation
The button should display correctly for any variant property.
variant.mp4
"isBusy" variation
The button should display correctly for any variant property.
is-busy.mp4
"isPresed" variation
We can confirm that the black background color and red text color are unnatural and that some actions make the text invisible. However, since this also occurs in trunk, I believe it is outside the scope of this PR.
is-pressed.mp4
Block Editor
I will comment inline after this for buttons with changes made. For the following destructive buttons, removing the default border does not affect their behavior.
"Move to trash" button in the post editor
Since this button already has a secondary variation, the default border will still be displayed.
"Remove track" button in the tracks editor of the video block
The border is not shown from the beginning because it has a link variation.
"Delete menu" button in the navigation block
Since this button already has a secondary variation, the default border will still be displayed.