mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-04 14:17:28 +00:00
Add a "copy" button below each message (#6654)
This commit is contained in:
parent
58342740a5
commit
a5d64b586d
5 changed files with 104 additions and 26 deletions
53
css/main.css
53
css/main.css
|
|
@ -1142,7 +1142,6 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
|
|||
}
|
||||
|
||||
.dark svg {
|
||||
fill: white;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
|
@ -1221,3 +1220,55 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
|
|||
background: var(--light-theme-gray);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------
|
||||
Copy button for chat messages
|
||||
---------------------------------------------- */
|
||||
.message .text,
|
||||
.message .text-you,
|
||||
.message .text-bot,
|
||||
.user-message .text,
|
||||
.assistant-message .text {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.message, .user-message, .assistant-message {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.copy-button {
|
||||
position: absolute;
|
||||
bottom: -23px;
|
||||
left: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.message:hover .copy-button,
|
||||
.user-message:hover .copy-button,
|
||||
.assistant-message:hover .copy-button {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.copy-button svg {
|
||||
stroke: rgb(156 163 175);
|
||||
transition: stroke 0.2s;
|
||||
}
|
||||
|
||||
.copy-button:hover svg {
|
||||
stroke: rgb(107 114 128);
|
||||
}
|
||||
|
||||
.dark .copy-button svg {
|
||||
stroke: rgb(156 163 175);
|
||||
}
|
||||
|
||||
.dark .copy-button:hover svg {
|
||||
stroke: rgb(209 213 219);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue