From 2e53a2b6f8123607b6048a9eb44df94d0a5042c0 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 4 Nov 2021 15:09:25 +0000 Subject: [PATCH] Add GOVUK visually hidden style for map key The sentences in the key to the map have 2 forms: 1. the visual form, with an graphic pattern alongside text saying what the pattern means in the map 2. the semantic form, with text describing what the pattern means and how big an area it covers for this alert This is achieved by making the graphic non-semantic and having hidden words in the sentence for each paragraph. While the spaces between words are correct for both forms of these sentences, we observed screen readers speaking some groups of words as one when they spoke the sentence. Most noticably, 'the alert' was spoken as 'thealert'. Swapping the class used to hide the visually hidden words from ours to the GOVUK one seemed to fix this. It's unclear why it does but the `govuk-visually-hidden` class adds the following styles to those in ours: - width: 1px - height: 1px - white-space: nowrap It also has `margin: 0` instead of `margin: -1px`. --- app/templates/views/broadcast/macros/area-map.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/templates/views/broadcast/macros/area-map.html b/app/templates/views/broadcast/macros/area-map.html index 2ac5e82f7..ceef09776 100644 --- a/app/templates/views/broadcast/macros/area-map.html +++ b/app/templates/views/broadcast/macros/area-map.html @@ -5,11 +5,13 @@ - - An area of {{ (broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles + + An area of {{ (broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles  Will get - the + + the + alert

@@ -17,11 +19,11 @@ - - An extra area of {{ (broadcast_message.simple_polygons_with_bleed.estimated_area - broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles is + + An extra area of {{ (broadcast_message.simple_polygons_with_bleed.estimated_area - broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles is  Likely to get - + the alert