@diegovelasquezweb/a11y-engine 0.11.52 → 0.11.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegovelasquezweb/a11y-engine",
3
- "version": "0.11.52",
3
+ "version": "0.11.53",
4
4
  "description": "WCAG 2.2 accessibility audit engine — scanner, analyzer, and report builders",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -465,16 +465,32 @@ function detectStylingSystem(aiInput) {
465
465
  return "inline";
466
466
  }
467
467
 
468
+ export function buildStyleInstruction(stylingSystem) {
469
+ if (stylingSystem === "tailwind") {
470
+ return (
471
+ "This project uses Tailwind CSS. Apply style fixes as Tailwind utility classes in the HTML/JSX file — do not write raw CSS. " +
472
+ "For inline style attributes that suppress focus (e.g. style=\"outline: none\"): remove outline: none from the style attribute and add focus-visible: Tailwind utility classes (e.g. focus-visible:outline-2 focus-visible:outline-offset-2) directly on the element instead."
473
+ );
474
+ }
475
+ if (stylingSystem === "css") {
476
+ return (
477
+ "CSS/SCSS files are available in the files array. Prefer fixing visual issues (touch targets, color contrast) in the CSS/SCSS file using proper selectors. " +
478
+ "For violations in a CSS/SCSS file: add or update the rule there directly. " +
479
+ "For violations in an inline HTML style attribute (e.g. style=\"outline: none\"): make TWO changes — " +
480
+ "(1) remove outline: none / outline: 0 from the HTML style attribute, " +
481
+ "(2) add a :focus-visible rule in the CSS/SCSS file targeting the element."
482
+ );
483
+ }
484
+ return (
485
+ "No CSS file was provided. Remove outline: none or outline: 0 from the style attribute entirely and rely on the browser default focus indicator. " +
486
+ "Do not add new CSS files."
487
+ );
488
+ }
489
+
468
490
  async function callClaudeForPatch({ apiKey, model, aiInput, remediationPath }) {
469
491
  const remediationContext = extractRemediationContext(remediationPath);
470
492
  const stylingSystem = detectStylingSystem(aiInput);
471
-
472
- const styleInstruction =
473
- stylingSystem === "tailwind"
474
- ? "This project uses Tailwind CSS. Apply style fixes as Tailwind utility classes in the HTML/JSX file — do not write raw CSS."
475
- : stylingSystem === "css"
476
- ? "CSS/SCSS files are available in the files array. Prefer fixing visual issues (touch targets, color contrast, focus outlines) in the CSS/SCSS file using proper selectors rather than inline styles."
477
- : "No CSS file was provided. Apply style fixes using inline style attributes in the HTML file.";
493
+ const styleInstruction = buildStyleInstruction(stylingSystem);
478
494
 
479
495
  const system = [
480
496
  "You are an accessibility fix engine.",