Skip to content
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

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

dierat
Copy link
Contributor

@dierat dierat commented Aug 29, 2022

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. The transition is targeting all, 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 dismissable PageLevelBanner 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.)

@dierat
Copy link
Contributor Author

dierat commented Aug 29, 2022

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #205509: EDS Button focus outline cut off in Safari.

@dierat dierat force-pushed the diedra/focus/fix-transition branch from 64b3fcc to d47c301 Compare August 29, 2022 15:33
Comment on lines +31 to +35
transition: color var(--eds-anim-fade-quick) var(--eds-anim-ease);

@media screen and (prefers-reduced-motion) {
transition: none;
}
Copy link
Contributor Author

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
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #1249 (d47c301) into next (a337a40) will not change coverage.
The diff coverage is n/a.

@@           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

@dierat dierat marked this pull request as ready for review August 29, 2022 15:39
@dierat dierat requested a review from a team August 29, 2022 15:40
@dierat
Copy link
Contributor Author

dierat commented Aug 29, 2022

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #208013: Banner focus indicators doesn't work in Safari.

Copy link
Contributor

@jinlee93 jinlee93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed working on Safari
image
thanks for the fix!

Copy link
Contributor

@ahuth ahuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🤘

@dierat dierat merged commit 7d3fb43 into next Aug 31, 2022
@dierat dierat deleted the diedra/focus/fix-transition branch August 31, 2022 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants