-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Change color on destructive button focus state #44427
Change color on destructive button focus state #44427
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.
Great fix, thank you!
The Primary Destructive looks good to me, though I'm not entirely convinced about the non-Primary Destructive. Maybe we should keep the non-darkened red for the text color? That seems to be more in line with what the focus styles do on the other variants.
If it's simple enough to also fix in this PR, I noticed that the text color for Destructive Link is also still blue:
CleanShot.2022-10-14.at.22.09.15.mp4
And lastly, if you could add a quick changelog, that would be great 👍 (I think we can file this under Bug Fix)
Thanks @mirka for following up. I now attempted to normalize them with the least amount of changes, which hopefully is good enough for a merge (better than what's there now I think) Link: link.movDefault: default.movPrimary: primary.movEach button will hover to a 20% darker color, then when pressed show its natural color, and finally when unpressed/released, revert to the 20% darker again until it later loses focus. I think the remaining button styles need some attention from someone more in tuned with the project to make some opinionated decision on overall styling (e.g. removing the gray from tertiary buttons would be an improvement, in my opinion). |
Tests failed but looks unrelated. I don't think I can restart them with my access without an arbitrary code change |
Noticed someone triggered the test. One thing I noticed just now is the focus border is missing. I'm going to tweak it now to include that. Not sure if it should be red or blue but it looks like in other places it was intended to be red. |
With the latest update (to include more uniform focus borders): I think it's good for review now at your convenience, thanks. Primary: primary.movLink: link.movDefault: default.mov |
While waiting for Lena to take another look at this, I'll just flag that PHP unit test failures are unrelated and should be fixed by rebasing (once #44507 is merged) |
I agree that these component styles need some refactoring and normalization, and your changes do bring it closer to that! However the challenge here is that How about we keep this PR to the bug fix aspect of (Any broader normalization should be discussed separately with the design team, and I imagine those PRs would need to be split by style variant so the surface area of regression testing might be manageable.) |
That make sense. I've updated it now to only include changes to the three destructive styles: Screen.Recording.2022-10-25.at.2.58.25.PM.movAlso, if you think it's easier to tweak something yourself feel free to just push a change directly. |
I was trying to iron out the minor remaining inconsistencies and realized how convoluted this actually is 😂 I now think the cleanest way to accomplish this is to override the CSS variables. We can basically delete all the @KevinBatdorf I can't push directly because as an external contributor your branch is not technically a part of this repo yet. But here's the commit that I would've pushed. What do you think? cc @ciampo ^ if you have any concerns with this approach. |
That seems fine to me. I'm trying to figure out how to merge in that commit. |
Would the patch file be easier? |
897e12d
to
c264be0
Compare
Yeah I was able to apply it. Still ran into some problems with it though. I'll just leave a note here in case someone ends up here from Google trying to apply a patch like this:
|
The approach looks smart, I like it! There may still be regressions, unfortunately — I quickly checked storybook and noticed that the text color for the @mirka, could this PR be a good enough excuse to add viz reg tests to We still probably do a good amount of manual testing for potential regressions in the editor, I'm afraid.
That's a well-known fact! Unfortunately We've been definitely trying to polish the component when possible, though! Apart from bug fixes, we've recently re-written the component's stories to use controls, and we're planning on refactoring the component to TypeScript too in the near future. I guess the main thing that would make the work on component easier would be to clean up the style overrides, but that's not an easy task nor a quick one. |
I'm happy to work on any suggestions you have. I'm just worried I may not be the best person to make changes here since I don't have a ton of context of how it all fits together. It's also not clear what's a bug and what's not a bug (or as you mention, what could be a bug but still probably needs to stay as is for the time being) I think there are two options at the moment?
|
Is this about
For this PR, I think our goal should be to correct the obvious bugs and leave the code in an incrementally better state (which we have both accomplished!) so we can continue addressing the wider problems. Good news is, |
For reference, here are the state combinations for
And no obvious style overrides that would be relevant to this PR, so code-wise I feel pretty safe. (Assuming that third-party consumers are using it in similar ways and at a similarly low frequency.) |
@mirka just to confirm/clarify, you're suggesting this PR is good as it stands currently, or are you suggesting changes? Also, if you would like to make a suggestion for a followup PR (e.g. visual tests) I'm happy to follow up as well. |
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.
LGTM 🚀
As Lena mentioned above, this PR does a great job of improving incrementally the styles of the destructive button — and it does so cleverly using CSS variables.
There's a lot to do for Button
, but this PR is definitely a (small) step in the right direction. Thank you to you both for working on this, @KevinBatdorf and @mirka !
What?
This is a minor change to the two destructive buttons' focus state
Why?
How?
Changes some of the styles in button.scss
Testing Instructions
Load the project, start up storybook (http://localhost:50240), view the buttons
Screenshots or screencast
Before:
before.mov
After:
after.mov
Closes #44426