no-pointer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNo Pointer
无指针
Use the established Studio interaction convention for clickable controls:
- Set ; do not use
cursor: 'default'.cursor: 'pointer' - Drive purely visual hover styling through and
HOVERABLE_CLASS_NAMEfromhoverableStyle(). Do not add React hover state for color or background changes.packages/studio/src/helpers/hoverable.ts - Keep the background unchanged unless the surrounding component already uses
a shared background-hover convention. For a text-only action, use
for both
TRANSPARENTandidleBackground.hoverBackground - Use (
LIGHT_TEXT) as the idle color and#A6A7A9(WHITE) as the hover color. Icons and nested text must follow the same state; inspect the element that paints the pixels if the Studio CSS reset blocks inheritance.white
为可点击控件使用既定的 Studio 交互规范:
- 设置 ;不要使用
cursor: 'default'。cursor: 'pointer' - 通过 中的
packages/studio/src/helpers/hoverable.ts和HOVERABLE_CLASS_NAME实现纯视觉悬停样式。不要添加 React hover 状态来控制颜色或背景变化。hoverableStyle() - 除非周围的组件已经使用共享的背景悬停规范,否则保持背景不变。对于仅包含文本的操作,和
idleBackground均使用hoverBackground。TRANSPARENT - 使用 (
LIGHT_TEXT)作为空闲状态颜色,使用#A6A7A9(WHITE)作为悬停状态颜色。图标和嵌套文本必须遵循相同状态;如果 Studio CSS reset 阻止了样式继承,请检查实际绘制像素的元素。white
Focus styling
焦点样式
Remove the default outline and pointer-focus shadow, but preserve a visible
keyboard focus indicator. Add from
to the control alongside
. The shared class implements this pattern:
FOCUS_VISIBLE_ONLY_CLASS_NAMEpackages/studio/src/helpers/hoverable.tsHOVERABLE_CLASS_NAMEcss
.__remotion-focus-visible-only:focus {
outline: none;
box-shadow: none;
}
.__remotion-focus-visible-only:focus-visible {
box-shadow: ${FOCUS_BOX_SHADOW};
}Never remove the indicator. Keep hidden actions out of the tab
order until they are discoverable.
:focus-visible移除默认轮廓和指针焦点阴影,但保留可见的键盘焦点指示器。将 中的 与 一添加到控件上。共享类实现以下模式:
packages/studio/src/helpers/hoverable.tsFOCUS_VISIBLE_ONLY_CLASS_NAMEHOVERABLE_CLASS_NAMEcss
.__remotion-focus-visible-only:focus {
outline: none;
box-shadow: none;
}
.__remotion-focus-visible-only:focus-visible {
box-shadow: ${FOCUS_BOX_SHADOW};
}绝不移除 指示器。在隐藏操作可被发现之前,不要将其加入 Tab 顺序。
:focus-visibleVerify
验证
In a running Studio, check the control's computed styles in all relevant states:
- idle and hovered cursor: ;
default - idle color: ;
rgb(166, 167, 169) - hovered color: ;
rgb(255, 255, 255) - pointer focus: no outline or box shadow;
- keyboard focus: the standard
Tabis visible.FOCUS_BOX_SHADOW
For Studio code changes, run:
bash
bunx turbo run make --filter='@remotion/studio'
bunx turbo run lint test --filter='@remotion/studio'在运行中的 Studio 中,检查控件在所有相关状态下的计算样式:
- 空闲和悬停状态的光标:;
default - 空闲状态颜色:;
rgb(166, 167, 169) - 悬停状态颜色:;
rgb(255, 255, 255) - 指针焦点:无轮廓或 box shadow;
- 键盘 焦点:可见的标准
Tab。FOCUS_BOX_SHADOW
对于 Studio 代码更改,请运行:
bash
bunx turbo run make --filter='@remotion/studio'
bunx turbo run lint test --filter='@remotion/studio'