File tree Expand file tree Collapse file tree 2 files changed +79
-0
lines changed
govuk-frontend-review/src/views/examples/typography
govuk-frontend/src/govuk/helpers Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 536
536
537
537
</section >
538
538
539
+ <section class =" govuk-!-margin-top-8" >
540
+ <h2 class =" govuk-heading-l govuk-!-padding-bottom-2" style =" border-bottom : 4px solid ;" >Visually hidden text</h2 >
541
+
542
+ <h3 class =" govuk-heading-m" >Heading with visually hidden text at the beginning</h3 >
543
+
544
+ <h4 class =" govuk-heading-s" ><span class =" govuk-visually-hidden" >Countries starting with </span >A</h4 >
545
+
546
+ <h3 class =" govuk-heading-m" >Heading with visually hidden text at the end</h3 >
547
+
548
+ <h4 class =" govuk-heading-s" >Search <span class =" govuk-visually-hidden" >all content</span ></h4 >
549
+
550
+ <h3 class =" govuk-heading-m" >Heading that is visually hidden</h3 >
551
+
552
+ <h4 class =" govuk-visually-hidden" >Navigation menu</h4 >
553
+
554
+ <hr class =" govuk-section-break govuk-section-break--visible govuk-section-break--xl" >
555
+
556
+ <h3 class =" govuk-heading-m" >Paragraph that contains visually hidden text</h3 >
557
+
558
+ <p class =" govuk-body" >This is a paragraph <span class =" govuk-visually-hidden" >with some visually hidden text</span >.</p >
539
559
560
+ <hr class =" govuk-section-break govuk-section-break--visible govuk-section-break--xl" >
561
+
562
+ <h3 class =" govuk-heading-m" >Table with visually hidden text</h3 >
563
+
564
+ {{ govukTable ({
565
+ caption : " 2019" ,
566
+ captionClasses : " govuk-!-margin-bottom-4" ,
567
+ head : [
568
+ {
569
+ text : " Date" ,
570
+ classes : " govuk-visually-hidden"
571
+ },
572
+ {
573
+ text : " Day" ,
574
+ classes : " govuk-visually-hidden"
575
+ },
576
+ {
577
+ text : " Name" ,
578
+ classes : " govuk-visually-hidden"
579
+ }
580
+ ],
581
+ rows : [
582
+ [
583
+ {
584
+ text : " 19 April"
585
+ },
586
+ {
587
+ text : " Friday"
588
+ },
589
+ {
590
+ text : " Good Friday"
591
+ }
592
+ ],
593
+ [
594
+ {
595
+ text : " 22 April"
596
+ },
597
+ {
598
+ text : " Monday"
599
+ },
600
+ {
601
+ text : " Easter Monday"
602
+ }
603
+ ]
604
+ ]
605
+ }) }}
606
+ </section >
540
607
</div >
541
608
</div >
542
609
{% endblock %}
Original file line number Diff line number Diff line change 16
16
@mixin govuk-visually-hidden ($important : true) {
17
17
position : absolute if ($important , !important , null );
18
18
19
+ // Absolute positioning has the unintended consequence of removing any
20
+ // whitespace surrounding visually hidden text from the accessibility tree.
21
+ // Insert a space character before and after visually hidden text to separate
22
+ // it from any visible text surrounding it.
23
+ & ::before {
24
+ content : " \00a0 " ;
25
+ }
26
+
27
+ & ::after {
28
+ content : " \00a0 " ;
29
+ }
30
+
19
31
width : 1px if ($important , !important , null );
20
32
height : 1px if ($important , !important , null );
21
33
// If margin is set to a negative value it can cause text to be announced in
You can’t perform that action at this time.
0 commit comments