-
Notifications
You must be signed in to change notification settings - Fork 13
Framework Adaptation
A significant pain point in modern frontend development is the sheer volume of javascript frameworks. A developer working in Vue often struggles to adapt an accessibility pattern written in React.
If an AI is fed a documentation guide written in React, it has a dangerous tendency to inject React-specific syntax (like className or htmlFor) into an Angular or Svelte repository, breaking the build.
To solve this, A11Y.md includes Rule 7 of the AI Behavioral Contract: Framework Adaptation.
A11Y.md is fundamentally stack-agnostic. While the guide-*.md reference files use React/TSX as their baseline language to explain concepts, the AI is explicitly forbidden from copying that code blindly.
When the AI encounters an accessibility pattern in the reference library, it is forced to act as a semantic translator.
It must extract the core accessibility logic (the ARIA roles, the focus management, the keyboard listeners) and transpose it idiomatically into the active framework of your repository.
The Base Reference (React):
// React: Using state and JSX to render an aria-live region conditionally
<div role="status" aria-live="polite">
{isSaving ? "Saving..." : "Saved!"}
</div>The AI's Transposed Output (Vue):
<!-- Vue: The AI translates to Vue directives while preserving the ARIA attributes -->
<div role="status" aria-live="polite">
<span v-if="isSaving">Saving...</span>
<span v-else>Saved!</span>
</div>The AI's Transposed Output (Angular):
<!-- Angular: The AI translates to Angular control flow while preserving the ARIA attributes -->
<div role="status" aria-live="polite">
@if (isSaving) {
<span>Saving...</span>
} @else {
<span>Saved!</span>
}
</div>By enforcing this rule, A11Y.md ensures that accessibility patterns are universal, while the code implementation remains idiomatic to your project's ecosystem.
Project A11Y.md | The Persistent Context System for Accessibility Created by Felipe A. Carriço | MIT License
♿ Accessibility is not a feature; it's a precondition for use.