Skip to content
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

docs(storybook): use storybook-addon-accessibility-checker #14926

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 7 additions & 1 deletion packages/react/.storybook/main.js
Expand Up @@ -87,7 +87,13 @@ const config = {
},
},
'@storybook/addon-storysource',
'@storybook/addon-a11y',
/**
* For now, the storybook-addon-accessibility-checker fork replaces the @storybook/addon-a11y.
* Eventually they plan to attempt to get this back into the root addon with the storybook team.
* See more: https://ibm-studios.slack.com/archives/G01GCBCGTPV/p1697230798817659
*/
// '@storybook/addon-a11y',
'storybook-addon-accessibility-checker',
{
name: '@storybook/addon-docs',
options: {
Expand Down
19 changes: 19 additions & 0 deletions packages/react/.storybook/preview.js
Expand Up @@ -124,6 +124,25 @@ const globalTypes = {
};

const parameters = {
a11y: {
// Can specify engine as "axe" or "accessibility-checker" (axe default)
engine: 'accessibility-checker',
config: {
rules: [
{
// To disable a rule across all stories, set `enabled` to `false`.
// Use with caution: all violations of this rule will be ignored!
id: 'html_lang_exists',
enabled: false,
},
{ id: 'page_title_exists', enabled: false },
{ id: 'skip_main_exists', enabled: false },
{ id: 'html_skipnav_exists', enabled: false },
{ id: 'aria_content_in_landmark', enabled: false },
{ id: 'aria_child_tabbable', enabled: false },
],
},
},
backgrounds: {
// https://storybook.js.org/docs/react/essentials/backgrounds#grid
grid: {
Expand Down
1 change: 1 addition & 0 deletions packages/react/package.json
Expand Up @@ -121,6 +121,7 @@
"sass": "^1.51.0",
"sass-loader": "^13.0.0",
"storybook": "^7.1.0",
"storybook-addon-accessibility-checker": "^3.1.61-rc.0",
"storybook-readme": "^5.0.9",
"stream-browserify": "^3.0.0",
"style-loader": "^3.3.1",
Expand Down