Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)28k · #9875

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/Kilo-Org/kilocode/blob/main/.opencode/skills/rtl-aware-development/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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 lang and dir on 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 add row-reverse, CSS order, 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. clientX remains 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 scrollLeft can start at 0 and become negative. Prefer scrollIntoView({ inline: "nearest" }) or a tested direction-normalizing helper.
  • For Electron title bars, prefer native caption controls and use titleBarOverlay plus env(titlebar-area-*) for the safe content rectangle. Keep Windows/macOS native-control avoidance and trafficLightPosition physical; keep app navigation inside that rectangle logical. Mark interactive titlebar children app-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

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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự