alert-circle An exclamation point inside of a circle. alert-triangle An exclamation point inside of a triangle shape. arrow-down-left An arrow pointing down and to the left. arrow-down-right An arrow pointing down and to the right. arrow-down An arrow pointing down. arrow-left An arrow pointing left. arrow-right-thick A thick arrow pointing right arrow-right An arrow pointing right. arrow-up-left An arrow pointing up and to the left. arrow-up-right-thick A thick arrow pointing up and to the right arrow-up-right An arrow pointing up and to the right. arrow-up-thick A thick arrow pointing up arrow-up An arrow pointing up. award A award bell A bell. calendar A calendar icon. camera-off A camera that is deactivated. camera A camera. check-circle A checkmark in a circle. checkmark A checkmark. chevron-down A chevron arrow pointing down. chevron-up A chevron arrow pointing up. chevron A chevron arrow pointing down. chevron A chevron arrow pointing down. chrome Chrome browser logo. close-circle An x in a circle. close A x shape. door A car door. edge Edge browser logo. ellipses An ellipses shape. engine A car engine. envelope A closed envelope. explorer Internet explorer logo. eye-off An eye that is deactivated. eye An eye. facebook Facebook logo. file-text A piece of paper with lines on it. file A blank piece of paper. firefox Firefox browser logo icon-flame A flame. fwd A car drivetrain. gear A gear with multiple teeth. grid A 2x2 grid. heart An empty heart. height-width Arrows indicating height and width measurement. home A home icon. info THe letter i in a circle. instagram Instagram logo. link A chain link. linkedin Linkedin logo. map-marker A map marker pin. maximize Four corners containing a plus sign. menu Three lines signifying a menu. message-circle A speech bubble. minus A minus dash. mpg A car dashboard gauge. opera Opera browser logo. pause A pause symbol. pencil A pencil. phone A phone handset. pinteest-disc Pinterest logo in a disc. pinterest Pinterest logo. play A play button. plus A plus symbol. safari Safari browser logo. search A magnifying glass. seat A car seat. shield A shield sliders A group of control sliders. square A square with rounded corners star A star. tag A shopping tag. thumbs-down A hand with the thumb pointing down. thumbs-up A hand with the thumb pointing up. trash A trash can. trophy A trophy. truck A truck icon. twitter Twitter logo. user-circle An outline of a person in a circle. user An outline of a person. video A video camera. youtube Youtube logo. zoom-in A magnifying glass with a plus in the center
Spark logo Spark Design System
Accessibility

Text resizing

Except for captions and images of text, text can be resized without assistive technology up to 200% without any loss of content or functionality and without overlapping with other content.

Back to the a11y checklist

Why it matters

Some people need to enlarge web content in order to read it and some need to change other aspects of text display (font, space between lines, and more). Most browsers allow users to change text size through text size settings, text-only zoom, and page zoom (which also zooms image, buttons, etc.). When resizing text, any of the following can make the page unusable:

  • Text is not visible without scrolling horizontally
  • Content disappears or is truncated
  • Interactive elements overlap each other

Example of bad text zoom experience

Example of text being cut off by viewport

It is important that relative length units (em, rem, %, vw) are used for text in the code.

WCAG 2.0 reference: 1.4.4 Resize text

Example 1

Some users may choose to resize just their text. Setting a px based font-size on the html element suppresses this ability, but a percentage based value does not. In this example, 100% means “100% of the size the user chose in their browser or OS settings”

html {
  font-size: 100%;
}

Example 2

When changing the font size to Large in Chrome’s advanced settings, the font-size will increase as expected — that is, if no px sizes are used further down in the page’s CSS. To make sure line-height adjusts proportionately, define your CSS line-height using relative units like em or rem or unitless values. If you don’t, when the font size increases, the line height will remain the same, resulting in poor line height and reduced readability.

In this example, the line-height is always equal to 1.5 times the current font-size. So whether the text size may be increased or decreased, the line height will remain appropriate at any text size.

html {
  font-size: 100%;
}
p {
  font-size: 1em;
  line-height: 1.5;
}

Example 3

To make sure text resizing is possible via pinch zoom on touch devices, use the correct viewport meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

How to check for this

  1. Test zoom text only in Chrome and Firefox Manual
  2. Follow the steps described under Resize text checks Manual
  3. Check that all text gets larger, text doesn’t disappear or get cut off, text, images and other content do not overlap, all interactions and controls are visible and usable, horizontal scrolling is not required to read blocks of text. Manual

Resources