惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
博客园 - 聂微东
有赞技术团队
有赞技术团队
The Cloudflare Blog
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
T
The Blog of Author Tim Ferriss
D
Docker
L
LangChain Blog
Vercel News
Vercel News
C
Check Point Blog
博客园 - Franky
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
人人都是产品经理
人人都是产品经理

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Focus indicators failing WCAG 1.4.11: real cases and exac...
a11ySolution · 2026-05-12 · via DEV Community

Focus indicators failing WCAG 1.4.11: real cases and exact fixes
What is a focus indicator?

A focus indicator is the visual signal that shows keyboard users which interactive element is currently focused.

WCAG 2.1 SC 1.4.11 (Non-text Contrast) regulates focus indicators because users navigating with a keyboard must clearly perceive where focus is located.

The minimum required contrast ratio for visible focus indicators is 3:1 against adjacent colors.

Why static accessibility tools often miss these issues

Most static accessibility scanners cannot reliably detect focus indicator failures because the :focus or :focus-visible state only exists during actual keyboard interaction.

To properly validate focus indicators, manual testing with the keyboard is required.

Usually:

Tab
Shift + Tab
Browser DevTools
Contrast analyzers
Real accessibility audit cases

Case 1 — Tourism company
The primary search button had a focus indicator with a contrast ratio below 3:1.

Problem

Keyboard users could technically navigate to the button, but the visible focus state was too subtle to perceive clearly.

WCAG failure
SC 1.4.11 — Non-text Contrast
Fix

Use a high-contrast outline with :focus-visible.

:focus-visible {
outline: 2px solid #FFFFFF;
outline-offset: 2px;
}

Case 2 — Educational platform

The “Login” button changed from #02959F to #027279 when focused.

Problem

Contrast between both visual states was only 1.57:1.

The component relied exclusively on color to communicate focus.

WCAG failures
SC 1.4.11 — Non-text Contrast
SC 1.4.1 — Use of Color
Fix

Add a visible outline independent of color changes.

:focus-visible {
outline: 2px solid #FFFFFF;
outline-offset: 2px;
}

Case 3 — Same platform

The “Remember me” checkbox used a black focus indicator (#212529) over a dark background (#1D191C).

Problem

Contrast ratio:

1.12:1

The focus state became nearly invisible.

Fix

Replace the focus indicator with:

outline: 2px solid #0297A2;
Results
4.92:1 against background
3.79:1 against adjacent colors

WCAG compliant.

How to test focus indicators properly

Recommended setup:

Chrome or Firefox
Keyboard navigation only
Colour Contrast Analyser (CCA)
Optional: NVDA or VoiceOver

Testing steps:

Navigate using only Tab
Verify focus is always visible
Measure contrast of the focus indicator
Validate zoom and dark mode scenarios
Quick production checklist

Before release, ask:

Can focus be identified immediately?
Does the indicator reach at least 3:1 contrast?
Does the state rely only on color changes?
Is focus still visible in dark mode?
Is it visible at 200% zoom?

Focus indicators are one of the most commonly overlooked accessibility failures in production systems, especially because many automated tools cannot fully detect them.

And yet, for keyboard users, they are critical navigation cues.

css #accessibility #wcag #webdev #a11y #focusvisible