rtl-aware-development
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.
- License 许可
- MIT
- 最近更新
- 2026-10-23
- Stars
- ★ 12
- Forks
- 0
01 前言 Front Matter
- name
- rtl-aware-development
- description
- 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.
03 SKILL.md 正文
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
04 同仓库更多 Skills
update-skills
Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says "learn!", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.
update-pr
Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.
troubleshoot
Investigate unexpected behavior in the current Copilot agent session by analyzing its event log. Use when the user asks why something happened, why a request was slow, why a tool was or was not used, or why instructions/skills/agents did not load.
sync
Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
sync-upstream
Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.
merge
Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.