Skip to content

Framework Adaptation

fecarrico edited this page Jul 20, 2026 · 2 revisions

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.

The AI as a Semantic Translator

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.

Example Translation: Conditional Rendering

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.

Note: Framework Adaptation covers web frameworks. On native platforms (iOS, Android, React Native, Flutter), Rule 8 of the Contract — Platform Awareness — takes over: web references become semantic intent to translate via guide-platform-native.md, never implementation to copy (no ARIA attributes or CSS pixels outside the web).

Clone this wiki locally