validate / validate (push) Canceled after 0s
用户实测:右栏「图库」底部的刷新 / 打开本地目录 / 设置三个图标太小,齿轮几乎看不清。 按宿主 design-tokens.md §3.8 落地(图标尺寸闭集 14/16/18、描边 1.6、命中区 ≥28×28): - SVG 14 → 18(ICON_PX,CSS 用 var(--iwb-icon-lg, 18px) 覆盖,宿主 token 缺失才用属性兜底); - stroke-width 1.5 → 1.6; - 按钮 20×20 → 28×28,工具组 gap 0 → 4(三个大图标不再紧贴); - 设置浮层 bottom 34 → 40:底栏长高到 35px + 容器底 4,仍用 34 会被图标压住。 左侧计数文字、三个图标的交互与类名都没动;新增尺寸全在 token 闭集内。 测试:新增 gallery/tools/harness.mjs(19 项静态断言,含旧值反向断言与散值检查), 并入默认 npm test;新增 gallery/tools/foot-visual-check.mjs(Chromium 挂真实面板 11 项: computed 28/18、gap、浮层不压底栏、亮暗尺寸一致、改前 14/20 对照),注册 test:gallery:visual。 npm test 与真浏览器核对全过,对比图 /tmp/gal-foot-171-compare.png 已人工核对。
89 lines
5.7 KiB
CSS
89 lines
5.7 KiB
CSS
/* 图库插件样式(v1.5.0)
|
||
* 为什么放插件里:宿主 style.css 只在客户端发版时更新,而这里是「设置浮层/图标按钮/紧凑间距」这类
|
||
* 高频视觉调整——随插件更新即可生效,不必重发桌面端。选择器均带 .iwb-gal-* / .iwb-history-* 前缀,
|
||
* 且比宿主同名规则更具体(.iwb-gal-foot .iwb-gal-icobtn),宿主旧样式不会盖回来。
|
||
*/
|
||
|
||
/* ---- 面板留白:边缘收小,避免窄栏里浪费空间 ---- */
|
||
.iwb-history-embedded { padding: 6px 6px 4px; gap: 6px; }
|
||
.iwb-history-embedded .iwb-history-grid { gap: 6px; padding: 0 0 2px; justify-content: flex-start; }
|
||
/* 列宽由插件按「图幅」写死(style width),这里禁用宿主的 flex:1 拉伸 */
|
||
.iwb-history-embedded .iwb-history-col { flex: 0 0 auto; gap: 6px; }
|
||
|
||
/* ---- 顶栏 ---- */
|
||
.iwb-gal-head { display: flex; align-items: center; gap: 6px; min-height: 0; }
|
||
.iwb-gal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
|
||
.iwb-gal-actions .iwb-btn-sm { padding: 2px 6px; }
|
||
|
||
/* ---- 底栏:左信息 / 右工具组 ---- */
|
||
.iwb-gal-foot {
|
||
display: flex; align-items: center; justify-content: space-between; gap: 6px;
|
||
min-width: 0; padding-top: 6px; border-top: 1px solid var(--iwb-border);
|
||
}
|
||
.iwb-gal-foot-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
|
||
.iwb-gal-count { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
|
||
.iwb-gal-sel { font-size: 11px; color: var(--iwb-brand); white-space: nowrap; }
|
||
.iwb-gal-status { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: none; }
|
||
/* v1.7.1:图标放大后三个按钮不再紧贴(4px 是 spacing 闭集值) */
|
||
.iwb-gal-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: auto; }
|
||
|
||
/* ---- 图标按钮:无外框、无底色,只在悬停时给一点反馈 ----
|
||
v1.7.1:命中区 20×20 → 28×28(design-tokens.md §3.8「≥28×28」),
|
||
图形 14 → var(--iwb-icon-lg) 18;CSS 尺寸覆盖 SVG 的 presentation attribute,
|
||
属性里的 18 只作宿主 token 缺失时的兜底。 */
|
||
.iwb-gal-foot .iwb-gal-icobtn,
|
||
.iwb-gal-foot .iwb-gal-icobtn:hover,
|
||
.iwb-gal-foot .iwb-gal-icobtn:active {
|
||
width: 28px; height: 28px; min-width: 28px; padding: 0; box-sizing: border-box;
|
||
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
|
||
border: 0; box-shadow: none; background: transparent; border-radius: 6px;
|
||
color: var(--iwb-text2); line-height: 1; transform: none;
|
||
}
|
||
.iwb-gal-foot .iwb-gal-icobtn svg {
|
||
display: block; pointer-events: none;
|
||
width: var(--iwb-icon-lg, 18px); height: var(--iwb-icon-lg, 18px);
|
||
}
|
||
.iwb-gal-foot .iwb-gal-icobtn:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||
.iwb-gal-foot .iwb-gal-icobtn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; }
|
||
.iwb-gal-setbtn-on { color: var(--iwb-brand); background: var(--iwb-layer2); }
|
||
|
||
/* ---- 设置浮层(三个下拉不占前台) ----
|
||
bottom 随底栏高度走:底栏 = padding-top 6 + border 1 + 按钮 28,再加容器底 4 → 39,
|
||
取 40 让浮层正好停在底栏上沿之外;仍用 34 会被放大后的图标压住。 */
|
||
.iwb-gal-settings {
|
||
position: absolute; right: 8px; bottom: 40px; z-index: 30; width: 176px; max-width: calc(100% - 16px);
|
||
display: flex; flex-direction: column; gap: 8px; padding: 8px 10px;
|
||
background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 8px;
|
||
box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
|
||
}
|
||
.iwb-gal-settings-title { font-size: 11px; font-weight: 600; color: var(--iwb-text2); }
|
||
.iwb-gal-setrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--iwb-text2); }
|
||
.iwb-gal-setlabel { flex: 0 0 auto; }
|
||
.iwb-gal-setrow select { flex: 1 1 auto; width: auto; min-width: 58px; max-width: 92px; height: 22px; font-size: 11px; padding: 0 2px 0 4px; }
|
||
|
||
/* ---- 图片墙 ---- */
|
||
.iwb-history-grid { overscroll-behavior: contain; }
|
||
.iwb-history-embedded .iwb-history-item { position: relative; flex: none; width: 100%; }
|
||
.iwb-history-embedded .iwb-history-item img {
|
||
width: 100%; height: auto; display: block; object-fit: contain; margin: 0 auto;
|
||
border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: pointer;
|
||
}
|
||
.iwb-history-missing {
|
||
display: flex; align-items: center; justify-content: center; text-align: center;
|
||
min-height: 84px; padding: 8px; border-radius: 6px; border: 1px dashed var(--iwb-border);
|
||
font-size: 11px; color: var(--iwb-text2); background: var(--iwb-layer2); word-break: break-all;
|
||
}
|
||
.iwb-history-actions { display: flex; gap: 4px; padding: 4px 2px 0; }
|
||
.iwb-history-actions .iwb-btn-sm { padding: 2px 6px; font-size: 11px; }
|
||
.iwb-history-more { display: flex; justify-content: center; padding: 4px 0 2px; }
|
||
/* 只作用于图库自己的空态提示:不加前缀会泄漏到设置页等使用 .iwb-hint 的地方(文字被居中) */
|
||
.iwb-history-embedded .iwb-hint { font-size: 11px; color: var(--iwb-text2); text-align: center; padding: 12px 6px; }
|
||
/* ---- v1.6.0:失败统计 / 右键菜单标题(v1.6.1 去掉搜索框)---- */
|
||
.iwb-gal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
|
||
.iwb-gal-fail {
|
||
font-size: 11px; color: var(--iwb-err); cursor: pointer; white-space: nowrap;
|
||
text-decoration: underline dotted; text-underline-offset: 2px;
|
||
}
|
||
.iwb-gal-fail:hover { color: var(--iwb-err); opacity: .85; }
|
||
.iwb-gal-menu .iwb-ctx-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|