-
Notifications
You must be signed in to change notification settings - Fork 362
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
Radio Group: Update coding of current examples to use APG coding practices #1878
Conversation
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.
+1
These work well in Edge, Chrome, and Firefox in both HCM Black and HCM White.
Cool that Chrome now supports WHCM out of the box!
Thanks, @jongund !
Note that if you are having HCM issues with Firefox, you have to close Firefox completely and then reopen it with HCM mode already on. Firefox needs to do some HCM initialization, so it always needs to be restarted, even when just switching from HCM White to HCM Black.
Confirmed that Codepen works also. |
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.
@jongund Thanks for adding visual clue(affordance) for hover!
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.
@jongund
We have two different wordings for the explanation of SVG coloring in high contrast mode. It looks to me like the code is the same in both examples though.
In Radio Group Example Using aria-activedescendant, accessibility features say:
To ensure the data:image/svg+xml SVG graphics in the CSS have sufficient contrast with the background when high contrast settings invert colors, the CSS currentColor value for the stroke and fill properties to synchronize the colors with text content. If specific colors were used to specify the stroke and fill properties, the color of these elements would remain the same in high contrast mode, which could lead to insufficient contrast between them and their background or even make them invisible if their color were to match the high contrast mode background.
NOTE: The data:image/svg+xml SVG elements need to set the CSS forced-color-adjust property to auto for some browsers to support the currentColor value.
In Radio Group Example Using Roving tabindex, accessibility features say:
To ensure the borders of the inline SVG radio button graphics in the CSS have sufficient contrast with the background when high contrast settings invert colors, the color of the borders are synchronized with the color of the text content. For example, the color of the radio button borders are set to match the foreground color of high contrast mode text by specifying the CSS currentColor value for the stroke property of the circle elements used to draw the radio button. To make the background of the circle elements match the high contrast background color, the fill-opacity attribute of the rect is set to zero. If specific colors were instead used to specify the stroke and fill properties, those colors would remain the same in high contrast mode, which could lead to insufficient contrast between the rail and the thumb or even make them invisible if their color matched the high contrast mode background.
Note: The SVG element needs to have the CSS forced-color-adjust property set to auto for the currentColor value to be updated in high contrast mode. Some browsers do not use auto for the default value.
The second version used for the roving tabindex example is more clear. However, this phrase needs to be changed as it is talking about slider elements, not radio elements:
which could lead to insufficient contrast between the rail and the thumb or even make them invisible if their color matched the high contrast mode background.
@mcking65 |
@jesdaigle , please review code and tests on his. @a11ydoer, we don't need any additional screen reader testing for accessibility, but a double check of high contrast would be good. I don't think we need any other accessibility review on this. |
@mcking65 sounds good. I will work on it this evening and finish the review. |
@mcking65 I checked both examples with high contrast in firebox(noted as the issue in the begining) and chrome in Window 10. Both look great. |
Update the radio button examples to:
content
property.currentColor
andforced-color-adjust
with SVG to support high contrast modes of operating systems.Issues:
Preview radio button example
Preview radio button example using
aria-activedescendant