Skip to content

Make hidden skip link visible on focus (fixes #1088)#1135

Merged
demiankatz merged 4 commits intoUniversalViewer:devfrom
FalveyLibraryTechnology:fix-1088
Oct 22, 2024
Merged

Make hidden skip link visible on focus (fixes #1088)#1135
demiankatz merged 4 commits intoUniversalViewer:devfrom
FalveyLibraryTechnology:fix-1088

Conversation

@demiankatz
Copy link
Copy Markdown
Contributor

This fixes #1088.

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
universalviewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 2:33pm

@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

@demiankatz, I just tested this on the Vercel app. It looks good. Thanks for the fix!

@demiankatz
Copy link
Copy Markdown
Contributor Author

Thanks for the testing, @LanieOkorodudu! I'll merge this once I also get a thumbs-up from somebody on the code itself.

@crhallberg
Copy link
Copy Markdown
Contributor

crhallberg commented Oct 21, 2024

This looks good. A more global way would be to add .sr-only:focus-visible, .sr-only:active styles to the CSS (similar to these styles). It looks like there are opposing styles in the LESS already that we can add these selectors to.

@crhallberg
Copy link
Copy Markdown
Contributor

crhallberg commented Oct 21, 2024

I also found this modern alternative from the A11y Project. I would adapt it as:

.sr-only:not(:focus-visible, :active) {
    /* ... */
}

@demiankatz
Copy link
Copy Markdown
Contributor Author

@crhallberg, I tried revising the .sr-only { definition to .sr-only:not(:focus-visible, :active) { in scaffolding.less instead of my jQuery-based fix. Unfortunately, it doesn't work -- the text remains invisible when focused. Am I misunderstanding your suggestion?

@demiankatz
Copy link
Copy Markdown
Contributor Author

Actually, I tried a slightly different approach, and it did work for me. What do you think, @crhallberg?

@crhallberg
Copy link
Copy Markdown
Contributor

Yes! This CSS fix is good and will apply to any other elements that suffer this same issue!

@demiankatz demiankatz merged commit 9dbbfac into UniversalViewer:dev Oct 22, 2024
@demiankatz demiankatz deleted the fix-1088 branch October 22, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Community Sprint COMPLETED

Development

Successfully merging this pull request may close these issues.

3 participants