Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2931

logical-properties

Skill này làm gì

Skill này cập nhật CSS dùng hướng cố định, như trái và phải, sang các thuộc tính logic theo chiều đọc. Skill dành cho lập trình viên muốn website hỗ trợ nhiều ngôn ngữ.

Khi nào nên dùng

  • ✓Khi bạn nhờ agent chuẩn bị stylesheet cho ngôn ngữ viết từ phải sang trái.
  • ✓Khi bạn thêm hỗ trợ tiếng Ả Rập, tiếng Do Thái hoặc tiếng Ba Tư và bố cục trông sai với các ngôn ngữ đó.
  • ✓Khi bạn rà soát CSS và muốn thay margin-left và các thuộc tính tương tự bằng phiên bản tự thích nghi.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/logical-properties/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/thedaviddias/Front-End-Checklist/blob/main/skills/logical-properties/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

“Bạn có thể cập nhật CSS của tôi để bố cục hoạt động đúng với người đọc tiếng Ả Rập và tiếng Do Thái không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các quy tắc khoảng cách và vị trí dùng hướng cố định rồi thay bằng các tương đương inline và block. Khi chiều văn bản thay đổi, bố cục sẽ tự lật theo.

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.

Use CSS logical properties for i18n and RTL support

Physical CSS properties (margin-left, padding-right) are hardcoded to screen directions. In right-to-left languages (Arabic, Hebrew, Persian), what should be margin-left becomes margin-right. Without logical properties, supporting RTL requires maintaining duplicate stylesheets or complex overrides with [dir=rtl] selectors. Logical properties handle this automatically.

Quick Reference

  • Logical properties adapt to writing direction — margin-inline-start is left in LTR, right in RTL
  • Replace left/right margin and padding with inline-start/inline-end equivalents
  • Replace top/bottom with block-start/block-end equivalents
  • Logical properties also work correctly for vertical writing modes

Check

Find all uses of margin-left, margin-right, padding-left, padding-right, border-left, border-right, left, right (as positioning) that should be converted to logical equivalents.

Fix

Convert physical direction properties to their CSS logical property equivalents for RTL and internationalization support.

Explain

Explain CSS logical properties, the difference between physical and logical directions, and how they enable RTL language support.

Code Review

Review stylesheets, component styles, and responsive states related to Use CSS logical properties for i18n and RTL support. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/logical-properties

Câu hỏi thường gặp

Tôi có còn cần style riêng cho chiều phải sang trái không?

Thường thì không. Thuộc tính logic tự xử lý chiều, nên thường có thể tránh stylesheet riêng hoặc ghi đè thêm.

Thuộc tính logic có giúp với văn bản dọc không?

Có. Skill nói chúng cũng hoạt động đúng với chế độ viết dọc.

Tôi có nên kiểm tra bố cục sau khi thay đổi không?

Có. Skill khuyên kiểm tra bố cục đã hiển thị trên nhiều kích thước màn hình và các trạng thái tương tác.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing stylesheets, component styles, and responsive behavior related to Use CSS logical properties for i18n and RTL support. Check the rendered layout across breakpoints and interaction states before proposing a fix.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2931
Giấy phép
MIT
Cập nhật
31/10/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ự