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 space not being read in visually hidden text #3017

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions app/assets/stylesheets/finder_frontend.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
$app-colour-true-black: #000000;

.app-visually-hidden {
// The current .govuk-visually-hidden uses absolute positioning. This has the
// unintended consequence of removing any necessary whitespace before and
// after the visually hidden element, and potentially making screen reader
// announcements unintelligble. To fix this, insert a space character before
// and after the visually hidden element.
&:before {
content: "\00a0";
}

&:after {
content: "\00a0";
}
}

.metadata-summary {
@include govuk-font(19);
margin-bottom: govuk-spacing(6);
Expand Down
2 changes: 1 addition & 1 deletion app/views/finders/_show_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="govuk-grid-column-two-thirds">
<% if content_item.all_content_finder? %>
<%= render "govuk_publishing_components/components/heading", {
text: sanitize("Search <span class='govuk-visually-hidden'>all content</span>"),
text: sanitize("Search <span class='govuk-visually-hidden app-visually-hidden'>all content</span>"),
heading_level: 1,
font_size: "xl",
margin_bottom: 4
Expand Down