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 transcript" button spacing (fixes #312) #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swashbuck
Copy link
Contributor

Fix #312

Fix

  1. Ensure "Skip to transcript" button does not take up space until in focus
  2. Add bottom margin to button when visible

Testing

  1. Using keyboard navigation, tab until you come to a "Skip to transcript" button.

@swashbuck swashbuck self-assigned this Jan 20, 2025
@swashbuck swashbuck added the bug label Jan 20, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Contributor

@kirsty-hames kirsty-hames left a comment

Choose a reason for hiding this comment

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

Works as expected thanks @swashbuck. Please see query regarding the use of .visually-hidden.


html:not(.has-accessibility) & {
.u-display-none;
}

&:not(:focus-visible) {
display: block;
Copy link
Contributor

Choose a reason for hiding this comment

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

There's an open Core PR that relates to this. Going by the issue discussion the intention is to update 'Skip to...' buttons to use the .visually-hidden mixin. I can't see any issues have been raised to update the other plugins as of yet but do we want to include in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @kirsty-hames . Since that PR is still open, I think it would be better to update it separately so as to not hold up this fix? That PR would just change .u-display-none to .visually-hidden, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

The PR as is works as expected so happy to proceed 👍

When the Core #606 PR is merged this can be revisited. We'd still need .u-display-none but would replace the :focus-visible styles with .visually-hidden-focusable.

  // Skip to transcript button
  &__skip-to-transcript {
    margin-bottom: @item-margin;
    
    html:not(.has-accessibility) & {
      .u-display-none;
    }

    .visually-hidden-focusable;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Reviewing
Development

Successfully merging this pull request may close these issues.

"Skip to transcript" button takes up space when hidden, lacks bottom margin
3 participants