修复输入框 hint 与光标不对齐

- styles.css:字号从输入区/编辑器各自声明下沉到共同父级 .resource-reference-input(13px/1.6),hint 不再继承面板的 16px 而比实际输入文字大一圈
- styles.css:编辑器内 Lexical 段落清零外边距,去掉全局 p 规则的 8px 顶边距,光标不再比 hint 低 8px
- 实测:hint 首字符与打字后首字符位置完全重合(948/640.5)
This commit is contained in:
2026-09-15 15:07:11 +08:00
parent 58f6eceb69
commit 99fd319607
+23
View File
@@ -10869,6 +10869,18 @@ button.design-workspace-tree__entry:hover,
box-shadow: 0 0 0 3px var(--platform-input-focus-ring);
}
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer
.resource-reference-input {
/* hint 是自制 span(不是原生 placeholder 属性),它和输入区各自取字号就会错位:
输入区写了 13px/1.6,而 `.resource-reference-input { font: inherit }` 让它继承到
面板的 16px/24px——同一段提示比实际光标大一圈、基线也不同,看起来就是"光标和
hint 没对齐"。字号下沉到两者的共同父级,双方共用同一套字体度量。 */
font-size: 13px;
line-height: 1.6;
}
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer
@@ -10881,6 +10893,17 @@ button.design-workspace-tree__entry:hover,
line-height: 1.6;
}
/* Lexical 会把内容包进 `<p>`,而全局规则给段落留了 `margin: 8px 0 0`
输入区自己的文字因此比 hint(绝对定位在 top:0 的 span)低 8px,看起来就是
"光标和 hint 没对齐"。这里把段落在编辑器内清零,光标与 hint 落在同一行盒。 */
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer
.resource-reference-input-editor
p {
margin: 0;
}
/* 陶泥儿输入区的操作排(`AI 润色` / `恢复原文`)回到文档流:网格第二行右侧那一列,
`justify-content: flex-end` 贴住输入框右下角。之前这里用
`position: absolute; right: 48px; bottom: 10px` 把整排从网格里摘出来浮在输入框中间,