From b07ec6870515168708a642c82d33daef189873b4 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 27 May 2025 18:32:18 +0300 Subject: [PATCH] style/code blocks/copy button: prevent overlapping with the code block's text --- apps/client/src/stylesheets/style.css | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index b1d5f469e..4ce1dc0a6 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -530,13 +530,19 @@ pre:not(.hljs) { } pre { + --copy-button-margin-size: .35em; + position: relative; } pre > button.copy-button { position: absolute; - top: .35em; - right: .35em; + top: var(--copy-button-margin-size); + right: var(--copy-button-margin-size); +} + +:root pre:has(> button.copy-button) > code { + margin-right: calc(var(--icon-button-size) + (var(--copy-button-margin-size) * 2)); } pre > button.copy-button:hover {