Skill 详情

html-accessibility

Direct HTML accessibility and WCAG guidance applicable to static HTML/CSS sites.

匹配类型直接匹配已针对 html 审核
来源hack23/riksdagsmonitor外部来源
报告安装量17仅表示受欢迎程度

使用前先检查

自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。

已保存的来源预览

SKILL.md

这段内容是审核时保存的快照。外部来源才是完整且最新的版本。

---
name: html-accessibility
description: Web accessibility (WCAG 2.1 AA) best practices for static HTML/CSS websites
license: Apache-2.0
---

# HTML Accessibility Skill


## 🔴 AI FIRST Quality Principle

> **Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.**

## Purpose

Ensure websites meet WCAG 2.1 Level AA accessibility standards for inclusive user experience.

## Core Principles (POUR)

### Perceivable
- Text alternatives for images
- Captions for audio/video
- Sufficient color contrast
- Text resizable without loss

### Operable
- Keyboard accessible
- Enough time to interact
- No seizure-inducing content
- Easy navigation

### Understandable
- Readable text
- Predictable behavior
- Input assistance
- Error prevention

### Robust
- Compatible with assistive tech
- Valid HTML
- Proper ARIA usage

## Best Practices

### Semantic HTML
```html
<!-- ✅ Good: Semantic -->
<header>
  <nav aria-label="Main navigation">
    <ul>
      <li><a href="/">Home</a></li>
    </ul>
  </nav>
</header>

<!-- ❌ Bad: Non-semantic -->
<div class="header">
  <div class="nav">...</div>
</div>
```

### Alt Text
```html
<!-- ✅ Good: Descriptive alt -->
<img src="chart.png" alt="Bar chart showing 60% increase in usage">

<!-- ❌ Bad: Missing or useless alt -->
<img src="chart.png" alt="chart">
```

### Color Contrast
```css
/* ✅ Good: WCAG AA compliant */
.text {
  color: #333;  /* Contrast ratio: 12.6:1 */
  background: #fff;
}

/* ❌ Bad: Insufficient contrast */
.text {
  color: #777;  /* Contrast ratio: 4.4:1 - fails for small text */
  background: #fff;
}
```

### Keyboard Navigation
```css
/* ✅ Good: Visible focus */
a:focus, button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* ❌ Bad: Removed focus */
*:focus {
  outline: none;  /* NEVER DO THIS */
}
```

## Testing

- Keyboard-only navigation
- Screen reader testing
- Color contrast checking
- HTML validation
- Automated tools (axe, WAVE)

## References

- [WCAG 2.1](https://www.w3.org/WAI/WCAG21/quickref/)
- [MDN Accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility)
在 GitHub 阅读完整来源 (打开外部页面)
相关上下文

相关工作