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

Stepper fixes: font, margins, and visible outline #735

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

OskiTheCoder
Copy link
Member

@OskiTheCoder OskiTheCoder commented Oct 25, 2023

📝 Changes

  • use subtitle1 as font-style instead of two different fonts predicated on state
  • clean up margin styles
  • confirmed that each Step should have a visible focus ring / outline

@stephenjwatkins
Copy link
Contributor

nice! this is a lot better.

i think the only thing that would be an improvement is having the focus indicator only show up for focus-visible states. right now it shows up, at least for me, when simply clicking a stepper button with the mouse, which can be a little jarring.

i have used React Aria's useFocusRing hook to normalize this process, as sometimes it gets a little finicky using the native :focus-visible pseudo class. i've done something like this in the past and it's worked well:

image image

@OskiTheCoder
Copy link
Member Author

nice! this is a lot better.

i think the only thing that would be an improvement is having the focus indicator only show up for focus-visible states. right now it shows up, at least for me, when simply clicking a stepper button with the mouse, which can be a little jarring.

i have used React Aria's useFocusRing hook to normalize this process, as sometimes it gets a little finicky using the native :focus-visible pseudo class. i've done something like this in the past and it's worked well:

image image

ah good call!

i went ahead and added it, but i noticed sometimes im still getting the visible outline on click, but not everytime, not sure if my browser is just being weird or if theres a safe way to guard against that with something like,

&:focus:not(.focusVisible) { outline: none; }

although im not sure if thats harming accessibility in a different way

@stephenjwatkins
Copy link
Contributor

i went ahead and added it, but i noticed sometimes im still getting the visible outline on click, but not everytime, not sure if my browser is just being weird

makes sense. with this code in place, you'll want to actually set the outline: none; on the .StepButton, turning off the normal outlining feature since we're providing our own.

then you'll want to bring the .focusVisible class out to the top level of the CSS module instead of being nested under .StepButton (or use &.focusVisible). right now, it's not being picked up since the class is being applied on the button itself, and not as a descendent of the button.

i think with those changes it should work as intended—only on keyboard navigation.

Copy link
Contributor

@stephenjwatkins stephenjwatkins left a comment

Choose a reason for hiding this comment

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

nice!

@OskiTheCoder OskiTheCoder merged commit e9cfa62 into main Oct 26, 2023
4 checks passed
@OskiTheCoder OskiTheCoder deleted the stepper_component_fixes branch October 26, 2023 23:46
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.

2 participants