Skip to content

UI: improve A11Y remove redundant styling rules, update icon color#24402

Merged
cdedreuille merged 2 commits into
storybookjs:nextfrom
tolkadot:fix/a11y-addon/arrow-color-update
Nov 7, 2023
Merged

UI: improve A11Y remove redundant styling rules, update icon color#24402
cdedreuille merged 2 commits into
storybookjs:nextfrom
tolkadot:fix/a11y-addon/arrow-color-update

Conversation

@tolkadot

@tolkadot tolkadot commented Oct 7, 2023

Copy link
Copy Markdown
Contributor

Closes #23455

What I did

Updated CSS for the accordion toggle icon within the accessibility pane.

  • removed the muted, low contrast colour rule, colour is now the same as the text (#2E3438). This colour is cascaded to the icon from the body.
  • removed redundant flex-box rules
  • adjusted the alignment so the icon is centre aligned with the text.

CSS of the icon now looks as follows:

.css-1eq8i2q {
  display: inline-block;
  shape-rendering: inherit;
  fill: currentColor;
  height: 10px;
  width: 10px;
  min-width: 10px;
  margin-right: 10px;
  transition: transform 0.1s ease-in-out;
  vertical-align: inherit;
}

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • [ x ] unit tests
  • integration tests
  • end-to-end tests

Manual testing

To manually test this change, run a sandbox with the a11y add-on enabled.
Using the colour contrast checker[https://webaim.org/resources/contrastchecker/] verify that the arrow icon has sufficient colour contrast.

image

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template react-webpack/18-ts
  2. Within the sandbox yarn add @storybook/addon-a11y --dev
  3. add '@storybook/addon-a11y', to the addons array in storybook/sandbox/react-webpack-18-ts/.storybook/main.ts
  4. yarn storybook
  5. Open Storybook in your browser
  6. Access any story
  7. In the Addons panel check the accessibility addon panel
  8. Verify the accordion toggle icon has sufficient colour contrast

image

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

@tolkadot

tolkadot commented Oct 7, 2023

Copy link
Copy Markdown
Contributor Author

If possible can this be labeled with hacktoberfest & hacktoberfest-accepted tnx.

@ndelangen ndelangen changed the title fix(a11y): remove redundant styling rules, update icon colour, fix al… UI: improve A11Y remove redundant styling rules, update icon color Oct 9, 2023
@ndelangen ndelangen added bug ui accessibility ci:normal Run our default set of CI jobs (choose this for most PRs). labels Oct 9, 2023
@cdedreuille cdedreuille self-requested a review October 9, 2023 12:51
@cdedreuille cdedreuille added ci:daily Run the CI jobs that normally run in the daily job. maintenance User-facing maintenance tasks and removed ci:normal Run our default set of CI jobs (choose this for most PRs). labels Nov 7, 2023

@cdedreuille cdedreuille left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cdedreuille cdedreuille merged commit 7b899e4 into storybookjs:next Nov 7, 2023
@github-actions github-actions Bot mentioned this pull request Nov 7, 2023
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility bug ci:daily Run the CI jobs that normally run in the daily job. maintenance User-facing maintenance tasks ui

Projects

None yet

3 participants