-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore(clickable-style): make transition target more specific #1249
Conversation
This pull request has been linked to Shortcut Story #205509: EDS Button focus outline cut off in Safari. |
64b3fcc
to
d47c301
Compare
transition: color var(--eds-anim-fade-quick) var(--eds-anim-ease); | ||
|
||
@media screen and (prefers-reduced-motion) { | ||
transition: none; | ||
} |
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.
I also added a transition for svgs because I noticed we're changing the color on hover/focus but we're not animating it, which might look weird against the animating button colors.
Codecov Report
@@ Coverage Diff @@
## next #1249 +/- ##
=======================================
Coverage 91.18% 91.18%
=======================================
Files 297 297
Lines 4117 4117
Branches 749 749
=======================================
Hits 3754 3754
Misses 362 362
Partials 1 1 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This pull request has been linked to Shortcut Story #208013: Banner focus indicators doesn't work in Safari. |
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.
LGTM 🤘
Summary:
Currently our buttons don't have visible focus outlines in Safari. Through process of elimination, I found that the source of the issue is the
transition
styling. Thetransition
is targetingall
, not specific CSS properties (which is considered best practice). I don't know exactly what's going on, but making the transition specific, which I was planning to do anyway at some point, fixes this.Test Plan:
Open storybook in Safari,
navigate to either the
Button
component and a component that uses it (like the dismissablePageLevelBanner
stories),tab to the button with your keyboard,
and verify the focus outline is visible.
(Please note that you need to have turned on the "Press Tab to highlight each item on a webpage" accessibility setting in Safari to see this functionality.)