Skip to content

Commit 2071ec7

Browse files
committed
feat(motion): 补原语层焦点环落纸过渡
1 parent 34fb857 commit 2071ec7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎app/src/ui/primitives/Button.css‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,19 @@
4444
`width: auto` 的元素上 border-box 与 content-box 等价 ⇒ 对非 block 按钮零观感影响。 */
4545
box-sizing: border-box;
4646
/* 接缝(§8.6.1 第 2/3 条):四个属性各自**单属性、无时序、120ms** —— 回执不排队,下一次
47-
hover / 按下直接接管当前过渡(快速连点不会"播完上一条")。 */
47+
hover / 按下直接接管当前过渡(快速连点不会"播完上一条")。
48+
T12 追加 `outline-color` / `outline-offset` 两条:焦点环"落纸"(见下 `:focus-visible`)——
49+
基准态把 outline 声明为透明(`outline-color: transparent` 是关键字,不是色值字面量),
50+
于是 `:focus-visible` 的 token 墨色与 2px offset **有起点可插值**,键盘焦点不再是 0ms 硬跳。
51+
响应层三档同行为(§8.5 节能档「只留响应层」)⇒ 这里**不得**出现任何 `[data-motion]` 覆写。 */
52+
outline: 2px solid transparent;
53+
outline-offset: 0;
4854
transition: background-color var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1)),
4955
border-color var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1)),
5056
color var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1)),
51-
transform var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1));
57+
transform var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1)),
58+
outline-color var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1)),
59+
outline-offset var(--ed-dur-micro, 120ms) var(--ed-ease, cubic-bezier(0.2, 0, 0, 1));
5260
}
5361

5462
/* 三档尺寸:字号/行高/字重走字阶 token(`SCALE_TOKENS.typeScaleVars` 的第 4/5/6 档),

0 commit comments

Comments
 (0)