Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)33k · #8720

accessibility

Skill này làm gì

Skill này cung cấp cho AI của bạn các quy tắc khả năng tiếp cận dựa trên WCAG 2.1 và các phát hiện kiểm toán phổ biến. Nó dành cho lập trình viên và nhà thiết kế muốn website có thể dùng được bởi người khuyết tật.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu kiểm toán khả năng tiếp cận hoặc kiểm tra tuân thủ WCAG.
  • ✓Khi bạn muốn hỗ trợ trình đọc màn hình hoặc điều hướng bàn phím tốt hơn trên trang web.
  • ✓Khi bạn cần sửa thiếu alt text, nhãn hoặc các vấn đề về độ tương phản màu.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/accessibility/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/accessibility/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra trang đích của tôi về các vấn đề khả năng tiếp cận và cho tôi biết cách sửa.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent xem lại code của bạn theo hướng dẫn cho bốn nhóm: nội dung có thể cảm nhận, có thể vận hành, dễ hiểu và bền vững. Sau đó nó chỉ ra vấn đề và đề xuất cách sửa kèm ví dụ.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Accessibility (a11y)

Comprehensive accessibility guidelines based on WCAG 2.1 and Lighthouse accessibility audits. Goal: make content usable by everyone, including people with disabilities.

WCAG Principles: POUR

Principle Description
Perceivable Content can be perceived through different senses
Operable Interface can be operated by all users
Understandable Content and interface are understandable
Robust Content works with assistive technologies

Conformance levels

Level Requirement Target
A Minimum accessibility Must pass
AA Standard compliance Should pass (legal requirement in many jurisdictions)
AAA Enhanced accessibility Nice to have

Perceivable

Text alternatives (1.1)

Images require alt text:

<!-- ❌ Missing alt -->
<img src="chart.png">

<!-- ✅ Descriptive alt -->
<img src="chart.png" alt="Bar chart showing 40% increase in Q3 sales">

<!-- ✅ Decorative image (empty alt) -->
<img src="decorative-border.png" alt="" role="presentation">

<!-- ✅ Complex image with longer description -->
<figure>
  <img src="infographic.png" alt="2024 market trends infographic" 
       aria-describedby="infographic-desc">
  <figcaption id="infographic-desc">
    <!-- Detailed description -->
  </figcaption>
</figure>

Icon buttons need accessible names:

<!-- ❌ No accessible name -->
<button><svg><!-- menu icon --></svg></button>

<!-- ✅ Using aria-label -->
<button aria-label="Open menu">
  <svg aria-hidden="true"><!-- menu icon --></svg>
</button>

<!-- ✅ Using visually hidden text -->
<button>
  <svg aria-hidden="true"><!-- menu icon --></svg>
  <span class="visually-hidden">Open menu</span>
</button>

Visually hidden class:

.visually-hidden {
  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 (1.4.3, 1.4.6)

Text Size AA minimum AAA enhanced
Normal text (< 18px / < 14px bold) 4.5:1 7:1
Large text (≥ 18px / ≥ 14px bold) 3:1 4.5:1
UI components & graphics 3:1 3:1
/* ❌ Low contrast (2.5:1) */
.low-contrast {
  color: #999;
  background: #fff;
}

/* ✅ Sufficient contrast (7:1) */
.high-contrast {
  color: #333;
  background: #fff;
}

/* ✅ Focus states need contrast too */
:focus-visible {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
}

Don't rely on color alone:

<!-- ❌ Only color indicates error -->
<input class="error-border">
<style>.error-border { border-color: red; }</style>

<!-- ✅ Color + icon + text -->
<div class="field-error">
  <input aria-invalid="true" aria-describedby="email-error">
  <span id="email-error" class="error-message">
    <svg aria-hidden="true"><!-- error icon --></svg>
    Please enter a valid email address
  </span>
</div>

Media alternatives (1.2)

<!-- Video with captions -->
<video controls>
  <source src="video.mp4" type="video/mp4">
  <track kind="captions" src="captions.vtt" srclang="en" label="English" default>
  <track kind="descriptions" src="descriptions.vtt" srclang="en" label="Descriptions">
</video>

<!-- Audio with transcript -->
<audio controls>
  <source src="podcast.mp3" type="audio/mp3">
</audio>
<details>
  <summary>Transcript</summary>
  <p>Full transcript text...</p>
</details>

Operable

Keyboard accessible (2.1)

All functionality must be keyboard accessible:

// ❌ Only handles click
element.addEventListener('click', handleAction);

// ✅ Handles both click and keyboard
element.addEventListener('click', handleAction);
element.addEventListener('keydown', (e) => {
  if (e.key === 'Enter' || e.key === ' ') {
    e.preventDefault();
    handleAction();
  }
});

No keyboard traps:

// Modal focus management
function openModal(modal) {
  const focusableElements = modal.querySelectorAll(
    'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
  );
  const firstElement = focusableElements[0];
  const lastElement = focusableElements[focusableElements.length - 1];
  
  // Trap focus within modal
  modal.addEventListener('keydown', (e) => {
    if (e.key === 'Tab') {
      if (e.shiftKey && document.activeElement === firstElement) {
        e.prevent
Câu hỏi thường gặp

WCAG là gì?

WCAG là bộ hướng dẫn khả năng tiếp cận web, và skill này dùng phiên bản 2.1.

Các mức A, AA và AAA nghĩa là gì?

Đó là các mức tuân thủ: A là mức tối thiểu, AA là mức nhiều luật yêu cầu, còn AAA là mục tiêu nâng cao.

Nó có thể thay thế việc kiểm thử với người dùng thật không?

Không. Skill tập trung vào hướng dẫn và mẫu code, nên không thay thế được việc kiểm thử với những người dùng công cụ hỗ trợ.

Chi tiết

Mô tả gốc của tác giả

Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8720
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự