使用CSS样式实现滚动条美化
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

- 改用style标签实现滚动条样式
- 确保样式正确生效

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-04-01 19:03:44 +08:00
parent 89c9d1455a
commit 80db2de86a

View File

@ -795,7 +795,24 @@ export function AgentPsdTemplateEditorDialog({
}
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<>
<style jsx>{`
.psd-preview-viewport::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.psd-preview-viewport::-webkit-scrollbar-track {
background: transparent;
}
.psd-preview-viewport::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
border-radius: 4px;
}
.psd-preview-viewport::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3);
}
`}</style>
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent
overlayClassName="bg-black/85 backdrop-blur-sm"
className="flex h-[92vh] w-[96vw] max-w-[1700px] flex-col overflow-hidden border border-white/10 bg-[#09090b] p-0 text-white shadow-[0_30px_120px_rgba(0,0,0,0.65)]"
@ -902,7 +919,7 @@ export function AgentPsdTemplateEditorDialog({
<div
ref={previewViewportRef}
className="relative flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-2xl border border-white/10 bg-[#111114] p-4 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/20 hover:[&::-webkit-scrollbar-thumb]:bg-white/30"
className="psd-preview-viewport relative flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-2xl border border-white/10 bg-[#111114] p-4"
>
{selectedTemplate ? (
<div