Cursor rule
.cursor/rules/keyboard-shortcuts-ux.mdc快捷键交互必须有可见 UI 提示,并使用统一 kbd 样式
Cursor rules
Quality
31/100
Scores the file, not the repository.Length
105 words
3 headings · 1 code blocksRepository
34
— · pushed 25 days agoLast changed
3 days ago
First indexed 3 days ago.123456# 快捷键 UX 规范78所有新增或修改的快捷键交互,都必须同时更新用户可见的 UI 提示。不能只实现键盘监听而不在界面上标注快捷键。910## 规则11121. **快捷键必须可见**:有快捷键的按钮、菜单项、Tooltip 或 Dialog 操作,必须在对应操作旁展示快捷键提示。132. **统一使用 kbd 样式**:快捷键提示使用 `<kbd data-slot="kbd">...</kbd>`,不要在业务组件里手写背景、边框、字号、阴影或额外间距等 Tailwind 样式。143. **文案走 i18n**:用户可见的快捷键文本必须复用或新增 locale key;不要在 Vue 模板中硬编码英文文案。154. **Enter/Return 用图标**:确认类回车快捷键优先使用回车/Return 图标,例如 `CornerDownLeft`;保留 `sr-only` 文案用于可访问性。165. **ESC 用文字**:取消/关闭类快捷键显示为 `ESC`,不要写成 `Esc` 或其它大小写形式。176. **文字不替代状态**:快捷键提示只标注快捷键,不改变按钮主文案;例如 `删除 + ↵`,不要把按钮文案改成“回车删除”。187. **Keycap 必须轻量**:快捷键提示是辅助信息,样式应跟随当前按钮颜色,只使用 10% 透明叠色底;不要加边框,不要做成按钮里的第二个按钮。198. **底色算法固定**:keycap 底色基于 `currentColor` 计算,使用类似 `color-mix(in srgb, currentColor var(--kbd-bg-strength), transparent)` 的算法;默认强度为 10%,深色背景会被浅色前景提亮,浅色背景会被深色前景压暗。需要微调时只改全局 `--kbd-bg-strength`。209. **图标 keycap 单独留白**:文字 keycap 保持紧凑;图标 keycap 使用更大的正方形底色区域承载图标,保证图标四周有约 2-3px 视觉留白。2122## 示例2324```vue25<Button>26 {{ t('session.confirmDelete') }}27 <kbd data-slot="kbd" data-icon="true">28 <CornerDownLeft aria-hidden="true" />29 <span class="sr-only">{{ t('session.shortcutEnter') }}</span>30 </kbd>31</Button>3233<Button variant="outline">34 {{ t('session.cancel') }}35 <kbd data-slot="kbd">{{ t('session.shortcutEscape') }}</kbd>36</Button>37```38
Also in NoDeskAI/browser-pilot
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| NoDeskAI/browser-pilot.cursor/rules/build-from-user-perspective.mdc · 34 | Cursor rules | buildsecurity | 51/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/debug-container.mdc · 34 | Cursor rules | api | 65/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/deploy.mdc · 34 | Cursor rules | no sections | 38/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/env-vars.mdc · 34 | Cursor rules | setup | 63/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/fingerprint-popover-sync.mdc · 34 | Cursor rules | no sections | 25/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/plan-ui-summary.mdc · 34 | Cursor rules | ui | 54/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/tailwind-css-color-mix.mdc · 34 | Cursor rules | ui | 50/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/ux-ui-daynight.mdc · 34 | Cursor rules | lint-formatui | 54/100 | 3 days ago | |
| NoDeskAI/browser-pilot.cursor/rules/verify-before-claim.mdc · 34 | Cursor rules | no sections | 50/100 | 3 days ago |
Diff against .cursor/rules/build-from-user-perspective.mdc Diff against .cursor/rules/debug-container.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/env-vars.mdc Diff against .cursor/rules/fingerprint-popover-sync.mdc Diff against .cursor/rules/plan-ui-summary.mdc Diff against .cursor/rules/tailwind-css-color-mix.mdc Diff against .cursor/rules/ux-ui-daynight.mdc Diff against .cursor/rules/verify-before-claim.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
