-
Notifications
You must be signed in to change notification settings - Fork 468
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
feat(@clayui/css): Adds global classes to configure accessibility #5549
Conversation
Awesome! |
@pat270 I think we could try to merge the two here, for example using Just to remember that |
@ethib137 @marcoscv-work here is what it looks like with focus visible on Chrome: focus-visible-tab.movThe focus outline is not shown on click only when you navigate with tab via keyboard. It works this way on Edge and FF. Safari has some inconsistencies, e.g., clicking a dropdown toggle shows focus outline. It might be due to our CSS, but I need to verify it. @ethib137 regarding this issue #5006 (comment), we would need to supply a Last thing, focus-visible does nothing for inputs. They will show the outline on click. @marcoscv-work I was thinking if customers want the outline off by default, they could change the Sass variables |
This seems appropriate to me. Inputs are a very different situation than buttons since a user will usually interact with them via the keyboard after clicking on them. As a result it's essential for a user to visually see where the focus is so they know where the characters they type will be added. The cursor alone is not very easy to see, when scanning inputs in a form. |
Is there anything else needed for this PR? It would be great if we could get it added to the next release today. Would that be possible? @pat270 @matuzalemsteles |
…refers-expanded-text selectors fix(@clayui/css): Mixins clay-map-to-css shouldn't error when using ~ and + combinators
…utput .c-prefers-expanded-text selectors
- .c-prefers-link-underline forces all anchor tags to be underlined unless it has role="button" - .c-prefers-reduced-motion removes all transitions and animations - .c-prefers-letter-spacing-1 adds more spacing between characters - .c-prefers-expanded-text disables text-truncate
@ethib137 I'm still working on the focus outline setting. I excluded it from this pr. I'll send another pull for the focus outline stuff. |
Thanks @pat270 , yeah it's better to get this merged sooner without focus outline if that is taking longer. 😄 |
1 similar comment
Thanks @pat270 , yeah it's better to get this merged sooner without focus outline if that is taking longer. 😄 |
Ok, so will I go ahead and merge that PR for us to include in the release. |
This adds some global classes to configure accessibility outlined in https://issues.liferay.com/browse/LPS-178191. You add it to the
body
element.c-prefers-no-focus-outlineremoves outline and box-shadows on focusI have a doubt about the focus outline,
c-prefers-no-focus-outline
. A lot of stuff becomes unnavigable with keyboard due to no color/background-color change on focus. We rely on the outline to show focus for most areas. I feel like this will turn into an "accessibility" regression that will take some time to implement and will be fragile.We have an old issue / pr, #5006, open where we explore implementing
:focus-visible
. In my opinion, we shouldn't offerFocus double border style
in the accessibility menu and implement:focus-visible
.How it works: The browser doesn't show the focus outline when clicking with a mouse unless the user interacts with the site via keyboard. Then the focus outlines will show until page refresh.
Another alternative we have is the Clay utility
c-inner
. This is a hack that allows the focus to go to aspan
element on click preventing the outline being shown. But if you navigate by keyboard, the focus will travel to the correct elements.fixes #5546
/cc @ethib137 @marcoscv-work @matuzalemsteles