fix(dashboard): 左栏仓库搜索框文字压在放大镜上

原因:搜索框是 Fomantic 的 .ui.fluid.action.left.icon.input,放大镜是绝对定位的
.icon(默认宽 2.671em),官方靠 input 的 padding-left 让位。我们把 padding 覆盖成
0 10px 之后,图标位置不变、文字却顶到最左边,于是叠在一起。

改动:
- input padding 改为 0 10px 0 37px(量过:图标右边缘 69px,文字起点 75px)
- .ui.input > .icon 宽 30px、透明度 .7
- 附 preview/_reposearch_probe.html,加载线上 index.css 复现该 DOM 并可量尺

样式表 ?v=10
This commit is contained in:
QQ 2026-11-03 14:13:57 +08:00
parent a18935bfa2
commit e6d7951574
3 changed files with 68 additions and 4 deletions

View File

@ -385,7 +385,10 @@
.qq-dash-repos #dashboard-repo-list input[type="search"] {
width: 100%;
height: 34px;
padding: 0 10px;
/* 左侧留出图标位:Fomantic 的 .left.icon.input 会把放大镜绝对定位在左边,
官方默认的内边距是 2.671em,这里覆盖了 padding 就必须自己补回来,
否则「查找仓库…」会压在放大镜上 */
padding: 0 10px 0 37px;
margin-bottom: 10px;
font-size: 13px;
border: 1px solid var(--color-input-border, var(--color-secondary));
@ -394,6 +397,12 @@
color: var(--color-input-text, var(--color-text));
}
.qq-dash-repos #dashboard-repo-list .ui.input > .icon {
width: 30px;
font-size: 14px;
opacity: 0.7;
}
.qq-dash-repos a {
font-size: 13px;
}

View File

@ -4,9 +4,9 @@
注意:只做外观增强,不引入任何外部依赖,全部资源随 custom/ 一起发布
*/}}
<link rel="preload" href="{{AssetUrlPrefix}}/fonts/jetbrains-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-ui.css?v=9">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-fx.css?v=9">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-pages.css?v=9">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-ui.css?v=10">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-fx.css?v=10">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-pages.css?v=10">
<meta name="theme-color" content="#60A5FA" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#0D1117" media="(prefers-color-scheme: dark)">

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="zh-CN" class="theme-qq-light">
<head>
<meta charset="utf-8">
<title>左栏仓库搜索框探针</title>
<!-- 加载线上真实样式,复现 DashboardRepoList.vue 里搜索框的 DOM,用来验证 padding-left 是否够 -->
<link rel="stylesheet" href="https://git.qyhhh.top/assets/css/index.css">
<link rel="stylesheet" href="https://git.qyhhh.top/assets/css/theme-qq-light.css">
<link rel="stylesheet" href="../custom/public/assets/css/qq-ui.css">
<link rel="stylesheet" href="../custom/public/assets/css/qq-pages.css">
<style>
body { padding: 24px; background: var(--color-body); }
.wrap { width: 248px; } /* 与控制台左栏同宽 */
.pad { padding: 12px; border: 1px dashed var(--color-secondary); margin-bottom: 24px; }
</style>
</head>
<body>
<div class="wrap page-content qq-dash">
<div class="qq-dash-shell" style="max-width:none;padding:0">
<div class="pad">
<p style="font-size:12px;margin:0 0 8px">当前线上样式</p>
<section class="qq-dash-card qq-dash-repos" style="margin:0">
<div id="dashboard-repo-list">
<div class="ui fluid action left icon input">
<input type="search" placeholder="查找仓库…">
<i class="icon"><svg width="16" height="16" viewBox="0 0 16 16"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></i>
<div class="ui dropdown icon button"><svg width="16" height="16" viewBox="0 0 16 16"><path d="M.75 3h14.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5ZM3 7.75A.75.75 0 0 1 3.75 7h10.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 7.75Zm3 4a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"></path></svg></div>
</div>
</div>
</section>
</div>
</div>
</div>
<pre id="out" style="margin-top:24px;font-size:12px"></pre>
<script>
// 量一下输入框的左内边距、图标位置,看文字会不会压在图标上
window.addEventListener('load', () => {
const input = document.querySelector('#dashboard-repo-list input[type="search"]');
const icon = document.querySelector('#dashboard-repo-list .ui.input > .icon');
const cs = getComputedStyle(input);
const ir = input.getBoundingClientRect();
const gr = icon.getBoundingClientRect();
document.getElementById('out').textContent = [
`input padding-left = ${cs.paddingLeft}`,
`input height = ${cs.height}`,
`input left = ${ir.left.toFixed(1)}`,
`icon left = ${gr.left.toFixed(1)} width = ${gr.width.toFixed(1)}`,
`图标右边缘 = ${(gr.left + gr.width).toFixed(1)} → 文字起点应 ≥ 该值 + 6`,
`文字起点 = ${(ir.left + parseFloat(cs.paddingLeft)).toFixed(1)}`,
].join('\n');
});
</script>
</body>
</html>