From 6191232d5f00258230a9824b5305e864ebe2c1af Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 14 Oct 2025 17:40:58 -0400 Subject: [PATCH] web: colocate copy button styles with components that use them --- .../share/content-markdown.module.css | 6 ++++++ .../components/share/content-text.module.css | 6 ++++++ .../web/src/components/share/part.module.css | 20 ------------------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/packages/web/src/components/share/content-markdown.module.css b/packages/web/src/components/share/content-markdown.module.css index 765c2593..858a8ade 100644 --- a/packages/web/src/components/share/content-markdown.module.css +++ b/packages/web/src/components/share/content-markdown.module.css @@ -1,4 +1,5 @@ .root { + position: relative; display: flex; flex-direction: column; align-items: flex-start; @@ -145,4 +146,9 @@ border-right: none; } } + + [data-component="copy-button"] { + top: 0; + right: 0; + } } diff --git a/packages/web/src/components/share/content-text.module.css b/packages/web/src/components/share/content-text.module.css index a3842275..139aa3fa 100644 --- a/packages/web/src/components/share/content-text.module.css +++ b/packages/web/src/components/share/content-text.module.css @@ -1,4 +1,5 @@ .root { + position: relative; color: var(--sl-color-text); background-color: var(--sl-color-bg-surface); padding: 0.5rem calc(0.5rem + 3px); @@ -54,4 +55,9 @@ &[data-theme="blue"] { background-color: var(--sl-color-blue-low); } + + [data-component="copy-button"] { + top: 0.5rem; + right: calc(0.5rem - 1px); + } } diff --git a/packages/web/src/components/share/part.module.css b/packages/web/src/components/share/part.module.css index 45310a0b..b1269445 100644 --- a/packages/web/src/components/share/part.module.css +++ b/packages/web/src/components/share/part.module.css @@ -127,11 +127,6 @@ flex-grow: 1; max-width: var(--md-tool-width); position: relative; - - [data-component="copy-button"] { - top: 0.5rem; - right: calc(0.5rem - 1px); - } } [data-component="assistant-reasoning"] { @@ -149,11 +144,6 @@ padding: 0.5rem calc(0.5rem + 3px); border-radius: 0.25rem; position: relative; - - [data-component="copy-button"] { - top: 0.5rem; - right: calc(0.5rem - 1px); - } } } @@ -172,11 +162,6 @@ padding: 0.5rem calc(0.5rem + 3px); border-radius: 0.25rem; position: relative; - - [data-component="copy-button"] { - top: 0.5rem; - right: calc(0.5rem - 1px); - } } } @@ -300,11 +285,6 @@ padding: 0.5rem calc(0.5rem + 3px); border-radius: 0.25rem; position: relative; - - [data-component="copy-button"] { - top: 0.5rem; - right: calc(0.5rem - 1px); - } } } }