rtl-aware-development
Skill này làm gì
Skill này đưa ra quy tắc để làm cho ứng dụng và bố cục hoạt động cả với chiều trái sang phải lẫn phải sang trái, bao gồm CSS logic, cô lập văn bản và lật biểu tượng. Dành cho lập trình viên xây dựng giao diện phải hỗ trợ tiếng Ả Rập, tiếng Do Thái hoặc các hệ chữ RTL khác.
Khi nào nên dùng
- ✓Khi bạn đang xây dựng hoặc rà soát một bố cục phải hỗ trợ ngôn ngữ viết từ phải sang trái.
- ✓Khi CSS dùng các giá trị trái và phải cần được đảo chiều cho văn bản RTL.
- ✓Khi văn bản tiếng Anh và RTL hoặc đường dẫn file lẫn lộn trông sai trong menu hay danh sách.
Liên kết skill
https://github.com/Kilo-Org/kilocode/blob/main/.opencode/skills/rtl-aware-development/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giao diện của tôi bị lỗi khi tôi chuyển sang tiếng Ả Rập. Hãy xem lại CSS và cho tôi biết cần sửa gì để bố cục đảo chiều đúng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra hướng của tài liệu, thay các thuộc tính trái và phải vật lý trong CSS bằng thuộc tính logic, rồi cô lập văn bản có chiều hỗn hợp. Nó chỉ lật các biểu tượng có ý nghĩa định hướng và để nguyên thương hiệu, biểu đồ và các điều khiển media.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
RTL-Aware Development
Treat direction as independent from language. Test English in both directions as well as real RTL and mixed-script content.
Guidelines
- Set
langanddiron the document, and propagate direction through component providers used by portaled menus and popovers. Do not change the selected locale merely to force RTL. - Keep DOM and focus order semantic. Flexbox and Grid already follow
dir; do not addrow-reverse, CSSorder, or reversed markup just to mirror a layout. - Prefer logical CSS for semantic layout. Reserve physical coordinates for pointer positions, canvas geometry, native window controls, and other genuinely physical placement.
/* Avoid */
padding-left: 12px;
right: 0;
border-right: 1px solid;
text-align: left;
/* Prefer */
padding-inline-start: 12px;
inset-inline-end: 0;
border-inline-end: 1px solid;
text-align: start;
- Isolate mixed-direction text. Use
dir="auto"or<bdi>for unknown text; keep code, URLs, IDs, and filesystem paths LTR without forcing the surrounding component LTR.
<span class="file-row"><bdi dir="auto">README.md</bdi></span> <bdi dir="ltr"><code>C:\src\app.ts</code></bdi>
- Mirror directional meaning, not every image. Back/forward, previous/next, disclosure, indentation, and directional progress may need mirroring. Do not mirror brands, clocks, media controls, charts, or text. Reverse physical gradients,
translateX, SVG transforms, and animation deltas explicitly. - Map interactions through direction.
clientXremains physical; resizing a logical edge needs an RTL-aware delta. Logical previous/next keyboard controls may swap ArrowLeft/ArrowRight. Follow the relevant WAI-ARIA widget pattern. - Do not assume LTR scrolling. RTL
scrollLeftcan start at0and become negative. PreferscrollIntoView({ inline: "nearest" })or a tested direction-normalizing helper. - For Electron title bars, prefer native caption controls and use
titleBarOverlayplusenv(titlebar-area-*)for the safe content rectangle. Keep Windows/macOS native-control avoidance andtrafficLightPositionphysical; keep app navigation inside that rectangle logical. Mark interactive titlebar childrenapp-region: no-drag. - Verify behavior, not screenshots alone. Check computed styles, pseudo-element geometry, hit zones, focus order, keyboard behavior, submenu direction, zoom/scaling, and both LTR and RTL scroll endpoints.
Test Matrix
- English + LTR
- English + forced RTL
- A real RTL locale + RTL
- Mixed RTL/LTR content, long labels, numbers, code, and paths
- Keyboard, pointer resize, scrolling, menus/submenus, and Electron titlebar controls in both directions
References
- RTL Styling 101, Ahmad Shadeed
- CSS-Tricks: RTL Styling 101
- CSS-Tricks: CSS Logical Properties and Values
- W3C: Structural markup and right-to-left text
- W3C: Inline bidirectional markup
- MDN: CSS logical properties and values
- MDN:
dir - MDN:
scrollLeft - web.dev: Logical properties
- Electron: Custom title bar
- WAI-ARIA: Window splitter pattern
- Kobalte: I18n Provider
Câu hỏi thường gặp
CSS logic là gì?
Nó dùng start và end thay cho left và right, nên bố cục tự đảo chiều với văn bản RTL.
Mọi biểu tượng có nên được lật không?
Không. Chỉ những biểu tượng có ý nghĩa định hướng, như quay lại hoặc tiếp theo, mới được lật.
Văn bản hỗn hợp được xử lý thế nào?
Văn bản chưa rõ chiều được thêm thuộc tính direction hoặc thẻ bdi, còn code, URL và đường dẫn luôn đi từ trái sang phải.
Chi tiết
Mô tả gốc của tác giả
OpenCode Desktop should be RTL-aware. Use when implementing or reviewing RTL/LTR behavior in the web app, desktop app, CSS, menus, scrolling, resizing, icons, mixed-direction text, or Electron title bars.
repo: Kilo-Org/kilocode
Độ phổ biến
- Sao GitHub
- 28k
- Vị trí xếp hạng
- #9875
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
chart
28kCho phép agent của bạn vẽ biểu đồ cột, đường, tròn, phân tán hoặc tương tự khi bạn yêu cầu, bằng một công cụ biểu đồ hiển thị dữ liệu.
jetbrains-sandbox
28kCho phép agent của bạn cài IntelliJ trong sandbox đám mây Linux, có chế độ xem trên trình duyệt và công cụ điều khiển IDE.
effect
28kDạy agent của bạn viết TypeScript với Effect, dùng các API v4 hiện tại cho service có kiểu, schema và workflow thay vì các ví dụ cũ.
Skill tương tự
canvas
394kCho phép agent của bạn hiện một widget trực quan được lưu trữ trên bảng Mac đã kết nối, rồi ẩn bảng hoặc chuyển nó sang trang khác.
control-ui
394kGiúp agent của bạn sắp xếp và khắc phục sự cố Control UI của OpenClaw, gồm các phiên, bảng điều khiển và Gateway đã kết nối.
diagram-maker
394kGiúp agent của bạn vẽ sơ đồ rõ ràng dạng SVG, HTML hoặc Excalidraw có thể sửa, cho quy trình, kiến trúc hệ thống và bản phác bảng trắng.