-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2754 from sul-dlss/updateSkipLink
Enable skip links to show above the fold in their entirety
- Loading branch information
Showing
5 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<nav id="skip" class="visually-hidden-focusable" aria-label="<%= t('blacklight.skip_links.label') %>"> | ||
<nav id="skip-link-exhibits" class="visually-hidden-focusable" aria-label="<%= t('blacklight.skip_links.label') %>"> | ||
<div class="container-xl"> | ||
<%= link_to_main %> | ||
<%= link_to_search %> | ||
<%= content %> | ||
</nav> | ||
<%= link_to_content %> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
# Draws the skip links for screen readers | ||
# Overriding the skip link component to use the component library classes | ||
class SkipLinkComponent < Blacklight::SkipLinkComponent | ||
# This is only needed until we are using https://github.com/projectblacklight/blacklight/pull/3461 | ||
def link_classes | ||
'visually-hidden-focusable rounded-bottom py-2 px-3' | ||
'd-inline-flex m-1 py-2 px-3' | ||
end | ||
|
||
# This overrides the <%= content %> line since the styling of that link | ||
# uses the Blacklight styles by default | ||
def link_to_content | ||
link_to t('blacklight.skip_links.first_result'), '#documents', class: link_classes if content.present? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters