Agent skill
rtl-css
RTL (Right-to-Left) CSS for Hebrew and Arabic. Use when building UI that needs RTL support, fixing RTL layout issues, or auditing CSS for RTL compliance.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/rtl-css
SKILL.md
RTL CSS with Logical Properties
The Golden Rule
NEVER use physical properties. ALWAYS use logical properties.
Property Mapping
| Physical (❌) | Logical (✅) | Tailwind |
|---|---|---|
| padding-left | padding-inline-start | ps-* |
| padding-right | padding-inline-end | pe-* |
| margin-left | margin-inline-start | ms-* |
| margin-right | margin-inline-end | me-* |
| left | inset-inline-start | start-* |
| right | inset-inline-end | end-* |
| text-align: left | text-align: start | text-start |
| text-align: right | text-align: end | text-end |
| border-left | border-inline-start | border-s-* |
| border-right | border-inline-end | border-e-* |
Tailwind Examples
// ❌ WRONG - Breaks in RTL
<div className="pl-4 pr-2 ml-auto text-left border-l-2">
// ✅ CORRECT - Works everywhere
<div className="ps-4 pe-2 ms-auto text-start border-s-2">
Next.js Layout with RTL
// app/[locale]/layout.tsx
import { isRtlLang } from 'rtl-detect';
export default function LocaleLayout({
children,
params: { locale },
}) {
const dir = isRtlLang(locale) ? 'rtl' : 'ltr';
return (
<html lang={locale} dir={dir}>
<body>{children}</body>
</html>
);
}
Icon Flipping
// Directional icons need flip
<ChevronRight className="rtl:rotate-180" />
<ArrowRight className="rtl:rotate-180" />
<ArrowLeft className="rtl:rotate-180" />
// Universal icons - don't flip
<Check /> <X /> <Search /> <Menu /> <Home />
Audit Command
Run scripts/audit_rtl.sh to find violations in your codebase.
Checklist
- All padding uses ps-/pe-
- All margins uses ms-/me-
- Positioning uses start-/end-
- Text uses text-start/text-end
- Directional icons have rtl:rotate-180
- Layout has dir attribute
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?