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

fix: skip to canvas link style #21021

Merged
merged 3 commits into from Feb 20, 2023
Merged

fix: skip to canvas link style #21021

merged 3 commits into from Feb 20, 2023

Conversation

yamanoku
Copy link
Contributor

@yamanoku yamanoku commented Feb 9, 2023

ref #15740

What I did

#15740 (comment)

SkipLink to canvas in the sidebar may show the button if the logo is vertical. This is the state of the screenshot you quoted.

There is a way to turn it off with display: none, but it makes it impossible for screen reader users to take advantage of it, so I modified the original style.

<style>
/* hide annoying "skip to canvas" button which is rendered over the logo (brand) image  */
.sidebar-header > a {
    display: none;
}
</style>

Screenshots

Changed to display with opacity.

2023-02-02.10.39.31.mov

How to test

Tests created with #15740 should work without problems.

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

Comment on lines +49 to +57
border: 0,
width: 1,
height: 1,
padding: 0,
margin: -1,
overflow: 'hidden',
clip: 'rect(0, 0, 0, 0)',
whiteSpace: 'nowrap',
wordWrap: 'normal',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This style is Visually Hidden. It is an element while still allowing it to be exposed to assistive technologies (such as screen readers).

ref: https://getbootstrap.com/docs/5.0/helpers/visually-hidden/

@yamanoku yamanoku marked this pull request as ready for review February 9, 2023 01:35
@yannbf yannbf self-assigned this Feb 13, 2023
@ndelangen ndelangen merged commit 932fc56 into storybookjs:next Feb 20, 2023
@yamanoku yamanoku deleted the fix-sidebar-skip-to-canvas-link-style branch February 21, 2023 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants