WordPress / wporg-parent-2021

21 stars 11 forks source link

Button styles: Add `is-destructive` helper class for red buttons #151

Closed ryelle closed 2 months ago

ryelle commented 2 months ago

For some designs, we need a "destructive" red button, for example deleting a pattern or reporting a pledge. There isn't a consistent design for this, so for the Pattern Directory, the button uses a toggle style with a custom text color. This doesn't work for other buttons which have blue hover/focus styles— instead we need to create a helper class to set all the respective states.

Screenshot 2024-08-28 at 3 57 22 PM Screenshot 2024-08-28 at 3 56 40 PM

This PR attempts to standardize on a few different reds— pomegrade-1 when contrasting with dark (text or backgrounds), #d6310c for the red on white, and #b60000 as a slightly darker red for filled button hover states.

Screenshots

Screenshot 2024-08-28 at 3 55 40 PM

Hover & focus styles:

https://github.com/user-attachments/assets/7d82eed5-f5f4-4bb4-8c06-a1b3fc16794f

To test

ryelle commented 2 months ago

I'm assuming no feedback is a good to merge, since this is a minor blocker for Five for the Future. If there are any changes needed for this "destructive" button, create a new issue.