Skip to content

fix(switch): add focus indicator#1874

Merged
christiemolloy merged 1 commit intopatternfly:masterfrom
srambach:switch-focus-1824
Jun 5, 2019
Merged

fix(switch): add focus indicator#1874
christiemolloy merged 1 commit intopatternfly:masterfrom
srambach:switch-focus-1824

Conversation

@srambach
Copy link
Member

This adds a focus indicator to the switch component.
After discussion with @mceledonia, we'll go with a 2px #06C border, 8 px from the edge, but no fill. This allows us to use the outline property rather than creating a pseudo-element, which would have potentially caused z-index problems.

Fixes #1824

@patternfly-build
Copy link
Collaborator

Deploy preview for pf-next ready!

Built with commit a2cc8ca

https://deploy-preview-1874--pf-next.netlify.com

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@mceledonia mceledonia left a comment

Choose a reason for hiding this comment

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

LGTM2!

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

I'm wondering what the decision was to make the focus ring so large around the switch, when theres two switches placed together which I could see happening often, it looks like this:

Screen Shot 2019-06-04 at 8 58 08 AM

@srambach
Copy link
Member Author

srambach commented Jun 4, 2019

To quote @mceledonia, 4px rather than the 8px used felt "like an impending doom slowly closing in on the innocent switch." 😂Also, he felt that the switches shouldn't be placed that close together.

@mceledonia
Copy link

mceledonia commented Jun 4, 2019

Yeah I felt like the 4px was just a bit too tight, but if everyone disagrees I can concede :)

I certainly want to avoid that above - hopefully we can do that with spacing as each toggle should have some kind of label which keeps them further apart. I can't think of many other areas where we have two components less than 8px away from each other... thinking of things like the toolbar, button layouts, etc.. but like I said, if 4px looks fine to everyone else and helps to ensure we avoid the above, we can go with that.

@christiemolloy
Copy link
Member

Ok thanks for explaining @mceledonia ! So this is with 8px margin between them and I think that will work

Screen Shot 2019-06-04 at 9 16 18 AM

@mceledonia
Copy link

Awesome, yeah let's go with that for now... if we have problems in the future we can always bring it down.

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

LGTM!

@mattnolting
Copy link
Collaborator

Beautiful 👍

@christiemolloy christiemolloy merged commit 4a2dd6b into patternfly:master Jun 5, 2019
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

6 participants