Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

hebrew-rtl-best-practices

БесплатноБез исполняемых скриптовНе проверен

Implement right-to-left (RTL) layouts for Hebrew web applications. Use when user asks about RTL layout, Hebrew text direction, bidirectional (bidi) text…

skills-ilот skills-il★ 28 звёзд на GitHub

Об этом скилле

Hebrew RTL Best Practices

Instructions

Step 1: Set Up Document Direction

Always start with the HTML attribute (not just CSS):

<html lang="he" dir="rtl">

This tells browsers, screen readers, and CSS to use RTL as the base direction.

Step 2: Use CSS Logical Properties

NEVER use physical directional properties for layout:

Physical (avoid) Logical (use)
margin-left margin-inline-start
margin-right margin-inline-end
padding-left padding-inline-start
padding-right padding-inline-end
border-left border-inline-start
text-align: left text-align: start
text-align: right text-align: end
float: left float: inline-start
left: 10px inset-inline-start: 10px

This ensures the layout automatically mirrors in RTL mode.

When you genuinely need a direction-specific rule that logical properties cannot express, prefer the :dir() pseudo-class over [dir="rtl"] attribute selectors:

/* Modern: matches the resolved direction, including dir="auto" and inheritance */
.chevron:dir(rtl) { transform: scaleX(-1); }

/* Older approach: only matches an explicit dir attribute on/above the element */
[dir="rtl"] .chevron { transform: scaleX(-1); }

:dir() is part of Selectors Level 4 and resolves the computed direction, so it also works for elements whose direction comes from dir="auto" or from an ancestor, where an attribute selector would miss them. Browser support: Chrome and Edge shipped it in version 120 (late 2023), Firefox has supported it for years, and Safari added it in 16.4, so it is now Baseline (widely available). For older-browser support, keep an [dir="rtl"] fallback rule or use a logical property instead. Check current support at https://caniuse.com/css-dir-pseudo.

Step 3: Handle Bidirectional Text

When mixing Hebrew and English/numbers:

/* Isolate embedded LTR content */
.ltr-content {
  unicode-bidi: isolate;
  direction: ltr;
}

/* Mixed or unknown-direction content: each paragraph picks its own base direction */
.user-content {
  unicode-bidi: plaintext;
}

Do not use unicode-bidi: bidi-override for mixed content. It switches off the implicit part of the bidi algorithm and lays every character out strictly in the direction value, so English inside an RTL override renders letter-reversed. Reserve it (or <bdo>) for deliberately forcing a known visual order.

Common bidi issues:

  • Phone numbers written with spaces (050 321 4450) or a +972 prefix appearing scrambled: wrap in <bdo dir="ltr">. A plain hyphenated 050-321-4450 already stays intact, because a single hyphen between two numbers joins them into one number run.
  • Punctuation at wrong end of sentence: Use unicode-bidi: isolate
  • URLs/emails in Hebrew text: Wrap in <span dir="ltr">

Numbers and dates: Standalone numbers and DD/MM/YYYY dates inside Hebrew text usually render fine because digits are weak-LTR, but a number that is immediately followed by a sign, currency, or a second number can flip. When a value must keep a fixed visual order, isolate it with <span dir="ltr"> or unicode-bidi: isolate rather than trusting the default bidi resolution.

Format the value, then isolate it. Bidi isolation only stops a correct string from flipping; it does not produce the right string. Use Intl to format, then isolate: Intl.NumberFormat('he-IL', { style: 'currency', currency: 'ILS' }) for shekel amounts and Intl.DateTimeFormat('he-IL') for dates, and wrap the output in <bdi> (or unicode-bidi: isolate) if it sits inline in Hebrew prose. Do not force dir="ltr" on he-IL output: the currency string carries its own right-to-left marks (U+200F) and is laid out for an RTL context, so forcing LTR moves the ₪ to the other side of the number. The distinction: force dir="ltr" on raw digit strings such as phone numbers, which carry no direction marks, and only isolate Intl output, which does. Devs commonly conflate the two and apply bidi fixes to a formatting bug (or vice versa).

Hebrew dates need the calendar extension. Intl.DateTimeFormat('he-IL') resolves to the Gregorian calendar (resolvedOptions().calendar === 'gregory'), so a Hebrew locale alone will not give you a Hebrew date. Request the calendar through the -u-ca- Unicode extension: Intl.DateTimeFormat('he-IL-u-ca-hebrew') formats 20 September 2026 as 9 בתשרי 5787. Use it for holiday, yahrzeit, and dual-date displays, and keep the Gregorian format for anything users file with an authority.

Form inputs need dir="auto". Put dir="auto" on every <input> and <textarea> so each value resolves its own base direction. This is the most visible end-user RTL bug: an email or an English word typed into a Hebrew form jumps to the wrong side without it. Note that the placeholder does not trigger auto-detection, so set the resting direction with CSS if the empty-field loo

Полный SKILL.md на GitHub

Установить hebrew-rtl-best-practices в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

SKILL_HE.mdevidence.jsonmetadata.jsonoptimization-log.jsonreferences/css-logical-properties.mdreferences/domain-checklist.md

FAQ

Что делает скилл hebrew-rtl-best-practices?

Implement right-to-left (RTL) layouts for Hebrew web applications. Use when user asks about RTL layout, Hebrew text direction, bidirectional (bidi) text, Hebrew CSS, "right to left", or needs to build a Hebrew web UI. Covers CSS logical properties, the :dir() pseudo-class, Tailwind RTL, React/Next.js RTL setup, icon mirroring, Hebrew typography, and font selection. Do NOT use for Arabic RTL (similar but different typography) unless user explicitly asks for shared RTL patterns, or for native mobile RTL (React Native I18nManager, SwiftUI, Android) which is out of scope.

Как установить скилл hebrew-rtl-best-practices?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hebrew-rtl-best-practices запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить hebrew-rtl-best-practices с