Skip to content

Build your personal knowledge base with Trilium Notes

style/code blocks/copy button: prevent overlapping with the code block's text

Adorian Doranb07ec6870515
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index b1d5f469ef..4ce1dc0a6e 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 {