๐ป ์์คํ ์ค์น ๋ฐ ์คํ ์๊ตฌ์ฌ์ (System Requirements)
์ต์ W3C WCAG 2.2 (๊ณต์ ๊ถ๊ณ ์, Level AA) ๋ฐ KWCAG 2.2 (ํ๊ตญํ ์น ์ฝํ
์ธ ์ ๊ทผ์ฑ ์ง์นจ 2.2) ๊ธฐ์ค์ผ๋ก, Deque axe-core v4.14.0ยทPlaywrightยทESLint a11yยทLighthouse ๊ธฐ๋ฐ ์๋ ์ ๊ทผ์ฑ ๊ฒ์ฌ๋ฅผ ๋ก์ปฌ๊ณผ CI์์ ์คํํ๊ธฐ ์ํ ์๊ตฌ์ฌ์์
๋๋ค.
| ๊ตฌ๋ถ | ์ต์ ์ฌ์ (Minimum) | ๊ถ์ฅ ์ฌ์ (Recommended) |
|---|---|---|
| ์ด์์ฒด์ (OS) | Windows 10/11, macOS 13+, Ubuntu 22.04+ | Windows 11 (NVDA ํ ์คํธ) / macOS 14+ (VoiceOver ๋ด์ฅ) |
| CPU | 2 vCPU (x86_64 ๋๋ ARM64) | 4+ vCPU (ํค๋๋ฆฌ์ค ๋ธ๋ผ์ฐ์ ๋ณ๋ ฌ E2E ๊ฒ์ฌ ์) |
| ๋ฉ๋ชจ๋ฆฌ (RAM) | 4 GB | 8 GB ~ 16 GB (Chromium + Playwright + Lighthouse ๊ตฌ๋) |
| ๋์คํฌ (Storage) | 1.5 GB ์ฌ์ ๊ณต๊ฐ | 5 GB+ SSD (Playwright ๋ธ๋ผ์ฐ์ ๋ฐ์ด๋๋ฆฌ ํฌํจ) |
| ๋ฐํ์ / ๋ณด์กฐ๊ธฐ๊ธฐ | Node.js 20+ LTS, Chrome/Edge ์ต์ ๋ฒ์ | Node.js 22 LTS, Chromium (Playwright), NVDA / VoiceOver |
์๋ ๊ฒ์ฌ ๋ฐ ๋ฆฐํธ ๋๊ตฌ ์ค์น (axe-core v4.14.0)
# 1. E2E ์๋ ์ ๊ทผ์ฑ ๊ฒ์ฌ (axe-core v4.14.0 + Playwright)
npm install -D axe-core @axe-core/playwright @playwright/test
npx playwright install chromium
# 2. ์ ์ ์ฝ๋ ๋ฆฐํธ (React / JSX ํ๋ก์ ํธ)
npm install -D eslint-plugin-jsx-a11y
# 3. CLI URL ์ค์บ ๋ฐ Lighthouse ์ ๊ทผ์ฑ ๊ฐ์ฌ
npm install -g @axe-core/cli lighthouse
๐ง ์น ์ ๊ทผ์ฑ ๋ฉํ ๋ชจ๋ธ (POUR & ์ ๊ทผ์ฑ ํธ๋ฆฌ)
๋ธ๋ผ์ฐ์ ๋ DOM์ ํ์ฑํด ์ ๊ทผ์ฑ ํธ๋ฆฌ(Accessibility Tree) ๋ฅผ ์์ฑํ๋ฉฐ, ์คํฌ๋ฆฐ ๋ฆฌ๋(NVDA, VoiceOver, ์ผ์ค๋ฆฌ๋)์ ์์ฑ ์ ์ด ๋๊ตฌ๋ ์ด ํธ๋ฆฌ์ Role(์ญํ ) ยท Name(์ด๋ฆ) ยท State/Property(์ํ) ๋ฅผ ์ฝ์ด ์ฌ์ฉ์์๊ฒ ์ ๋ฌํฉ๋๋ค.
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ์๋งจํฑ HTML โ โโถ โ Accessibility Tree โ โโถ โ ๋ณด์กฐ๊ณตํ (์คํฌ๋ฆฐ ๋ฆฌ๋ / ํค๋ณด๋)โ
โ + WAI-ARIA โ โ (Role, Name, State/Value) โ โ (NVDA, VoiceOver, Tab ๋ด๋น) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[WCAG 2.2 / KWCAG 2.2 4๋ ์์น (POUR)]
1. Perceivable (์ธ์์ ์ฉ์ด์ฑ) : ๋์ฒด ํ
์คํธ(alt), ์๋ง, ์์ ๋ฌด๊ดํ ์ธ์, ๋ช
๋ ๋๋น(4.5:1)
2. Operable (์ด์ฉ์ ์ฉ์ด์ฑ) : ํค๋ณด๋ ์ ์ฉ ์กฐ์, ์ด์ ์ด๋/ํ์, ์ถฉ๋ถํ ์๊ฐ, ๋ฐ๋ณต ์์ญ ๊ฑด๋๋ฐ๊ธฐ
3. Understandable(์ดํด์ ์ฉ์ด์ฑ) : ๊ธฐ๋ณธ ์ธ์ด(lang), ์์ธก ๊ฐ๋ฅํ ์คํ, ๋ ์ด๋ธยท์ค๋ฅ ์ ์ ์๋ด
4. Robust (๊ฒฌ๊ณ ์ฑ) : ๋งํฌ์
๋ฌธ๋ฒ ์ค์, ์ ํจํ ARIA ์์ฑ, ์น ์ ํ๋ฆฌ์ผ์ด์
์ ๊ทผ์ฑ
๐ก Chrome DevTools ํ์ธ ํ: ๊ฐ๋ฐ์ ๋๊ตฌ(
F12) โ Elements ํจ๋ โ ์ฐ์ธก Accessibility ํญ์ ์ด๋ฉด ํ์ฌ ์ ํํ DOM ์์๊ฐ ์คํฌ๋ฆฐ ๋ฆฌ๋์ ์ด๋คRole๊ณผName์ผ๋ก ๋ ธ์ถ๋๋์ง ์ฆ์ ํ์ธํ ์ ์์ต๋๋ค.
๐ฐ๐ท KWCAG 2.2 ํต์ฌ ๊ฒ์ฌํญ๋ชฉ ์์ฝ (๊ตญ๋ด WA ์ธ์ฆ ์ค๋ฌด ๊ธฐ์ค)
๊ตญ๋ด ๊ณต๊ณตยท๊ธ์ตยท๋๊ธฐ์ ์น ์ ๊ทผ์ฑ ํ์ง์ธ์ฆ(WA) ์ฌ์ฌ์์ ์ง์ค์ ์ผ๋ก ํ์ธํ๋ ํต์ฌ ํญ๋ชฉ๊ณผ ๊ตฌํ ํฌ์ธํธ์ ๋๋ค.
| ์์น | ๊ฒ์ฌํญ๋ชฉ | ์ค๋ฌด ๊ตฌํ ํต์ฌ ๊ธฐ์ค |
|---|---|---|
| ์ธ์ | ์ ์ ํ ๋์ฒด ํ ์คํธ | ์๋ฏธ ์๋ ์ด๋ฏธ์งยท์์ด์ฝ์ ํต์ฌ ๋ด์ฉ alt ์ ๊ณต, ์ฅ์์ฉ์ alt="" |
| ์ธ์ | ์๋งยท์๊ณ ์ ๊ณต | ์์/์์ฑ ์ฝํ ์ธ ์ ๋๊ธฐํ๋ ์๋ง, ๋๋ณธ(Transcript) ๋๋ ์์ด ์ ๊ณต |
| ์ธ์ | ์์ ๋ฌด๊ดํ ์ฝํ ์ธ ์ธ์ | ์ฐจํธยท์ค๋ฅ ์ํ๋ฅผ ์์๋ง์ผ๋ก ๊ตฌ๋ถํ์ง ์๊ณ ํจํดยท์์ด์ฝยทํ ์คํธ ๋ณ๊ธฐ |
| ์ธ์ | ๋ช ๋ ๋๋น | ํ ์คํธ์ ๋ฐฐ๊ฒฝ ๋๋น 4.5:1 ์ด์ (ํฐ ํ ์คํธ 18pt/14pt bold๋ 3:1) |
| ์ด์ฉ | ํค๋ณด๋ ์ฌ์ฉ ๋ณด์ฅ | ๋ง์ฐ์ค๋ก ๊ฐ๋ฅํ ๋ชจ๋ ๊ธฐ๋ฅ(ํธ๋ฒ ๋ฉ๋ด, ๋๋๊ทธ ๋ฑ)์ ํค๋ณด๋๋ง์ผ๋ก ์กฐ์ |
| ์ด์ฉ | ์ด์ ์ด๋๊ณผ ํ์ | ๋
ผ๋ฆฌ์ Tab ์์ ์ ์ง ๋ฐ :focus-visible ๋ฑ ์๊ฐ์ ์ด์ ๋ง ๋ช
ํํ ํ์ |
| ์ด์ฉ | ์กฐ์ ๊ฐ๋ฅ & ๊ฑด๋๋ฐ๊ธฐ | ์ปจํธ๋กค ํฌ๊ธฐ/์ฌ๋ฐฑ ํ๋ณด, ์ต์๋จ์ <a href="#main">๋ณธ๋ฌธ ๋ฐ๋ก๊ฐ๊ธฐ</a> ์ ๊ณต |
| ์ด์ฉ | ์ ์ง ๊ธฐ๋ฅ & ์๊ฐ ์กฐ์ | ์๋ ์ฌ๋ผ์ด๋/์บ๋ฌ์
์ ์ผ์์ ์ง/์ด์ /๋ค์ ๋ฒํผ, ์ธ์
์ฐ์ฅ ๊ธฐ๋ฅ ์ ๊ณต |
| ์ดํด | ๊ธฐ๋ณธ ์ธ์ด & ์ ๋ชฉ | <html lang="ko">, ํ์ด์ง๋ณ ๊ณ ์ <title>, ํ๋ ์ <iframe>์ title ์ ๊ณต |
| ์ดํด | ํ์ ๊ตฌ์ฑ & ๋ ์ด๋ธ | <caption>, `<th scope=โcol |
| ์ดํด | ์ค๋ฅ ์ ์ | ์
๋ ฅ ์ค๋ฅ ์ ์์ธ ์๋ด + ์ค๋ฅ ์
๋ ฅ ํ๋๋ก ์ด์ ์ด๋(aria-invalid="true") |
| ๊ฒฌ๊ณ | ๋งํฌ์ & ARIA ์ค์ | ์ค๋ณต id ๊ธ์ง, ํ์ค ์ค์ฒฉ ๊ท์น ์ค์, ์ปค์คํ
์์ ฏ์ ์ฌ๋ฐ๋ฅธ WAI-ARIA ์ ์ฉ |
๐ WCAG 2.2 ์ ๊ท ์ฑ๊ณต ๊ธฐ์ค (์ค๋ฌด ํ์ 6์ข )
WCAG 2.1์์ 2.2๋ก ์ฌ๋ผ์ค๋ฉด์ ๋ชจ๋ฐ์ผยท์ ์๋ ฅยท์ธ์ง ์ ๊ทผ์ฑ์ ์ํด ์ถ๊ฐ๋ ํต์ฌ ๊ธฐ์ค์ ๋๋ค.
| ์ฑ๊ณต ๊ธฐ์ค (Level) | ํต์ฌ ์๊ตฌ์ฌํญ | ์ฝ๋ / CSS ํด๊ฒฐ ํจํด |
|---|---|---|
| 2.4.11 Focus Not Obscured (AA) | ๊ณ ์ ํค๋ยท์คํฐํค ๋ฐฐ๋ยทํ๋กํ ๋ฒํผ์ด ํค๋ณด๋ ํฌ์ปค์ค๋ ์์๋ฅผ ์์ ํ ๊ฐ๋ฆฌ๋ฉด ์ ๋จ | html { scroll-padding-top: 84px; } ๋ฐ ๋ชจ๋ฌ ์คํ ์ ๋ฐฐ๊ฒฝ ํฌ์ปค์ค ์ฐจ๋จ |
| 2.5.7 Dragging Movements (AA) | ๋๋๊ทธ ์ค ๋๋กญ๋ง ๊ฐ์ ๊ธ์ง (์์ ๋ณ๊ฒฝ, ์ฌ๋ผ์ด๋, ์ง๋ ์ด๋ ๋ฑ) | ๋๋๊ทธ ์ธ์ ์๋ก/์๋๋ก ์ด๋ ๋ฒํผ ๋๋ input[type="range"] ํค๋ณด๋/ํด๋ฆญ ๋์ ์ ๊ณต |
| 2.5.8 Target Size Minimum (AA) | ํฌ์ธํฐ(ํด๋ฆญ/ํฐ์น) ํ๊ฒ ์ต์ 24 ร 24 CSS px (๋๋ ์ธ์ ํ๊ฒ๊ณผ 24px ์์ด ๊ฒน์น์ง ์๋ ์ถฉ๋ถํ ๊ฐ๊ฒฉ) | min-width: 24px; min-height: 24px; (๋ชจ๋ฐ์ผ ๊ถ์ฅ 44 ร 44px) |
| 3.2.6 Consistent Help (A) | ๋์๋งยท๊ณ ๊ฐ์ผํฐยท์ฑ๋ด ๋งํฌ๊ฐ ์ฌ๋ฌ ํ์ด์ง์ ๊ฑธ์ณ ๋์ผํ ์๋ ์์น์ ๋ฐฐ์น | ๊ณตํต <header> ๋๋ <footer> ์์ญ์ ์ผ๊ด๋๊ฒ ๋ฐฐ์น |
| 3.3.7 Redundant Entry (A) | ๊ฐ์ ํ๋ก์ธ์ค(์: ๊ฒฐ์ ยท์ ์ฒญ)์์ ์ด์ ์ ์ ๋ ฅํ ์ ๋ณด ์ฌ์ ๋ ฅ ์๊ตฌ ๊ธ์ง | ์๋ ์ฑ์ฐ๊ธฐ ์ต์ (โ์ฃผ๋ฌธ์์ ๋์ผโ) ๋๋ ์ด์ ๋จ๊ณ ๊ฐ ๊ธฐ๋ณธ ํ์ |
| 3.3.8 Accessible Auth (AA) | ์ธ์ง ํ ์คํธ(ํผ์ฆ, ๊ธ์ ์ ๋ ฅ CAPTCHA, ๋น๋ฐ๋ฒํธ ์๊ธฐ) ๋จ๋ ๊ฐ์ ๊ธ์ง | ๋น๋ฐ๋ฒํธ ๋ถ์ฌ๋ฃ๊ธฐ ํ์ฉ(onpaste ์ฐจ๋จ ๊ธ์ง), autocomplete="current-password", ํจ์คํค/์ด๋ฉ์ผ ๋งํฌ ์ง์ |
๐ ๋จ๊ณ๋ณ ์ค์ ๊ตฌํ ๊ฐ์ด๋ (Step-by-Step)
[1๋จ๊ณ] ์๋งจํฑ HTML, Skip Link & .sr-only (์คํฌ๋ฆฐ ๋ฆฌ๋ ์ ์ฉ ํ
์คํธ)
display: none ๋๋ visibility: hidden์ ์คํฌ๋ฆฐ ๋ฆฌ๋์์๋ ์์ ํ ๋ฌด์๋ฉ๋๋ค. ํ๋ฉด์๋ ๋ณด์ด์ง ์์ง๋ง ์คํฌ๋ฆฐ ๋ฆฌ๋์๋ ์ฝํ์ผ ํ๋ ํ
์คํธ(์: ์์ด์ฝ ๋ฒํผ ์ค๋ช
, ์จ๊ฒจ์ง ํ ์ ๋ชฉ)๋ ๋ฐ๋์ .sr-only ํด๋์ค๋ฅผ ์ฌ์ฉํ์ธ์.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<title>๊ณ์ ์ค์ - LuckyTechWorld</title>
<style>
/* ์คํฌ๋ฆฐ ๋ฆฌ๋ ์ ์ฉ ์จ๊น ํจํด (Visual Hide, Screen Reader Accessible) */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* ๋ณธ๋ฌธ ๋ฐ๋ก๊ฐ๊ธฐ ๋งํฌ: ํ์ ์จ๊น -> Tab ํฌ์ปค์ค ์ ์ข์ธก ์๋จ ๋
ธ์ถ */
.skip-link {
position: fixed;
top: -100px;
left: 12px;
background: #0f172a;
color: #ffffff;
padding: 10px 16px;
border-radius: 6px;
font-weight: 700;
z-index: 9999;
text-decoration: none;
}
.skip-link:focus {
top: 12px;
outline: 3px solid #10b981;
}
/* ๊ณ ์ ํค๋๊ฐ ํฌ์ปค์ค ์์๋ฅผ ๊ฐ๋ฆฌ์ง ์๋๋ก ์ฌ๋ฐฑ ํ๋ณด (WCAG 2.2 - 2.4.11) */
html {
scroll-padding-top: 80px;
}
/* ํค๋ณด๋ ํ์ ์ ์ ๋ช
ํ ํฌ์ปค์ค ๋ง ์ ์ง */
:focus-visible {
outline: 3px solid #10b981;
outline-offset: 2px;
}
</style>
</head>
<body>
<a href="#main-content" class="skip-link">๋ณธ๋ฌธ ๋ฐ๋ก๊ฐ๊ธฐ</a>
<header>
<nav aria-label="์ฃผ ๋ฉ๋ด">
<a href="/" aria-current="page">ํ</a>
<a href="/cheatsheets">์นํธ์ํธ</a>
</nav>
</header>
<main id="main-content" tabindex="-1">
<h1>๊ณ์ ์ค์ </h1>
<!-- ์์ด์ฝ ์ ์ฉ ๋ฒํผ: aria-label ๋๋ .sr-only๋ก ์ ๊ทผ ๊ฐ๋ฅํ ์ด๋ฆ ์ ๊ณต -->
<button type="button" aria-label="์๋ฆผ ์ค์ ๋์๋ง ์ด๊ธฐ">
<span aria-hidden="true">โ</span>
</button>
</main>
</body>
</html>
[2๋จ๊ณ] ํผ(Form) ์ค๋ฅ ๊ฒ์ฆ, ํ(Table) & ๋ชจ๋ฌ ๋ค์ด์ผ๋ก๊ทธ
1. ์ ๊ทผ์ฑ ํผ(Form) & ์ค์๊ฐ ์ค๋ฅ ์๋ฆผ
<form id="signup-form" novalidate>
<div>
<label for="email-input">
์ด๋ฉ์ผ <span aria-hidden="true">*</span>
<span class="sr-only">(ํ์ ์
๋ ฅ)</span>
</label>
<input
id="email-input"
name="email"
type="email"
autocomplete="email"
aria-required="true"
aria-invalid="false"
aria-describedby="email-hint email-err"
/>
<p id="email-hint">์ฌ๋ด ๋๋ ๊ฐ์ธ ์ด๋ฉ์ผ ์ฃผ์๋ฅผ ์
๋ ฅํ์ธ์.</p>
<!-- ์ค๋ฅ ๋ฐ์ ์ textContent๋ฅผ ์ฑ์ฐ๊ณ hidden ํด์ ํ๋ฉด ์คํฌ๋ฆฐ ๋ฆฌ๋๊ฐ ์ฆ์ ๋ญ๋
-->
<p id="email-err" role="alert" hidden></p>
</div>
<button type="submit">์ ์ฅํ๊ธฐ</button>
</form>
<script>
const form = document.getElementById('signup-form');
const emailInput = document.getElementById('email-input');
const emailErr = document.getElementById('email-err');
form.addEventListener('submit', (e) => {
e.preventDefault();
const valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailInput.value.trim());
if (!valid) {
emailInput.setAttribute('aria-invalid', 'true');
emailErr.textContent = 'โ ๏ธ ์ฌ๋ฐ๋ฅธ ์ด๋ฉ์ผ ํ์(์: user@example.com)์ ์
๋ ฅํด ์ฃผ์ธ์.';
emailErr.hidden = false;
emailInput.focus(); // ์ค๋ฅ ์์ ํ๋๋ก ์ฆ์ ์ด์ ์ด๋
return;
}
emailInput.setAttribute('aria-invalid', 'false');
emailErr.hidden = true;
});
</script>
2. ์ ๊ทผ์ฑ ๋ฐ์ดํฐ ํ(Table) โ <caption>, scope, headers/id
<table>
<caption>2026๋
3๋ถ๊ธฐ ์๋น์ค๋ณ ์๊ฐ ๊ฐ์ฉ์ฑ ๋ฐ ์๋ต์๊ฐ ์์ฝ</caption>
<thead>
<tr>
<th scope="col">์๋น์ค๋ช
</th>
<th scope="col">๊ฐ์ฉ์ฑ (SLA)</th>
<th scope="col">p99 ์ง์ฐ์๊ฐ</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">์ธ์ฆ API</th>
<td>99.98%</td>
<td>42 ms</td>
</tr>
</tbody>
</table>
๐ก ๋ณต์กํ ๋ค์ค ํค๋(๋ณํฉ ์
colspan/rowspan) ํ:scope๋ง์ผ๋ก ๋ถ์กฑํ ๋๋ ๊ฐ<th>์ ๊ณ ์id๋ฅผ ๋ถ์ฌํ๊ณ , ๋ฐ์ดํฐ ์ <td headers="group-id col-id row-id">๋ก ์ฐ๊ฒฐํด์ผ ์คํฌ๋ฆฐ ๋ฆฌ๋๊ฐ ํยท์ด ์ ๋ชฉ์ ์ ํํ ์ฝ์ด์ค๋๋ค.
3. ๋ค์ดํฐ๋ธ <dialog> ๋ชจ๋ฌ (ESC ๋ซ๊ธฐ ยท Top Layer ยท ํฌ์ปค์ค ๋ณต๊ท)
<button type="button" id="open-dlg">์ฝ๊ด ์์ธ ๋ณด๊ธฐ</button>
<dialog id="terms-dlg" aria-labelledby="dlg-title" aria-describedby="dlg-desc">
<h2 id="dlg-title">์๋น์ค ์ด์ฉ์ฝ๊ด</h2>
<p id="dlg-desc">๊ฐ์ธ์ ๋ณด ์ฒ๋ฆฌ ๋ฐ ๋ณด์ ์ ์ฑ
์ ๋ํ ์๋ด์
๋๋ค.</p>
<button type="button" id="close-dlg">ํ์ธ ๋ฐ ๋ซ๊ธฐ</button>
</dialog>
<script>
const openDlg = document.getElementById('open-dlg');
const closeDlg = document.getElementById('close-dlg');
const dlg = document.getElementById('terms-dlg');
openDlg.addEventListener('click', () => dlg.showModal());
closeDlg.addEventListener('click', () => dlg.close());
// ๋ซ๊ธฐ ๋ฒํผ ๋๋ ESC ํค๋ก ๋ซํ ๋ ์๋ ๋ฒํผ์ผ๋ก ํฌ์ปค์ค ๋ณต๊ท
dlg.addEventListener('close', () => openDlg.focus());
</script>
[3๋จ๊ณ] WAI-ARIA ํญ(Tabs) ์์ ฏ ์์ ๊ตฌํ (Roving Tabindex)
ํญ ๋ชฉ๋ก์์๋ Tab ํค๋ก ํญ ๋ชฉ๋ก ์ ์ฒด๋ฅผ ํ ๋ฒ์ ๋น ์ ธ๋๊ฐ๊ณ , ํญ ๊ฐ ์ด๋์ ์ข/์ฐ ๋ฐฉํฅํค(ArrowLeft / ArrowRight) ์ Home / End ํค๋ก ์กฐ์ํ๋ ๊ฒ์ด WAI-ARIA Authoring Practices(APG) ํ์ค์
๋๋ค.
<div class="tabs-widget">
<div role="tablist" aria-label="๋ฌธ์ ๋ณด๊ธฐ ๋ฐฉ์">
<button role="tab" id="tab-1" aria-selected="true" aria-controls="panel-1" tabindex="0">๊ฐ์</button>
<button role="tab" id="tab-2" aria-selected="false" aria-controls="panel-2" tabindex="-1">API ๋ช
์ธ</button>
<button role="tab" id="tab-3" aria-selected="false" aria-controls="panel-3" tabindex="-1">๋ณ๊ฒฝ ์ด๋ ฅ</button>
</div>
<div role="tabpanel" id="panel-1" aria-labelledby="tab-1" tabindex="0">๊ฐ์ ๋ณธ๋ฌธ์
๋๋ค.</div>
<div role="tabpanel" id="panel-2" aria-labelledby="tab-2" tabindex="0" hidden>API ๋ช
์ธ ๋ณธ๋ฌธ์
๋๋ค.</div>
<div role="tabpanel" id="panel-3" aria-labelledby="tab-3" tabindex="0" hidden>๋ณ๊ฒฝ ์ด๋ ฅ ๋ณธ๋ฌธ์
๋๋ค.</div>
</div>
<script>
const tabs = Array.from(document.querySelectorAll('[role="tab"]'));
const panels = Array.from(document.querySelectorAll('[role="tabpanel"]'));
function activateTab(targetTab) {
tabs.forEach((tab, idx) => {
const selected = tab === targetTab;
tab.setAttribute('aria-selected', String(selected));
tab.setAttribute('tabindex', selected ? '0' : '-1');
panels[idx].hidden = !selected;
});
targetTab.focus();
}
tabs.forEach((tab, idx) => {
tab.addEventListener('click', () => activateTab(tab));
tab.addEventListener('keydown', (e) => {
let nextIdx = null;
if (e.key === 'ArrowRight') nextIdx = (idx + 1) % tabs.length;
else if (e.key === 'ArrowLeft') nextIdx = (idx - 1 + tabs.length) % tabs.length;
else if (e.key === 'Home') nextIdx = 0;
else if (e.key === 'End') nextIdx = tabs.length - 1;
if (nextIdx !== null) {
e.preventDefault();
activateTab(tabs[nextIdx]);
}
});
});
</script>
[4๋จ๊ณ] axe-core v4.14.0 + Playwright & CI/CD ์๋ ๊ฒ์ฌ
1. Playwright E2E ์ ๊ทผ์ฑ ํ
์คํธ (tests/a11y.spec.ts)
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
const TARGET_PAGES = ['/', '/cheatsheets', '/templates'];
for (const path of TARGET_PAGES) {
test(`${path} ํ์ด์ง WCAG 2.2 AA ์ ๊ทผ์ฑ ๊ฒ์ฌ`, async ({ page }) => {
await page.goto(`http://localhost:4321${path}`);
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa'])
// ์๋ํํฐ ์์ ฏ ๋ฑ ๋ถ๊ฐํผํ ์ธ๋ถ ์์ญ๋ง ์ต์ ๋จ์๋ก ์ ์ธ ๊ฐ๋ฅ
// .exclude('#third-party-ad')
.analyze();
// ์๋ฐ ์ฌํญ์ด 0๊ฑด์ด์ด์ผ ํ
์คํธ ํต๊ณผ
expect(results.violations).toEqual([]);
});
}
2. CLI & GitHub Actions ์๋ ๊ฒ์ดํธ
# ๋ก์ปฌ/์คํ
์ด์ง URL ์ฆ์ ์ค์บ
npx @axe-core/cli http://localhost:4321 --tags wcag2a,wcag2aa,wcag22aa
# Lighthouse ์ ๊ทผ์ฑ ์ ์ 95์ ๋ฏธ๋ง ์คํจ ๊ฒ์ฆ์ฉ JSON ์ถ์ถ
npx lighthouse http://localhost:4321 --only-categories=accessibility --output=json --output-path=./a11y.json
# .github/workflows/a11y.yml
name: Accessibility Check (axe-core)
on: [pull_request]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm run build
- run: npx playwright test tests/a11y.spec.ts
โ๏ธ React / ํ๋ก ํธ์๋ ํํ ์ํฐํจํด vs ์ฌ๋ฐ๋ฅธ ๊ตฌํ
| ํํ ์ค์ (โ Bad) | ์ฌ๋ฐ๋ฅธ ๊ตฌํ (โ Good) | ์ด์ |
|---|---|---|
<div onClick={submit}>์ ์ถ</div> | <button type="button" onClick={submit}>์ ์ถ</button> | div๋ Tab ์ด์ , Enter/Space ์คํ, ๋ฒํผ Role์ด ์์ |
<a onClick={openModal}>์ด๊ธฐ</a> (href ์์) | <button type="button" onClick={openModal}>์ด๊ธฐ</button> | ํ์ด์ง ์ด๋์ <a>, ์ํ ๋ณ๊ฒฝ/๋ชจ๋ฌ/์ ์ถ ๋์์ <button> |
<input placeholder="์ด๋ฆ" /> (label ์๋ต) | <label htmlFor="name">์ด๋ฆ</label><input id="name" /> | ์ ๋ ฅ ์์ ์ placeholder๋ ์ฌ๋ผ์ง๋ฉฐ ์คํฌ๋ฆฐ ๋ฆฌ๋ ํธํ์ฑ ์ ํ |
<span style={{ color: 'red' }}>*</span> | <span aria-hidden="true">*</span><span className="sr-only">ํ์</span> | ๋ณํ ๊ธฐํธ ๋์ ๋ช ํํ ์๋ฏธ(โํ์โ) ์ ๋ฌ |
๋ชจ๋ฌ ์ด๋ฆด ๋ ๋ฐฐ๊ฒฝ ์์ ์ฌ์ ํ Tab ๊ฐ๋ฅ | ๋ค์ดํฐ๋ธ <dialog>.showModal() ๋๋ ๋ฐฐ๊ฒฝ์ inert ์์ฑ ๋ถ์ฌ | ๋ชจ๋ฌ ๋ฐ์ผ๋ก ํค๋ณด๋ ์ด์ ์ด ํ์ถํ๋ ํ์ ์์ฒ ์ฐจ๋จ |
๐ง ์คํฌ๋ฆฐ ๋ฆฌ๋ ์๋ ํ ์คํธ ๋จ์ถํค ์นํธ์ํธ
์๋ ๋๊ตฌ(axe-core, Lighthouse)๋ ์ ์ฒด ์ ๊ทผ์ฑ ์ด์์ ์ฝ 30~40% ๋ง ์ก์๋
๋๋ค. ๋๋จธ์ง ๋งฅ๋ฝยทํค๋ณด๋ ํ๋ฆยท์์ฑ ์๋ด ํ์ง์ ๋ฐ๋์ ์ค์ ์คํฌ๋ฆฐ ๋ฆฌ๋๋ก ํ์ธํด์ผ ํฉ๋๋ค.
| ๋์ | Windows NVDA (๋ฌด๋ฃ) | macOS VoiceOver (๋ด์ฅ) |
|---|---|---|
| ์คํ / ์ข ๋ฃ | Ctrl + Alt + N / Insert + Q | Cmd + F5 (ํ ๊ธ) |
| ๋ค์ / ์ด์ ์์ ํ์ | โ / โ (๋๋ Tab / Shift + Tab) | VO + โ / VO + โ (VO = Ctrl + Option) |
| ์ ๋ชฉ(Heading) ๊ฑด๋๋ฐ๊ธฐ | H (116) | VO + Cmd + H |
| ๋๋๋งํฌ / ๋งํฌ ๋ชฉ๋ก | Insert + F7 (์์ ๋ชฉ๋ก ์ฐฝ) | VO + U (๋กํฐ ๋ฉ๋ด) |
| ํ์ฌ ๋ญ๋ ์ผ์์ ์ง | Ctrl | Ctrl |
โ ํ๋ก๋์ ์ต์ข ์ฒดํฌ๋ฆฌ์คํธ & ํธ๋ฌ๋ธ์ํ
๋ฐฐํฌ ์ ํ์ ์ ๊ฒ ์ฒดํฌ๋ฆฌ์คํธ
- HTML ์ธ์ด & ์ ๋ชฉ:
<html lang="ko">์ ์ธ ๋ฐ ํ์ด์ง/๋ผ์ฐํธ ์ด๋ ์<title>๋์ ๊ฐฑ์ - ํค๋ณด๋ ์จ๋ฆฌ ์์ฃผ: ๋ง์ฐ์ค ์์ด
Tab,Shift+Tab,Enter,Space,Esc, ํ์ดํ ํค๋ง์ผ๋ก ์ ์ฒด ํต์ฌ ํ๋ก์ฐ ์๋ฃ - 200% ํ๋ ๋ฐ ๋ฐ์ํ: ๋ธ๋ผ์ฐ์
200%ํ๋ ์ ๊ฐ๋ก ์คํฌ๋กคยทํ ์คํธ ์๋ฆผยท๋ฒํผ ๊ฒน์นจ ์์ - ๋ชจ์
๋ฏผ๊ฐ์ฑ ๋ฐฐ๋ ค:
@media (prefers-reduced-motion: reduce)์์ ์๋ ์ ๋๋ฉ์ด์ /์ ํ ํจ๊ณผ ์ต์ํ - SPA ๋ผ์ฐํ
์๋ฆผ: ํด๋ผ์ด์ธํธ ๋ผ์ฐํ
์ ํ ์
<main tabindex="-1">๋ก ํฌ์ปค์ค ์ด๋ ๋๋aria-live="polite"์๋ด
์์ฃผ ๊ฒช๋ ํธ๋ฌ๋ธ์ํ
aria-hidden="true"๋ด๋ถ์ ํฌ์ปค์ค ๊ฐ๋ฅํ ๋ฒํผ์ด ์์ ๋: ๋ธ๋ผ์ฐ์ ์ฝ์์Blocked aria-hidden on an element because its descendant retained focus๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํฉ๋๋ค. ์จ๊ธธ ์์ญ์๋aria-hidden="true"๋์ HTML ํ์คinert์์ฑ(element.inert = true)์ ์ฌ์ฉํ๋ฉด ์๊ฐ ์จ๊น ์์ด๋ ํฌ์ปค์คยทํด๋ฆญยท์คํฌ๋ฆฐ ๋ฆฌ๋ ์ ๊ทผ์ ํ ๋ฒ์ ์์ ํ๊ฒ ์ฐจ๋จํ ์ ์์ต๋๋ค.- ์ด๋ชจ์ง(Emoji)๊ฐ ์คํฌ๋ฆฐ ๋ฆฌ๋์์ ๊ณผ๋ํ๊ฒ ์ฝํ ๋: ๋ฒํผ์ด๋ ์ ๋ชฉ ์ ์ฅ์์ฉ ์ด๋ชจ์ง(
๐,๐)๋ ๋ฐ๋์<span aria-hidden="true">๐</span>์ผ๋ก ๊ฐ์ธ์ผ โํด๋ฆฝ๋ณด๋ ๋ณต์ฌโ ๋์ โํด๋ฆฝ๋ณด๋ ์ด๋ชจ์ง ํด๋ฆฝ๋ณด๋ ๋ณต์ฌโ์ฒ๋ผ ์ค๋ณต ๋ญ๋ ๋๋ ๋ฌธ์ ๋ฅผ ๋ง์ ์ ์์ต๋๋ค.
์๊ฒฌ ๋ฐ ์ง๋ฌธ
0์์ง ๋ฑ๋ก๋ ์๊ฒฌ์ด ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ ๋๊ธ์ ๋จ๊ฒจ๋ณด์ธ์!
๋๊ธ ์์
๋๊ธ ์ญ์