К основному содержанию
скилл CX Codex

pixijs-accessibility — скилл для Claude Code: что делает

Скилл настраивает поддержку скринридеров и навигацию с клавиатуры в PixiJS v8 через оверлей shadow DOM.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add pixijs/pixijs-skills --skill pixijs-accessibility -a claude-code
Открыть на GitHub

Что делает pixijs-accessibility

Скилл учит агента связывать визуальные элементы сцены PixiJS v8 с невидимым деревом shadow DOM. Он показывает, как передавать разметку для экранных дикторов через свойства accessibleTitle и accessibleHint. Порядок фокуса регулируется через tabIndex. При этом кастомный порядок клавиши Tab применяется только при активном eventMode со значением static или dynamic, иначе PixiJS принудительно сбрасывает значение в ноль.

Внутри описаны параметры конфигурации AccessibilitySystem. Система умеет перехватывать нажатие клавиши Tab и создавать хук касания для мобильных браузеров. Отладку часто ломает флаг deactivateOnMouseMove, который по умолчанию гасит оверлей при любом смещении курсора. Движок доступности жёстко привязан к главному потоку браузера и полностью неработоспособен внутри Web Worker — это повод заранее проверить архитектуру проекта.

Какие задачи решает

  • настроить навигацию клавишей Tab по контейнерам сцены PixiJS
  • сгенерировать невидимый оверлей shadow DOM для экранных дикторов
  • активировать доступность сразу при старте без ожидания клавиши Tab
  • задать контейнерам понятные подписи accessibleTitle и ARIA-подсказки

Примеры запросов агенту

  • Настрой доступность для кнопки интерфейса в PixiJS v8 и добавь ей accessibleTitle
  • Как запустить AccessibilitySystem сразу при вызове app.init в PixiJS?
  • Отключи деактивацию доступности PixiJS при движении мыши для тестов

Как установить pixijs-accessibility

1Через Skills CLI (Vercel)

npx skills add pixijs/pixijs-skills --skill pixijs-accessibility -a claude-code

2Вручную: положить файлы

~/.claude/skills/pixijs-accessibility/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/pixijs-accessibility/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора25

pixijs-scene-dom-container Подсказывает агенту, как накладывать HTML-элементы на canvas PixiJS v8 через DOMContainer и DOMPipe. Пригодится, когда нужны поля ввода, iframe или видео поверх сцены. CX Codex +1 5 700установок pixijs-blend-modes Скилл подсказывает агенту, как смешивать объекты PixiJS v8 через blendMode: стандартные режимы, продвинутые и порядок для батчинга. CX Codex +1 5 700установок pixijs-color Скилл по классу Color в PixiJS v8. Помогает переводить форматы цвета, настраивать tint и альфу, а также оптимизировать вызовы в циклах рендера через Color.shared и буферы. CX Codex +1 5 700установок pixijs-create Скилл ведёт агента через создание нового проекта PixiJS v8 или подключение библиотеки к уже существующему: шаблоны, пакетные менеджеры, настройка TypeScript. CX Codex +1 5 700установок pixijs-custom-rendering Помогает писать кастомные шейдеры, юниформы, фильтры и батчеры в PixiJS v8 — на GLSL и WGSL, под WebGL и WebGPU. CX Codex +1 5 700установок pixijs-scene-gif Обучает агента загружать и воспроизводить анимации GIF в PixiJS v8 через GifSprite и GifSource. Пригодится при переносе гифок на сцену без ручной нарезки на спрайты. CX Codex +1 5 600установок pixijs-migration-v8 Скилл проводит код PixiJS с v7 на v8 и ищет типичные поломки после обновления. Нужен при замене устаревших API и импортов. CX Codex +1 5 300установок pixijs-html-source Учит агента превращать живой DOM-элемент или его снимок в текстуру PixiJS v8 через экспериментальный HTML-in-Canvas. CX Codex +1 4 500установок

Похожие

pixijs-2d freshtechbro Скилл обучает агента создавать 2D-графику на PixiJS с WebGL и WebGPU: анимировать спрайты, выводить частицы и рисовать векторные фигуры на холсте. CX Codex +1 2 500установок frontend-accessibility-best-practices sergiodxa Скилл с 7 правилами доступности для React: семантическая вёрстка, скринридеры, клавиатура, настройки пользователя. Пригодится при сборке форм и интерактивных элементов. CX Codex +1 863установок accessibility web-quality-skills Скилл проводит аудит доступности веб-страницы и подсказывает, что исправить в исходниках. Пригодится, когда сайт нужно довести до WCAG 2.2 или проверить работу с клавиатурой и скринридером. CX Codex +1 64 100установок accessibility-test-plan Owl-Listener Помогает спланировать тестирование доступности интерфейса с ассистивными технологиями и реальными пользователями. Пригодится перед релизом для покрытия критериев WCAG. CX Codex +1 2 100установок accessibility-audit AccessLint Скилл проводит глубокую проверку доступности сайта по стандарту WCAG 2.2 и методологии WCAG-EM. Он собирает выборку страниц, запускает тесты и формирует итоговый отчёт о соответствии. CX Codex +1 1 100установок accessibility-testing kindlmann Скилл для проверки доступности: гоняет axe-core через Playwright, аудит клавиатуры и экранных дикторов, разбор ARIA. CX Codex +1 1 100установок

Рядом в теме «Фронтенд и UI»

Всё по теме «Фронтенд и UI» →

Вопросы о pixijs-accessibility

Как установить pixijs-accessibility в Claude Code?

Выполните команду npx skills add pixijs/pixijs-skills --skill pixijs-accessibility -a claude-code. Файл навыка появится по пути ~/.claude/skills/pixijs-accessibility/SKILL.md.

Что делает скилл pixijs-accessibility?

Он помогает агенту настраивать фокус с клавиатуры и вывод для скринридеров в PixiJS v8. Скилл показывает генерацию элементов shadow DOM и передачу событий ввода на экранные объекты.

Работает ли AccessibilitySystem внутри Web Worker?

Нет, этой подсистеме необходим прямой доступ к DOM в главном потоке браузера. Запустить её внутри фонового Web Worker нельзя.

Исходный текст

SKILL.md · MIT
---
name: pixijs-accessibility
description: "Use this skill when adding screen reader and keyboard navigation to PixiJS v8 apps. Covers AccessibilitySystem options (enabledByDefault, debug, activateOnTab, deactivateOnMouseMove), per-container accessibility properties, shadow DOM overlay, mobile touch-hook activation. Triggers on: accessibility, a11y, screen reader, ARIA, keyboard navigation, tab order, AccessibilitySystem, accessibleTitle, accessibleHint, tabIndex, accessibleChildren."
license: MIT
---

Enable screen reader and keyboard navigation via PixiJS's AccessibilitySystem. The system creates an invisible shadow DOM overlay positioned over accessible containers so assistive technology can discover and activate them.

## Quick Start

```ts
const button = new Sprite(await Assets.load("button.png"));
button.accessible = true;
button.accessibleTitle = "Play game";
button.accessibleHint = "Starts a new game session";
button.eventMode = "static";
button.tabIndex = 0;
app.stage.addChild(button);

app.renderer.accessibility.setAccessibilityEnabled(true);

button.on("pointertap", () => startGame());
```

**Related skills:** `pixijs-events` (pointer/tap handlers), `pixijs-scene-dom-container` (HTML elements on canvas), `pixijs-application` (init options).

**Key points:**

- By default the system activates only after the user presses Tab. Set `enabledByDefault: true` in Application init for immediate activation.
- On mobile, the system creates a hidden touch hook; screen-reader focus activates accessibility for the whole session.
- The AccessibilitySystem requires the main thread; it is not available in a Web Worker.

## Core Patterns

### Container accessible properties

```ts
import { Container, Sprite } from "pixi.js";

const container = new Container();
container.accessible = true;
container.accessibleTitle = "Navigation menu";
container.accessibleHint = "Contains links to other pages";
container.eventMode = "static"; // required for custom tabIndex to apply
container.tabIndex = 0;
container.accessibleType = "div"; // defaults to 'button'

const sprite = new Sprite();
sprite.accessible = true;
sprite.accessibleTitle = "Close dialog";
sprite.accessibleText = "X"; // text content of the shadow div
sprite.eventMode = "static";
sprite.tabIndex = 1;
```

Available properties on any Container:

- `accessible` (boolean) - enables the accessible overlay div
- `accessibleTitle` (string) - sets the `title` attribute on the shadow div
- `accessibleHint` (string) - sets the `aria-label` attribute
- `accessibleText` (string) - sets inner text content of the shadow div
- `accessibleType` (string) - HTML tag for the shadow element, defaults to `'button'`
- `tabIndex` (number) - tab order for keyboard navigation (only applied when `interactive` is true / `eventMode` is `'static'` or `'dynamic'`)
- `accessibleChildren` (boolean, default `true`) - when `false`, prevents child containers from being accessible
- `accessiblePointerEvents` (string) - CSS `pointer-events` value on the shadow div

### Custom tab order

Give each accessible container a `tabIndex` to control the order assistive tech walks through them. Higher numbers come later; equal numbers fall back to scene-graph order.

```ts
menuButton.accessible = true;
menuButton.eventMode = "static";
menuButton.tabIndex = 1;

playButton.accessible = true;
playButton.eventMode = "static";
playButton.tabIndex = 2;

settingsButton.accessible = true;
settingsButton.eventMode = "static";
settingsButton.tabIndex = 3;
```

`tabIndex` is only forwarded to the shadow div when the container is `interactive` (`eventMode` is `'static'` or `'dynamic'`). Without that, the system clamps the div's tabIndex back to `0`, and the order you set is ignored.

### Programmatic control

```ts
import { Application } from "pixi.js";

const app = new Application();
await app.init({ width: 800, height: 600 });

// Enable accessibility at runtime
app.renderer.accessibility.setAccessibilityEnabled(true);

// Check current state
console.log(app.renderer.accessibility.isActive);
console.log(app.renderer.accessibility.isMobileAccessibility);

// Full init options:
await app.init({
  accessibilityOptions: {
    enabledByDefault: true, // activate immediately (default: false)
    debug: true, // makes overlay divs visible (default: false)
    activateOnTab: true, // Tab key activates system (default: true)
    deactivateOnMouseMove: false, // stay active when mouse moves (default: true)
  },
});
```

The system can also be configured via static defaults before creating the Application:

```ts
import { AccessibilitySystem, Application } from "pixi.js";

AccessibilitySystem.defaultOptions.enabledByDefault = true;
AccessibilitySystem.defaultOptions.deactivateOnMouseMove = false;

const app = new Application();
await app.init();
```

### Handling accessible interactions

```ts
import { Sprite } from "pixi.js";

const button = new Sprite();
button.eventMode = "static";
button.accessible = true;
button.accessibleTitle = "Submit form";
button.tabIndex = 0;

// Screen readers trigger click/tap events through the shadow DOM element
button.on("pointertap", () => {
  submitForm();
});
```

When accessibility is active and a user activates a shadow div (via Enter/Space key or screen reader action), the system dispatches `click`, `pointertap`, and `tap` FederatedEvents to the corresponding container. Focus on the shadow div dispatches `mouseover`, and focus-out dispatches `mouseout`. Both `eventMode` and `accessible` should be set for full keyboard + pointer support.

## Common Mistakes

### [MEDIUM] Expecting accessibility to be active without Tab key press

The AccessibilitySystem does not create its DOM overlay until the user presses Tab (or, on mobile, focuses the touch hook). If your application needs accessibility immediately:

```ts
const app = new Application();
await app.init({
  accessibilityOptions: {
    enabledByDefault: true,
  },
});
```

Or at runtime:

```ts
app.renderer.accessibility.setAccessibilityEnabled(true);
```

Without one of these, automated accessibility testing tools will not find the overlay elements.


### [MEDIUM] Setting accessible without accessibleTitle

Wrong:

```ts
const sprite = new Sprite();
sprite.accessible = true;
// no title or hint set
```

Correct:

```ts
const sprite = new Sprite();
sprite.accessible = true;
sprite.accessibleTitle = "Play button";
sprite.accessibleHint = "Click to start the game";
```

A container with `accessible = true` but no `accessibleTitle` or `accessibleHint` gets a fallback title of `"container {tabIndex}"`. Screen readers will announce this generic label with no useful context. Always provide at least `accessibleTitle`.


### [MEDIUM] Accessibility deactivates when moving mouse

By default, `deactivateOnMouseMove` is `true`. Any mouse movement after Tab-activation will deactivate the overlay. This is by design (assumes keyboard-only users don't use a mouse), but it makes testing with a mouse frustrating.

```ts
await app.init({
  accessibilityOptions: {
    deactivateOnMouseMove: false,
  },
});
```


### [MEDIUM] Not importing accessibility extension in custom builds

When using `skipExtensionImports: true` for a custom build, the accessibility extension is not automatically registered. You must import it explicitly:

```ts
import "pixi.js/accessibility";
import { Application } from "pixi.js";

const app = new Application();
await app.init({ skipExtensionImports: true });
```

Without this import, `app.renderer.accessibility` will be undefined and no shadow DOM layer will be created.


## API Reference

- [AccessibilitySystem](https://pixijs.download/release/docs/accessibility.AccessibilitySystem.html.md)
- [AccessibilitySystemOptions](https://pixijs.download/release/docs/accessibility.AccessibilitySystemOptions.html.md)
- [AccessibilityOptions](https://pixijs.download/release/docs/accessibility.AccessibilityOptions.html.md)
- [AccessibleOptions](https://pixijs.download/release/docs/accessibility.AccessibleOptions.html.md)
- [PointerEvents](https://pixijs.download/release/docs/accessibility.PointerEvents.html.md)

© pixijs · MIT · pixijs/pixijs-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой