From fb152cb36e41fc9f010062c144cc63c3bd494cf8 Mon Sep 17 00:00:00 2001 From: shuai Date: Thu, 13 Feb 2025 17:27:34 +0800 Subject: [PATCH] fix: optimize copy button style --- ui/src/components/Editor/utils/index.ts | 4 ++-- ui/src/index.scss | 14 +++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ui/src/components/Editor/utils/index.ts b/ui/src/components/Editor/utils/index.ts index 6c7a3ac4..9f752184 100644 --- a/ui/src/components/Editor/utils/index.ts +++ b/ui/src/components/Editor/utils/index.ts @@ -89,9 +89,9 @@ export function htmlRender(el: HTMLElement | null, config?: htmlRenderConfig) { codeTool.className = 'a-code-tool'; const uniqueId = `a-copy-code-${Date.now().toString().substring(5)}-${Math.floor(Math.random() * 10)}${Math.floor(Math.random() * 10)}${Math.floor(Math.random() * 10)}`; const str = ` - + `; codeTool.innerHTML = str; diff --git a/ui/src/index.scss b/ui/src/index.scss index dfbe6094..a056e538 100644 --- a/ui/src/index.scss +++ b/ui/src/index.scss @@ -380,18 +380,10 @@ img[src=""] { } .a-code-tool { position: absolute; - top: 0; - right: 0; + top: 0.5rem; + right: 0.5rem; font-size: 16px; z-index: 1; display: none; - .a-copy-code { - line-height: 24px; - width: 1.5rem; - height: 1.5rem; - display: flex; - justify-content: center; - align-items: center; - padding: 0; - } + line-height: 1; }