Skip to content

USWDS - Links: External link labels #5166

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

Merged
merged 16 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add new settings for external link behavior
These labels get combined in mixin to inform users about external links and whether they open in new tabs or not.
  • Loading branch information
James Mejia committed Apr 7, 2023
commit fe1ed871468102150afd38369ac2dea2dd4a45da
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ $icon-object: (
// Screen reader label
&::before {
@include sr-only;
content: $theme-external-link-sr-label;
content: "#{$theme-external-link-sr-label}, #{$theme-external-link-sr-label-window-same}";
}

&[target="_blank"]::before {
@include sr-only;
content: "#{$theme-external-link-sr-label}, #{$theme-external-link-sr-label-window-new}";
}

&::after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ $theme-in-page-nav-top: 4 !default;

// Link
$theme-external-link-sr-label: "External link" !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

No action is required on this, but wondering if we can reduce some audio redundancy by removing the word “link” here so that it is just “External”. In Voiceover, that would mean the readout is “link, external, opens in a new tab [link text]”. I am not sure if other screen readers announce “link” in the same order though, so this might just reflect a VoiceOver bias.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amycole501 did you notice this issue on NVDA/JAWS? If so, I can shorten it to just "External".

$theme-external-link-sr-label-window-new: "opens in a new window" !default;
$theme-external-link-sr-label-window-same: "opens in current window" !default;

// Modal
$theme-modal-border-radius: "lg" !default;
Expand Down