-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[@storybook/addon-info] 'Story Source' text violates a11y color contrast ratio #4224
Comments
So, I'm also having this issue. I figured out, the code we're looking for is actually in the As you can see here, Node is being rendered within the
That tagStyle gets used as the style prop for the return (
<div>
<div style={containerStyleCopy}>
<span style={tagStyle}>
<
{name}
</span> If you convert the hex code So, the fix for this would be to allow the
|
@nicholaai Is there any reason the |
@GabiOC, not that i know of. i'll issue a PR with an update soon and we'll see what happens |
Bug or support request summary
Text in the 'Story Source' field in the Info Add-on has a color contrast ratio of 4.29, which fails the 4.5:1 minimum ratio for AA level accessibility compliance.
Aside from this impacting partially sighted users, this also causes a violation to be raised in the a11y add-on.
Changing the font color to black or a darker gray would fix this. https://hexnaw.com is a good resource for checking accessible color combinations.
Steps to reproduce
I tried to trace down where the font color is being added (it's being added inline) but couldn't find where. It looks like we could configure it in the base styles for the
Pre
component that's rendering the text but again, I don't know where the font color is coming from so these styles might get overridden.Example with inaccessible text in 'Story Source' field: https://rcdexta.me/react-event-timeline/?selectedKind=Timeline&selectedStory=Default%20View&full=0&down=0&left=1&panelRight=0
Where the inaccessible text is being rendered: https://github.com/storybooks/storybook/blob/master/addons/info/src/components/Story.js#L262-L295
What the inaccessible text looks like:
Please specify which version of Storybook and optionally any affected addons that you're running
Affected platforms
The text was updated successfully, but these errors were encountered: