diff options
| author | Adam <[email protected]> | 2026-01-22 06:29:33 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-22 06:29:38 -0600 |
| commit | fb007d6bab1258ac21f6d9b7efc4b7149499cf8f (patch) | |
| tree | db07d04398b5f072ac211de0cb328135e2ba01be /packages/ui/src/components/markdown.css | |
| parent | 4ca088ed121c293819f5da13c0d2ff2a616ad597 (diff) | |
| download | opencode-fb007d6bab1258ac21f6d9b7efc4b7149499cf8f.tar.gz opencode-fb007d6bab1258ac21f6d9b7efc4b7149499cf8f.zip | |
feat(app): copy buttons for assistant messages and code blocks
Diffstat (limited to 'packages/ui/src/components/markdown.css')
| -rw-r--r-- | packages/ui/src/components/markdown.css | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/ui/src/components/markdown.css b/packages/ui/src/components/markdown.css index 1cbcf6f97..a30510a8d 100644 --- a/packages/ui/src/components/markdown.css +++ b/packages/ui/src/components/markdown.css @@ -111,6 +111,35 @@ border: 0.5px solid var(--border-weak-base); } + [data-component="markdown-code"] { + position: relative; + } + + [data-slot="markdown-copy-button"] { + position: absolute; + top: 8px; + right: 8px; + opacity: 0; + transition: opacity 0.15s ease; + z-index: 1; + } + + [data-component="markdown-code"]:hover [data-slot="markdown-copy-button"] { + opacity: 1; + } + + [data-slot="markdown-copy-button"] [data-slot="check-icon"] { + display: none; + } + + [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="copy-icon"] { + display: none; + } + + [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="check-icon"] { + display: inline-flex; + } + pre { margin-top: 2rem; margin-bottom: 2rem; |
