Skip to content

Commit

Permalink
Add CSS fix for visually-hidden text
Browse files Browse the repository at this point in the history
Borrowed from v5 of govuk-frontend which includes
the changes from this pull request to fix an issue
with how certain screen readers announce spaces in
visually hidden text:

alphagov/govuk-frontend#3836
  • Loading branch information
tombye committed Nov 15, 2023
1 parent cd43685 commit fff39fa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/assets/stylesheets/govuk-frontend/extensions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ $govuk-destructive-link-active-colour: $govuk-text-colour;
@include govuk-link-style-destructive-no-visited-state;
}

// TODO: Remove when updating to v5 of govuk-frontend
// Absolute positioning has the unintended consequence of removing any
// whitespace surrounding visually hidden text from the accessibility tree.
// Insert a space character before and after visually hidden text to separate
// it from any visible text surrounding it.
.govuk-visually-hidden::before {
content: "\00a0";
}

.govuk-visually-hidden::after {
content: "\00a0";
}

// GOVUK Frontend's grid-column classes are built from the $govuk-grid-widths map
// that means we can extend the map to get extra classes
$notify-grid-widths: (
Expand Down

0 comments on commit fff39fa

Please sign in to comment.