NavBar: layout does not switch to RTL for RTL locales
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, tailwindcss, typescript
调研方向
Start with src/registry/components/navbar.tsx, especially the language menu around line 161, and read how LanguageSwitcher derives direction from the active locale and isRtl. Check the existing NavBar tests and add coverage for locale direction, Locale.rtl overrides, and an explicit dir prop. Done means the bar and dropdown mirror in LTR and RTL, option labels align at the start, and the requested desktop and mobile light and dark screenshots are covered.
由索引模型根据 Issue 内容生成。
描述
Problem
Selecting an RTL locale in NavBar translates the link labels but leaves the layout left-to-right. With ar selected in the docs demo:
- The logo stays on the left, links read left to right, and the language/GitHub/CTA group stays on the right.
- The language menu is pinned with a physical
right-0(src/registry/components/navbar.tsx:161), so it doesn't mirror. - Option labels in the language menu render centered instead of start-aligned (the option
<button>has notext-start, so the label inherits the button's default centering).
NavBar never sets dir. LanguageSwitcher already derives it from the active locale (activeLocale?.rtl ?? isRtl(locale)).
Expected
NavBarsetsdir="rtl"on the<nav>when the active locale is RTL, using the same rule asLanguageSwitcher(Locale.rtloverride first, thenisRtlfromlocale-data). An explicitdirprop wins.- Layout mirrors via logical utilities:
end-0/start-0instead ofright-0/left-0,ms-*/me-*instead ofml-*/mr-*, andtext-starton option labels. This applies to the desktop bar, the mobile bar, the mobile menu and the language dropdown. - Each option keeps its own
dir, so mixed-script lists read correctly.
Acceptance
- Selecting
arflips the whole bar. Selectingenflips it back. - Language dropdown opens aligned to the trigger's inline-end edge in both directions.
- Option labels are start-aligned in LTR and RTL.
-
dirprop overrides the locale-derived direction. - Tests for:
diron<nav>for an RTL locale, theLocale.rtloverride (rtl: true/rtl: false), and the explicitdirprop. - Screenshots: LTR and RTL, desktop and ~390px, light and dark.
- 主要语言
- TypeScript
- 星标
- 39
- 派生
- 16
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
babelize/babelize-elements 的其他 Issue
-
bug website
难度 2/5 1-3 小时 新手友好度 78/100
babelize/babelize-elements#46 ·
维护者通常 1 天内回复
-
bug language-switcher priority: medium
难度 2/5 1-3 小时 新手友好度 72/100
babelize/babelize-elements#26 ·
维护者通常 1 天内回复
-
component enhancement help wanted
难度 5/5 一周以上 新手友好度 35/100
babelize/babelize-elements#47 ·
维护者通常 1 天内回复
-
Website: revamp and improve the landing page可能已有人在做 @anjalinayak01 于 7 天前认领。 未关闭enhancement help wanted priority: medium website
难度 4/5 一周以上 新手友好度 30/100
babelize/babelize-elements#37 · 已指派 1 人 ·
维护者通常 1 天内回复
-
component good first issue pluralization
难度 3/5 1-2 天 新手友好度 58/100
babelize/babelize-elements#34 ·
维护者通常 1 天内回复
查看 babelize/babelize-elements 的全部 Issue
相似的 Issue
-
area:security documentation effort:S priority:P2
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
app:web meta:ops
难度 2/5 半天 新手友好度 78/100
osu-tournament-rating/otr#1113 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 65/100
typegoose/mongodb-memory-server#1040 ·
-
bug
难度 2/5 1-3 小时 新手友好度 92/100