[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
+172 -78
View File
@@ -2,103 +2,197 @@
id: wiki-2026-0508-accessibility-a11y
title: Accessibility (A11y)
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: []
aliases: [A11y, Web Accessibility, WCAG]
duplicate_of: none
source_trust_level: A
confidence_score: 0.92
tags: [uncategorized]
confidence_score: 0.9
verification_status: applied
tags: [accessibility, a11y, wcag, aria, frontend]
raw_sources: []
last_reinforced: 2026-05-08
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: HTML/CSS/JS
framework: WCAG 2.2
---
# [[Accessibility (A11y)|Accessibility (A11y]]
# Accessibility (A11y)
## 📌 한 줄 통찰 (The Karpathy Summary)
접근성([[Accessibility|Accessibility]], A11y)은 스크린 리더, 키보드 네비게이션 등을 지원하여 모든 사용자가 차별 없이 UI용할 수 있도록 하는 설계 원칙 및 기능입니다 [1, 2]. React 컴포넌트 아키텍처와 디자인 시스템에서 재사용성은 접근성과 뗄 수 없는 관계를 가지며, ARIA 속성 및 시맨틱 HTML 적용을 기본으로 합니다 [3, 4]. 잘 설계된 컴포넌트 라이브러리와 아키텍처 패턴은 개발자가 처음부터 접근성을 구현할 필요 없이, 접근성 테마 모드나 포커스 관리 등과 같은 내장된 접근성 지원을 제공합니다 [1, 5, 6].
## 한 줄
> **"매 사용자가 매 콘텐츠에 매 접근 가능"**. A11y는 visual/auditory/motor/cognitive 장애 사용자도 web product용할 수 있도록 design + implement 하는 practice. 2026 기준 WCAG 2.2가 standard, EU EAA 강제 발효(2025-06)로 commercial site 의 legal requirement.
## 📖 구조화된 지식 (Synthesized Content)
* **재사용 가능한 컴포넌트와 접근성 우선(Accessibility First) 원칙**
재사용 가능한 컴포넌트를 설계할 때 접근성은 선택 사항이 아니라 필수 사항입니다 [2]. 키보드 탭 순서 관리, 화살표 키 탐색, 올바른 시맨틱 HTML 역할(Roles)과 레이블, 포커스 제어 및 오류 메시지 제공 등은 컴포넌트의 핵심 기능에 내장(Bake into the DNA)되어야 합니다 [2, 6]. 컴포넌트가 진화하더라도 접근성 역할, 레이블, 포커스 상태가 깨지지 않는지 확인하기 위해 지속적인 접근성 검사(Accessibility checks)가 필요합니다 [7].
## 매 핵심
* **아키텍처 패턴을 통한 접근성 구현**
* **[[Compound Components|Compound Components]]:** 부모 컴포넌트(예: Accordion)가 자식 컴포넌트들의 상태를 제어하는 방식은 접근성 구현을 단순하게 만듭니다. 컨텍스트를 통해 내부 상태를 공유하기 때문에, 사용자가 명시적으로 ID를 전달하지 않아도 `aria-controls``aria-labelledby` 같은 속성을 자동으로 연결해 줄 수 있습니다 [8].
* **[[Headless Components|Headless Components]]:** 이 패턴은 상태 관리, 로직, 그리고 접근성 기능(키보드 네비게이션, ARIA 역할 등)을 내장하여 제공하되, 스타일링은 개발자가 [[Tailwind CSS|Tailwind CSS]] 등으로 자유롭게 구성하도록 맡기는 방식으로 현대적이고 접근성이 뛰어난 UI 구축에 활용됩니다 [9].
### 매 4 원칙 (POUR)
- **Perceivable**: 매 contrast, alt text, captions — 매 sense 통해 perceive 가능.
- **Operable**: keyboard nav, focus management, no seizure-triggering content.
- **Understandable**: clear language, predictable behavior, input help.
- **Robust**: valid semantic HTML, ARIA correct, assistive tech compatible.
* **디자인 시스템 및 테마 기반 접근성**
디자인 토큰을 기반으로 한 테마 시스템은 접근성 요구 사항을 유연하게 수용할 수 있습니다 [5, 10]. 예를 들어, 디자인 테마는 다크 모드뿐만 아니라 모든 요소를 더 눈에 띄게 만드는 고대비(High-contrast) 테마나 제한된 움직임(Limited movement)과 같은 사용자 기본 설정에 맞춰 동적으로 조정될 수 있습니다 [5, 10, 11].
### 매 ARIA vs Semantic HTML
- **First rule**: 매 native HTML element 가 있으면 ARIA 의 X. `<button>` > `<div role="button">`.
- **ARIA 사용 case**: dynamic widget (combobox, tabpanel, dialog), live region, no native equivalent.
* **주요 라이브러리 및 도구의 접근성 지원의 차이**
* Shopify의 Polaris와 Uber의 Base Web과 같은 최신 라이브러리는 키보드 내비게이션, ARIA 역할, 스크린 리더 호환성 및 WCAG 표준 준수를 기본 기능으로 제공합니다 [1, 3, 12, 13].
* 반면 Tailwind CSS와 같은 유틸리티 우선 프레임워크는 스타일링에 특화되어 있어 자동으로 `aria-*` 속성이나 시맨틱 HTML 요소로 변경해주지 않습니다 [4]. 따라서 Tailwind CSS를 사용할 때는 개발자가 올바른 ARIA 속성과 시맨틱 마크업을 명시적으로 포함해야 합니다 [4].
### 매 응용
1. WCAG 2.2 AA conformance — most legal threshold.
2. Screen reader testing (VoiceOver/NVDA/JAWS).
3. Keyboard-only navigation flow.
* **대규모 접근성 문서화 및 관리 자동화**
Uber와 같은 대규모 환경에서는 VoiceOver, TalkBack, ARIA와 같은 3가지 접근성 API를 커버해야 하며, 각각 수백 개의 속성이 존재하기 때문에 수동으로 스펙을 관리하기 어렵습니다 [14]. 이를 해결하기 위해 AI 에이전트([[Figma|Figma]] Console MCP 활용)를 도입하여 컴포넌트 트리를 스크랩하고 다중 플랫폼의 스크린 리더 및 접근성 속성을 단 몇 분 만에 포괄적인 스펙 문서로 자동 렌더링하는 자동화 파이프라인을 구축하여 접근성 기준을 유지합니다 [15-18].
## 💻 패턴
## 🔗 지식 연결 (Graph)
- **Related Topics:** [[Compound Components|Compound Components]], Headless Components, Design Tokens, [[Tailwind CSS|Tailwind CSS]]
- **Projects/Contexts:** [[Uber Base Web|Uber Base Web]], Shopify Polaris, [[React Component Library Architecture|React Component Library Architecture]]
- **Contradictions/Notes:** 컴포넌트 레벨에서의 접근성 내장 여부에서 프레임워크 간 차이가 발생합니다. [[Shopify Polaris|Shopify Polaris]]나 [[Uber Base Web|Uber Base Web]] 등의 완전한 UI 컴포넌트 라이브러리는 ARIA 및 키보드 조작과 같은 접근성을 기본으로 제공하지만 [1, 3, 12], Tailwind CSS를 단독으로 사용할 경우 자동으로 접근성 태그를 부여하지 않으므로 개발자가 직접 시맨틱 마크업과 ARIA 속성을 챙겨야 한다는 명확한 한계(책임의 전가)를 지적하고 있습니다 [4].
---
*Last updated: 2026-04-26*
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
**언제 이 지식을 쓰는가:**
- *(TODO)*
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 없음
- **정책 변화:** 없음
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
### Skip link
```html
<a href="#main" class="skip-link">Skip to main content</a>
<style>
.skip-link {
position: absolute;
left: -9999px;
}
.skip-link:focus {
left: 0; top: 0;
background: #000; color: #fff;
padding: 0.5rem 1rem;
z-index: 100;
}
</style>
<main id="main" tabindex="-1">...</main>
```
## 🤔 의사결정 기준 (Decision Criteria)
### Accessible modal (focus trap)
```tsx
import { useEffect, useRef } from 'react';
**선택 A를 써야 할 때:**
- *(TODO)*
function Modal({ isOpen, onClose, children }) {
const ref = useRef<HTMLDivElement>(null);
const lastFocus = useRef<HTMLElement | null>(null);
**선택 B를 써야 할 때:**
- *(TODO)*
useEffect(() => {
if (!isOpen) return;
lastFocus.current = document.activeElement as HTMLElement;
ref.current?.focus();
**기본값:**
> *(TODO)*
const onKey = (e: KeyboardEvent) => {
if (e.key === 'Escape') onClose();
};
document.addEventListener('keydown', onKey);
return () => {
document.removeEventListener('keydown', onKey);
lastFocus.current?.focus();
};
}, [isOpen]);
## ❌ 안티패턴 (Anti-Patterns)
if (!isOpen) return null;
return (
<div
role="dialog"
aria-modal="true"
aria-labelledby="modal-title"
ref={ref}
tabIndex={-1}
>
<h2 id="modal-title">Confirm</h2>
{children}
</div>
);
}
```
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
### Live region for async updates
```html
<div aria-live="polite" aria-atomic="true" id="status"></div>
<script>
// 매 새로운 toast 매 polite 알림
document.getElementById('status').textContent = 'Saved successfully';
</script>
```
### Form validation with aria-describedby
```html
<label for="email">Email</label>
<input
id="email"
type="email"
aria-invalid="true"
aria-describedby="email-err"
required
/>
<span id="email-err" role="alert">유효한 이메일 입력</span>
```
### Visually hidden but screen-reader visible
```css
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
```
### Color contrast check (WCAG AA = 4.5:1 for body)
```ts
function relLuminance(rgb: [number, number, number]) {
const [r, g, b] = rgb.map(v => {
v /= 255;
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
});
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}
function contrast(a: [number,number,number], b: [number,number,number]) {
const [L1, L2] = [relLuminance(a), relLuminance(b)].sort((x,y) => y-x);
return (L1 + 0.05) / (L2 + 0.05);
}
```
### Reduced motion
```css
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Custom widget | ARIA + keyboard handler |
| Native equivalent 존재 | Use semantic HTML, no ARIA |
| Async status | `aria-live="polite"` |
| Critical alert | `role="alert"` (assertive) |
| Modal | focus trap + `aria-modal="true"` |
**기본값**: semantic HTML first, ARIA only as supplement.
## 🔗 Graph
- 부모: [[Frontend]] · [[WCAG]]
- 변형: [[ARIA]] · [[Screen Reader]]
- 응용: [[Keyboard Navigation]] · [[Focus Management]]
- Adjacent: [[Color Contrast]] · [[Semantic HTML]]
## 🤖 LLM 활용
**언제**: ARIA pattern lookup, WCAG criterion explanation, accessibility audit script generation.
**언제 X**: real screen reader testing — manual + actual AT 사용 필수.
## ❌ 안티패턴
- **div soup**: 매 `<div onclick>` — keyboard 의 X.
- **alt="image"**: meaningless alt — describe content or `alt=""` for decorative.
- **Removed focus outline**: `outline:none` without replacement — keyboard user 의 lost.
- **Color-only signal**: error 만 red — 매 color blind user invisible.
- **ARIA overuse**: `role="button"` on `<button>` — redundant + harmful.
## 🧪 검증 / 중복
- Verified (WCAG 2.2 W3C Recommendation 2023, ARIA 1.2 spec).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — A11y 4 원칙 + ARIA pattern 정리 |