Files
spark-store/src/assets/css/appstyle.css
T
xiyidaiwa 3d28010797 fix: 处理 PR 评审意见(副作用清理、滚动条分层与变量化)
- SubmitterWindow: onMounted 修改 body/html 背景后,在 onUnmounted 中恢复原始值,避免副作用泄漏。
- appstyle.css: 全局滚动条基础几何/颜色移至 @layer base,使 .scrollbar-muted/.scrollbar-nowidth 工具类优先级更高;
  暗色 thumb 改用专用变量 --color-scrollbar-thumb-dark (#15203b),保留比 surface 略亮的可辨识反差(未改用 --color-surface-dark)。
- 评审建议"margin 改 padding"与"改用 .scrollbar-muted"经分析不成立:padding 不会内移滚动条、无法避开圆角,margin 才能把容器连同滚动条推离圆角;
  .scrollbar-muted 为 0.4rem 细条,与其他页面 0.75rem 全局不一致,故保持 mr-4 mb-4 全局样式。
2026-07-22 01:39:52 +08:00

138 lines
3.2 KiB
CSS

@import "tailwindcss";
@theme {
--font-sans: "Inter", "system-ui", "-apple-system", "Segoe UI", "sans-serif";
--color-brand: #0071e3;
--color-brand-dark: #0066cc;
--color-brand-soft: #409cff;
--color-surface-light: #f5f7fb;
--color-surface-dark: #0b1220;
--color-card-light: #ffffff;
--color-card-dark: #151c2c;
--color-scrollbar-thumb-light: #94a3b8;
--color-scrollbar-thumb-dark: #15203b;
--shadow-glass: 0 10px 30px rgba(15,23,42,0.08);
--shadow-glassDark: 0 20px 45px rgba(0,0,0,0.45);
--radius-xl: 1rem;
}
@variant dark (&:where(.dark, .dark *));
@layer base {
html {
color-scheme: light;
}
html.dark {
color-scheme: dark;
}
body {
font-family: var(--font-sans);
background-color: var(--color-surface-light);
color: #0f172a;
min-height: 100vh;
overflow: hidden;
}
:root.dark body {
background-color: var(--color-surface-dark);
color: #f8fafc;
}
#app {
min-height: 100vh;
}
/* 全局滚动条基础几何:置于 base,使 utilities 中的 .scrollbar-muted/.scrollbar-nowidth 可覆盖 */
*::-webkit-scrollbar {
width: 0.75rem;
height: 0.75rem;
}
*::-webkit-scrollbar-track {
background: transparent;
}
/* 亮色滚动条:与暗色保持相同几何(透明边距),确保亮/暗滚动块大小一致 */
html ::-webkit-scrollbar-thumb {
background-color: var(--color-scrollbar-thumb-light);
border-radius: 9999px;
border: 2px solid transparent;
background-clip: padding-box;
}
html ::-webkit-scrollbar-track {
background: transparent;
}
/* 暗色滚动条:挂在 html.dark 上(root),比 surface 略亮以保留可辨识反差 (#15203b),
注意:必须用 html.dark 而非 .dark *,因为经典滚动条只作用于滚动容器自身,
.dark * 在亮色模式不命中会导致回退到原生宽度,亮/暗宽度不一致。 */
html.dark ::-webkit-scrollbar-thumb {
background-color: var(--color-scrollbar-thumb-dark);
border-radius: 9999px;
border: 2px solid transparent;
background-clip: padding-box;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
html.dark ::-webkit-scrollbar-track {
background: transparent;
}
}
@layer utilities {
/* 弱化滚动条 */
.scrollbar-muted {
scrollbar-width: thin;
scrollbar-color: var(--color-scrollbar-thumb-light) transparent;
}
.scrollbar-muted::-webkit-scrollbar {
width: 0.4rem;
}
.scrollbar-muted::-webkit-scrollbar-track {
background: transparent;
}
.scrollbar-muted::-webkit-scrollbar-thumb {
background-color: var(--color-scrollbar-thumb-light);
border-radius: 9999px;
}
html.dark .scrollbar-muted {
scrollbar-color: var(--color-surface-dark) transparent;
}
html.dark .scrollbar-muted::-webkit-scrollbar-thumb {
background-color: var(--color-surface-dark);
}
/* 完全隐藏滚动条 */
.scrollbar-nowidth {
scrollbar-width: none;
}
.scrollbar-nowidth::-webkit-scrollbar {
width: 0;
background: transparent;
}
.scrollbar-nowidth::-webkit-scrollbar-track {
background: transparent;
}
.scrollbar-nowidth::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: 0;
}
}