-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Icon Tooltip update for WCAG 2.1 compliance #3115
Icon Tooltip update for WCAG 2.1 compliance #3115
Conversation
Deploy preview for the-carbon-components ready! Built with commit 2d4ef90 https://deploy-preview-3115--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 2d4ef90 https://deploy-preview-3115--carbon-components-react.netlify.com |
Deploy preview for carbon-elements failed. Built with commit 2d4ef90 https://app.netlify.com/sites/carbon-elements/deploys/5d0a5b5c6187780008d79c33 |
Deploy preview for the-carbon-components ready! Built with commit f4d6bf1 https://deploy-preview-3115--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit f4d6bf1 https://deploy-preview-3115--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit f4d6bf1 |
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.
@emyarod what version of DAP are you using? The latest is |
FYI, my plan was to remove the legacy versions from the demo (so they don't make it on to the website) once the legacy version has been verified to still work with the changes. |
@elizabethsjudd just curious, what were the violations that this PR is hoping to address? |
{{!-- @todo Had to add a modifier to the parent to correct the animation but in the next major release it could be removed in favor of the new HTML format --}} | ||
<button | ||
class="{{@root.prefix}}--tooltip__trigger {{@root.prefix}}--tooltip--a11y {{@root.prefix}}--tooltip__trigger--icon {{@root.prefix}}--tooltip--left {{@root.prefix}}--tooltip--align-start"> | ||
{{!-- @todo Open to suggestions for this element's className; In WH we have a utility class (wh-u-a11yTitle) that can be applied to other components --}} |
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.
seems out-of-scope for this pr, but I'd vote for a global class for these a11y styles as they could be very useful in other situations. Then, {{@root.prefix}}--tooltip__content
could bring those in for this use-case, but not have them locked to this component.
@joshblack with WCAG 2.1 buttons that don't have text in them fail AAT because it reads it as missing a visible label. By moving the content from |
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.
This looks good to me. Thanks a ton @elizabethsjudd 🏄🏽♂️
I'd like @snidersd to get eyes on this since there's a fair few (seemingly much needed) changes. 👍🏽
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.
Thanks @elizabethsjudd for jumping in!
@emyarod Would you have a chance to test it, especially considering long text (if you haven't done yet)? Thanks!
overflow: hidden; | ||
clip: rect(0, 0, 0, 0); | ||
border: 0; | ||
visibility: visible; |
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.
visibility:visible
undoes visiblity:hidden
in an ancestor node. I'd recommend visibility:inherit
.
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.
Also does this have similar purpose of .bx--assistive-text
? https://github.com/carbon-design-system/carbon/blob/v10.3.0/packages/components/src/globals/scss/_css--helpers.scss#L17-L29
@elizabethsjudd unfortunately I'm not able to view the page, I'm just taken to an "Access Denied" even after authenticating. would it be possible to just share the .crx? not sure how to gain access to the a11y tools page you linked @asudoh yeah it seems fine with long text and functions as expected, but I am seeing the tooltip caret finish animating before the tooltip body though (tagging @shixiedesign for design review). my guess is we can apply the same opacity + animation rules to the caret? |
@emyarod what is |
Thanks so much @elizabethsjudd! Really appreciate it 🙏 |
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.
Thank you! And especially thanks for double checking the motion part too 🙏
After finally getting to do the review, I noticed a tiny gap between the triangle of the tooltip & the tooltip body box. Vanilla only. @emyarod explained this is also magnification dependent so I'm not sure if there's a fix. If not I guess it's not a big deal, lemme know @elizabethsjudd Everything else looks great!
@shixiedesign thanks for the review! I've noticed the gap between the body and caret as well but I saw it happen with the current implementation. As I was working on the definition tooltip, I noticed that the caret placement was actually quite finicky based on surrounding components/styles that were having odd side-effects with the component. I do feel like it's a valid issue to re-access the caret placement given all of the available demos, but that it's beyond the scope of this PR where I'm really focused on the a11y of the component while maintaining existing behaviors and styles. |
@elizabethsjudd Though we don't have a guideline for this topic, it'd be great if you can figure out a way to avoid |
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.
👍 agreed! Thanks for the fix!
@asudoh out of curiosity, why do you avoid the |
…feature/icon-tooltip
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.
meant to comment in #3151
@asudoh @elizabethsjudd I'm also curious as to why we should avoid |
@elizabethsjudd @tw15egan Good question from you both! The event I lead to my inclination to avoid |
@asudoh I agree with the fact that |
Thank you for sharing your thoughts @elizabethsjudd - If I can focus on just one thing, you are right that |
@asudoh thanks for filling me in! Makes sense, and I agree in this situation. @elizabethsjudd hit it on the head here:
|
@tw15egan Yes makes sense! - What I meant by my first comment wrt |
@asudoh I'm happy! Let's do it 🏄 |
Closes #3094
Update to Icon Tooltip to pass AAT ruleset for WCAG 2.1
Changelog
Changed
span
within the button instead of thearia-label
attribute.bx--tooltip--a11y
modifier to the trigger buttonTesting / Reviewing
Before:
After: