Przejdź do treści
Biblioteka skilli
Projektowanie i UX · Testowanie

rtl-rendering-tester

/rtl-rendering-tester

Sprawdza układy RTL w aplikacji w locale arabskim, hebrajskim, perskim i urdu: atrybut dir, lustrzane układy i zrzuty ekranu.

Repozytorium
qa ↗
Licencja
MIT
Ostatnia zmiana repozytorium
20.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 20.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Sprawdza układy RTL w aplikacji w locale arabskim, hebrajskim, perskim i urdu: atrybut dir, lustrzane układy i zrzuty ekranu.

Wyzwalacze z opisu

rtl\
Oryginalny opis (EN)

Build-an-X workflow for verifying RTL (right-to-left) layouts - runs the test suite under Arabic / Hebrew / Persian / Urdu locales, asserts the `dir=\"rtl\"` attribute is set, verifies layout mirrors correctly (text alignment, icon positions, scrollbar location), uses logical CSS properties (`start`/`end` over `left`/`right`) per W3C guidance, captures per-locale screenshots for visual review. Use when the app supports RTL languages.

Jak działa

  1. Overview
  2. When to use
  3. Step 1 - Verify dir attribute presence
  4. Step 2 - Verify text alignment
  5. Step 3 - Verify icon positions
  6. Step 4 - Bidi text in mixed contexts
  7. Step 5 - Form input behavior
  8. Step 6 - Supplementary checks
  9. Anti-patterns
  10. Limitations
Sekcje z nagłówków SKILL.md, w oryginale · 153 linii, 751 słów
Podgląd SKILL.md
---
name: rtl-rendering-tester
description: "Build-an-X workflow for verifying RTL (right-to-left) layouts - runs the test suite under Arabic / Hebrew / Persian / Urdu locales, asserts the `dir=\"rtl\"` attribute is set, verifies layout mirrors correctly (text alignment, icon positions, scrollbar location), uses logical CSS properties (`start`/`end` over `left`/`right`) per W3C guidance, captures per-locale screenshots for visual review. Use when the app supports RTL languages."
---

# rtl-rendering-tester

## Overview

Per [w3-rtl][w3rtl], `dir="rtl"` on the `<html>` tag is the standard signal for
right-to-left direction: blocks align right, bidi text flows right-to-left,
table columns progress right-to-left, and form inputs start at the right. This
skill verifies the app handles those under Arabic, Hebrew, Persian, and Urdu.

[w3rtl]: https://www.w3.org/International/questions/qa-html-dir

## When to use

- The product supports any RTL language.
- A new feature ships; RTL regression check before release.
- A bug report says "looks wrong in Arabic / Hebrew."

## Step 1 - Verify `dir` attribute presence

```typescript
import { test, expect } from '@playwright/test';

test.use({ extraHTTPHeaders: { 'Accept-Language': 'ar' } });

test('Arabic locale sets dir=rtl on <html>', async ({ page }) => {
  await page.goto('/');
  const dir = await page.locator('html').getAttribute('dir');
  expect(dir).toBe('rtl');
});

test('Hebrew locale sets dir=rtl on <html>', async ({ page }) => {
  await page.goto('/?lng=he');
  await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
});
```

Per [w3-rtl][w3rtl]: the `html`-level `dir` is the canonical
signal; CSS-only direction setting is incorrect:

> "Do _not_ use CSS to apply base direction in HTML pages.
> Direction is semantic content and should reside in markup, not
> styling."

## Step 2 - Verify text alignment

```typescript
test('text aligns right in RTL', async ({ page }) => {
  await page.goto('/?lng=ar');
  const heading = page.locator('h1').first();
  const align = await heading.evaluate(el => getComputedStyle(el).textAlign);
  expect(['right', 'start']).toContain(align);   // 'start' resolves to right in RTL
});
```

Per [w3-rtl][w3rtl]: prefer logical properties (`start`, `end`)
over directional (`left`, `right`) so the layout flips automatically.

## Step 3 - Verify icon positions

Directional icons (back/forward and pagination arrows, direction chevrons) must
mirror in RTL; brand logos and icons with embedded text must not.

```typescript
test('back arrow mirrors in RTL', async ({ page }) => {
  await page.goto('/cart?lng=ar');
  const backArrow = page.getByRole('link', { name: /back/i });
  const transform = await backArrow.evaluate(el => getComputedStyle(el).transform);
  // RTL should apply scaleX(-1) (or use a different mirrored asset)
  expect(transform).toContain('-1');
});
```

## Step 4 - Bidi text in mixed contexts

Mixed LTR + RTL content is a common bidi issue:

```text
"My order #ORD-12345 has shipped."
```

In Arabic locale, the order number "ORD-12345" must remain LTR
inside the RTL paragraph. Without proper bidi markers, the
ordering can flip.

```typescript
test('order number preserves LTR direction inside RTL paragraph', async ({ page }) => {
  await page.goto('/orders/ORD-12345?lng=ar');
  const paragraph = page.locator('p').filter({ hasText: 'ORD-12345' });
  const orderNumber = paragraph.locator('bdi, [dir="ltr"]');
  await expect(orderNumber).toBeVisible();
  await expect(orderNumber).toHaveText('ORD-12345');
});
```

The `<bdi>` element or `dir="ltr"` on a span isolates LTR text
within an RTL block - without it, browser bidi heuristics may
flip.

## Step 5 - Form input behavior

Per [w3-rtl][w3rtl]: in RTL, "Form inputs start at the right by
default."

```typescript
test('form inputs start at right in RTL', async ({ page }) => {
  await page.goto('/checkout?lng=he');
  const emailField = page.getByLabel(/email/i);
  await emailField.click();
  // Cursor / placeholder text should be at the right edge
  // (assert via screenshot or computed-style direction)
  await expect(emailField).toHaveCSS('text-align', /(right|start)/);
});
```

## Step 6 - Supplementary checks

Three checks that extend the core assertions above:
[references/rtl-checks.md](references/rtl-checks.md) covers per-locale visual
regression (screenshots per RTL locale to catch un-mirrored padding, icons,
sidebars, and field order), CI integration across desktop and mobile profiles,
and `dirname` form-submission direction.

## Anti-patterns

| Anti-pattern                                                          | Why it fails                                                              | Fix |
|-----------------------------------------------------------------------|---------------------------------------------------------------------------|-----|
| CSS-only direction                                                     | Per [w3-rtl][w3rtl]: "Do not use CSS to apply base direction."           | `dir="rtl"` on the `html` tag (Step 1). |
| Hardcoded `left` / `right` in CSS                                      | Doesn't mirror in RTL.                                                    | Logical properties (`start` / `end`) per [w3-rtl][w3rtl]. |
| Mirroring brand logos / icons with embedded text                       | Brand recognition + readability suffer.                                   | Per-asset decision; not all icons mirror. |
| Order numbers / IDs without `<bdi>` / `dir="ltr"` isolation             | Bidi heuristics may flip; "ORD-12345" becomes "12345-ORD".              | Wrap in `<bdi>` (Step 4). |
| Skipping per-locale visual regression                                  | Regressions visible only when RTL activated.                             | Per-locale screenshots (Step 6). |

## Limitations

- **Browser bidi heuristics vary.** Chrome / Firefox / Safari handle
  edge cases differently; per-browser tests recommended.
- **Translation quality affects test reliability.** Test
  translations should be real strings, not pseudo-loc, for accurate
  RTL behavior.
- **Some RTL languages have specific gotchas** (e.g., Persian uses
  Arabic script but Indo-European word order; Urdu has unique
  bidirectional patterns).

## References

- [w3rtl][w3rtl] - W3C on `dir` attribute, RTL effects, semantic
  vs CSS direction, `dirname` attribute.
- `pseudo-localization-runner` - sibling: layout-level i18n testing including RTL pseudo-loc
  variant.
- `i18n-string-coverage` - source-scan complement.
- `playwright-snapshots` - visual regression for catching RTL layout issues.
Pliki w paczce (3)
  • SKILL.md 6 KB
  • .tessl-plugin/plugin.json 1 KB
  • references/rtl-checks.md 2 KB

Wersje

W bazie nie ma innych skilli o nazwie rtl-rendering-tester.

Migawka bazy z 13.11.2026 · wersja paczki 4756b1541b30 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100rtl
    Buduje i przegląda interfejsy RTL dla arabskiego, perskiego, hebrajskiego i urdu: kierunek, logiczny CSS, lustrzane ikony i tekst z liczbami.
  • 100rtl-internationalization
    Wspiera układy od prawej do lewej i tekst dwukierunkowy dla hebrajskiego, arabskiego, perskiego i urdu: właściwości logiczne CSS i Tailwind, lustrzane ikony oraz testy z dir="rtl".
  • 90arabic-rtl
    Buduje i poprawia interfejsy dla języków arabskiego, hebrajskiego i perskiego: układ RTL, liczby, daty i tekst mieszany.
  • 100hebrew-rtl-best-practices
    Wdraża układy od prawej do lewej (RTL) w hebrajskich aplikacjach webowych: logiczne właściwości CSS, :dir(), Tailwind RTL, React i Next.js, lustrzane ikony i typografię hebrajską.
  • 90rtl-layout
    Wspiera języki pisane od prawej do lewej przez odbicie układu, ikon i interakcji przy zachowaniu liczb i kodu, przy dodawaniu arabskiego, hebrajskiego, perskiego lub urdu do interfejsu.
  • 100persian-rtl-design
    Projektuje i poprawia interfejsy od prawej do lewej dla perskiego, arabskiego, hebrajskiego i urdu: układ, lustrzane ikony, cyfry i daty.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.