-
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
Remove "destructive" variant of Components #51639
Comments
Pinging @ciampo for his opinion here. |
To add a little nuance, I think an argument can be made to keep the destructive color, for historical usage and for use cases like this one: My point with the comment was specifically that for Confirm dialogs like the one employed for "Are you sure you want to delete this navigation menu", I consider that component to be the warning that it is destructive, and not in need of further warning signals. To an extent I think of it as an extension of the JS |
Ah ok so this Issue isn't warranted then and can be closed? |
Not sure — I'd love to codify the practice, but I'm not sure if it should be in guidelines or whether the buttons inside a Confirm dialog can be locked down. |
I was going to say I didn't think we have a standard "dialog" component but it looks like we do https://wordpress.github.io/gutenberg/?path=/story/components-experimental-confirmdialog--default So therefore we should check we don't have a prop on that component that allows for destructive. I think we should close this Issue however as I don't think it makes sense anymore. |
A bit late to this conversation!
If we want to discourage using that prop, we could:
|
@ciampo Apologies. It opened and closed too quickly. I was a bit hasty! It looks like Joen was justing wanting to avoid "destructive" on confirmation dialogs. As we don't appear to have that prop exposed on the experimental dialogue component I think we're ok on that front now 🙇 |
Sorry about the detour! I think the conversation remains valid (but maybe it can be primarily conversation at this stage), "red" for "bad" isn't necessarily going to help any flows other than make one pause, and for actually destructive (no trash/revisions situations), an "Are you sure" seems better. |
In the case of "destructive" actions, showing a confirmation dialog definitely sounds like a good pattern. IMO, color can aid users in setting expectations around a piece of UI, but it should not be considered the main way that meaning is conveyed. If at a later point we wanted to remove the destructive styles from |
Yep, sounds good. We can shelve the conversation and revisit, my main purpose was mainly to omit the destructive color from modals and confirm dialogs, since in those cases you are already in the "are you sure" part of the flow, with no need to warn further. |
As mentioned by @jasmussen in #50843 we should avoid the destructive variant of components.
Let's codify this convention by removing the props so as to avoid developers being able to introduce it into the codebase.
This has been noted in #51561 and we are fixing in #51565
If that's the case then let's deprecate the props of the relevant
@wordpress/components
so that we codify the convention 🙏Originally posted by @getdave in #50843 (comment)
The text was updated successfully, but these errors were encountered: