From 4ba99989e3dc46da28d2f67fe593a22add16cd85 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 27 May 2025 20:14:55 +0300 Subject: [PATCH] style/code blocks/copy button: optimize the layout --- apps/client/src/stylesheets/style.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 4ce1dc0a6..f934973c3 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -529,10 +529,13 @@ pre:not(.hljs) { font-size: 100%; } -pre { +:root pre { + --padding-size: 1em; --copy-button-margin-size: .35em; + --copy-button-width: 37px; position: relative; + padding: var(--padding-size); } pre > button.copy-button { @@ -541,8 +544,8 @@ pre > button.copy-button { 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)); +:root pre:has(> button.copy-button) { + padding-right: calc(var(--copy-button-width) + (var(--copy-button-margin-size) * 2)); } pre > button.copy-button:hover {