diff --git a/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js b/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js index a17ec51e224..28ce226e2b0 100644 --- a/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js +++ b/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js @@ -113,6 +113,9 @@ export default class CodeblockButtons { copyButton.ariaLabel = I18n.t("copy_codeblock.copy"); copyButton.innerHTML = iconHTML("copy"); wrapperEl.appendChild(copyButton); + wrapperEl.style.right = `${ + codeBlock.offsetWidth - codeBlock.clientWidth + }px`; } if ( diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index d3e18eab64d..2ac00f7f0f2 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -1022,15 +1022,7 @@ pre { .codeblock-button-wrapper { position: absolute; - right: 0; display: flex; - - .copy-cmd { - right: 0; - } - .copy-fullscreen { - right: 28px; - } } .copy-cmd, @@ -1042,8 +1034,10 @@ pre { min-height: 0; font-size: var(--font-down-2); opacity: 0.7; + cursor: pointer; &.action-complete { + cursor: auto; .d-icon { color: var(--tertiary); }