Skip to content

Commit fb152cb

Browse files
committed
fix: optimize copy button style
1 parent 1dfa03b commit fb152cb

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

ui/src/components/Editor/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export function htmlRender(el: HTMLElement | null, config?: htmlRenderConfig) {
8989
codeTool.className = 'a-code-tool';
9090
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)}`;
9191
const str = `
92-
<button type="button" class="btn btn-dark rounded-0 a-copy-code" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="${copyText}" id="${uniqueId}">
92+
<a role="button" class="link-secondary a-copy-code" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="${copyText}" id="${uniqueId}">
9393
<i class="br bi-copy"></i>
94-
</button>
94+
</a>
9595
`;
9696
codeTool.innerHTML = str;
9797

ui/src/index.scss

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,10 @@ img[src=""] {
380380
}
381381
.a-code-tool {
382382
position: absolute;
383-
top: 0;
384-
right: 0;
383+
top: 0.5rem;
384+
right: 0.5rem;
385385
font-size: 16px;
386386
z-index: 1;
387387
display: none;
388-
.a-copy-code {
389-
line-height: 24px;
390-
width: 1.5rem;
391-
height: 1.5rem;
392-
display: flex;
393-
justify-content: center;
394-
align-items: center;
395-
padding: 0;
396-
}
388+
line-height: 1;
397389
}

0 commit comments

Comments
 (0)