WCAG 2.3.2: Three flashes
WCAG (Web Content Accessibility Guidelines) 2.3.2, known as “Three Flashes,” is a Level AAA success criterion focused on preventing content that flashes too rapidly or intensely. Its primary goal is to protect users with photosensitive epilepsy and other seizure disorders from the risks associated with certain types of flashing or strobing content on web pages.
Why This Criterion Matters
Flashing or strobing content can trigger seizures in individuals with photosensitive epilepsy. These seizures can range from mild disorientation to severe convulsions, posing significant health risks. Beyond epilepsy, rapid flashing can cause discomfort, headaches, and migraines in a wider range of users, including those with vestibular disorders or general light sensitivity. Ensuring content adheres to this criterion is crucial for creating a safe and inclusive web environment for everyone.
Affected User Groups:
- Individuals with Photosensitive Epilepsy: The primary beneficiaries, as flashing content is a direct trigger for seizures.
- Individuals with Migraines or Headaches: Rapid light changes can induce or worsen these conditions.
- Individuals with Vestibular Disorders: Flashing can contribute to disorientation or nausea.
- Cognitively Impaired Users: Intense flashing can be distracting and overwhelming, hindering content comprehension.
Understanding Success Criterion 2.3.2
The criterion states: “Web pages do not contain anything that flashes more than three times in any one-second period, or the flash is below the general flash and red flash thresholds.”
This means you have two main ways to comply:
- Limit Flashes: Ensure no content flashes more than three times within any one-second period. This is generally the easiest and safest approach.
- Meet Thresholds: If content *does* flash more than three times per second, it must fall below specific flash thresholds:
- General Flash Threshold: Flashes must not exceed a maximum of a 10-degree visual field (e.g., for a 1024×768 monitor at a typical viewing distance, this is roughly 341 x 256 pixels) and the opposing changes in relative luminance should not cause an increase or decrease of more than 10% (relative luminance).
- Red Flash Threshold: For flashes that include a significant amount of saturated red (e.g., where the red component is 255 and the green and blue components are between 0 and 4 in an 8-bit RGB color space), the threshold is even stricter due to the higher risk associated with red light. The flash must not exceed a maximum of a 10-degree visual field and the opposing changes in relative luminance should not cause an increase or decrease of more than 25%.
The definition of a “flash” involves a pair of opposing changes in relative luminance (light to dark, then dark to light, or vice-versa) that result in a significant contrast change. The thresholds are complex to measure precisely without specialized tools, making the “three flashes or less” rule the most practical compliance strategy.
Practical Guidelines for Compliance
To ensure your web content complies with WCAG 2.3.2, consider the following guidelines:
- Avoid Flashing Content: The simplest and most effective approach is to avoid flashing content entirely, especially for decorative purposes.
- Limit Flash Rate: If flashing is absolutely necessary (e.g., for a critical alert), ensure it occurs no more than three times per second.
- Reduce Luminance Contrast: If flashing cannot be avoided, reduce the contrast between the light and dark states of the flash to stay below the luminance change thresholds.
- Minimize Flashing Area: Keep any necessary flashing content to the smallest possible area, ideally well below the 10-degree visual field limit.
- Avoid Saturated Red: Be extremely cautious with any flashing content that involves saturated red colors, as these have a lower tolerance threshold.
- Provide User Controls: Offer users a way to stop, pause, or disable animated or flashing content, even if it technically meets the criterion. This empowers users to manage their experience.
- Test Thoroughly: Use available tools or manual review to identify and mitigate flashing issues. Specific software can analyze video or animated content for compliance with flash thresholds.
Examples of Correct and Incorrect Implementations
Incorrect Implementation: Rapid Flashing Alert (Exceeds 3 flashes/second)
This example demonstrates an alert box that flashes 5 times per second, which exceeds the allowed threshold and could trigger seizures.
HTML
<div id="flashing-alert">URGENT: Server Down!</div>
CSS
#flashing-alert {
background-color: red;
color: white;
padding: 15px;
text-align: center;
font-weight: bold;
animation: rapidFlash 0.2s infinite alternate;
}
@keyframes rapidFlash {
from { opacity: 1; }
to { opacity: 0; }
}
JavaScript (Not directly used to control flash, but to demonstrate context)
// This alert would appear on page load or a specific event.
// The CSS animation controls the problematic flashing.
Correct Implementation: Subtle, Slow Alert (Within 3 flashes/second)
This alert flashes once every second, clearly staying within the three-flashes-per-second limit. It also uses a less intense color transition.
HTML
<div id="subtle-alert">Notice: Data synchronization in progress.</div>
CSS
#subtle-alert {
background-color: lightblue;
color: navy;
padding: 10px;
text-align: center;
animation: subtleGlow 1s infinite alternate;
}
@keyframes subtleGlow {
from { background-color: lightblue; }
to { background-color: skyblue; }
}
JavaScript
// No specific JavaScript for the flashing animation itself,
// as it's handled by CSS and meets the criteria.
Incorrect Implementation: Large Red Flashing Background
Using a large area of saturated red that flashes, even if at a slower rate, is highly problematic due to the strict red flash threshold and overall area size.
HTML
<body class="red-flash-background">
<h1>Danger Zone!</h1>
<p>This entire page background is flashing.</p>
</body>
CSS
body.red-flash-background {
animation: redFlashBackground 0.8s infinite alternate;
}
@keyframes redFlashBackground {
0% { background-color: #FF0000; } /* Saturated Red */
100% { background-color: #FFCCCC; } /* Lighter Red */
}
Correct Implementation: Alternative for Visual Emphasis
Instead of flashing, use other visual cues like a continuous glow, pulsing without significant luminance changes, or subtle fade effects to draw attention.
HTML
<div id="glowing-element">New Feature Available!</div>
CSS
#glowing-element {
background-color: #FFEB3B;
color: #333;
padding: 12px;
border-radius: 5px;
text-align: center;
box-shadow: 0 0 10px 5px rgba(255, 235, 59, 0.7);
animation: glowEffect 2s infinite alternate;
}
@keyframes glowEffect {
from { box-shadow: 0 0 10px 5px rgba(255, 235, 59, 0.7); }
to { box-shadow: 0 0 20px 10px rgba(255, 235, 59, 0.9); }
}
Best Practices and Common Pitfalls
Best Practices:
- Prioritize Safety: Always err on the side of caution. If in doubt, avoid flashing content.
- User Preferences: Implement media queries like
@media (prefers-reduced-motion)
to respect user preferences for reduced motion, further enhancing accessibility. - Alternatives to Flashing: Use subtle animations, color changes without high contrast, underlines, bolding, or icons to draw attention.
- Accessibility Statements: Include information about how you handle flashing content in your accessibility statement.
- Content Audits: Regularly audit your website for new or existing content that might violate this criterion, especially user-generated content or third-party embeds.
Common Pitfalls:
- Autoplaying Videos/GIFs: Videos, especially those with rapid scene changes or special effects, and animated GIFs can easily exceed flash thresholds. Ensure they are not autoplaying and do not contain problematic content.
- Third-Party Content: Advertisements, embedded social media feeds, or other third-party widgets might contain flashing content outside of your control. Vet these carefully or provide a way for users to disable them.
- Lack of Testing: Assuming content is compliant without proper testing. Flash analysis tools can help identify problematic content.
- Misunderstanding “Flash”: Believing that only very bright, sharp flashes are problematic, when even subtle rapid changes in luminance over a large area can be an issue.
- Over-reliance on “Red Flash Threshold”: While useful for highly saturated red, it’s safer to avoid rapid flashing in any color, especially over large areas.
Adhering to WCAG 2.3.2 is not just about compliance; it’s about protecting the health and well-being of your users. By carefully considering the impact of flashing content and implementing safe alternatives, you contribute to a more accessible and inclusive web for everyone.