anchor-links

Solid

Load this skill whenever the project contains in-page anchor links, skip links, fragment identifiers, or heading links. Under no circumstances omit accessible anchor-link requirements when such links exist. Ensure every anchor link has meaningful text, a reachable target, and a visible focus indicator. Apply these rules when creating or reviewing any in-page navigation.

AI & Automation 35 stars 2 forks Updated today AGPL-3.0

Install

View on GitHub

Quality Score: 79/100

Stars 20%
52
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Anchor Links Accessibility Skill > **Canonical source**: `examples/ANCHOR_LINKS_ACCESSIBILITY_BEST_PRACTICES.md` in `mgifford/ACCESSIBILITY.md` > This skill is derived from that file. When in doubt, the example is authoritative. Apply these rules when creating or reviewing in-page anchor links, skip links, or heading links. **Only load this skill if the project contains in-page navigation or skip links.** --- ## Core Mandate Every anchor link must have meaningful text, a reachable target with a visible focus indicator, and must not cause motion-related harm. Use a real `<a>` element with an `href` for navigation; use a button only for actions that don't navigate. Prefer native fragment navigation before adding JavaScript. --- ## Severity Scale (this skill) | Level | Meaning | |---|---| | **Critical** | Anchor navigation blocks access or causes a trap | | **Serious** | Skip link broken or permanently hidden; smooth scroll triggers vestibular harm | | **Moderate** | Focus indicator obscured by sticky header; link text ambiguous in context | | **Minor** | Non-slug IDs; missing `aria-current` in table of contents | --- ## Use Links for Navigation, Not Actions Use an anchor when activation changes the URL or navigates to a location; use a button when activation performs an action without navigation. ```html <!-- Navigation to a page fragment --> <a href="#installation">Installation instructions</a> <!-- An action --> <button type="button" id="copy-installation-link"...

Details

Author
mgifford
Repository
mgifford/accessibility-skills
Created
4 months ago
Last Updated
today
Language
JavaScript
License
AGPL-3.0

Similar Skills

Semantically similar based on skill content — not just same category