From 128e9045394f253239af5af4ba93f7f2bf5da055 Mon Sep 17 00:00:00 2001 From: Anna Dabrowska Date: Tue, 23 Sep 2025 17:12:30 +0200 Subject: [PATCH] Revert "feat: add copy-to-clipboard functionality for code elements" --- css/area_content.less | 75 ----------------------- js/copy-code.js | 137 ------------------------------------------ script.js | 2 +- 3 files changed, 1 insertion(+), 213 deletions(-) delete mode 100644 js/copy-code.js diff --git a/css/area_content.less b/css/area_content.less index ce4d525..0390921 100755 --- a/css/area_content.less +++ b/css/area_content.less @@ -61,78 +61,3 @@ line-height: @line-height-default; } } - -/* Code copy functionality styles */ -.code-wrapper { - position: relative; - display: inline-block; - width: 100%; - - &.has-copy-btn { - .code, - pre { - padding-right: 3rem; // Make room for copy button - } - } -} - -.code-copy-btn { - position: absolute; - top: 1.5rem; - right: 0.5rem; - padding: 0.25rem 0.5rem; - background-color: @ini_background; - border: 1px solid @ini_border; - border-radius: @fix_border-radius; - cursor: pointer; - opacity: 0.7; - transition: opacity @transition, background-color @transition; - color: @ini_text; - line-height: 1; - - &:hover { - opacity: 1; - background-color: @ini_background_alt; - } - - &:active { - transform: translateY(1px); - } - - svg { - display: block; - width: 16px; - height: 16px; - } - - &.copy-success { - background-color: #d4edda; - border-color: #c3e6cb; - color: #155724; - } - - &.copy-error { - background-color: #f8d7da; - border-color: #f5c6cb; - color: #721c24; - } -} - -/* Ensure code blocks have proper positioning context */ -.code, -pre.code, -pre > code { - position: relative; -} - -/* Mobile adjustments */ -@media @screen_max-xs { - .code-copy-btn { - padding: 0.2rem 0.4rem; - - svg { - width: 14px; - height: 14px; - } - } -} diff --git a/js/copy-code.js b/js/copy-code.js deleted file mode 100644 index b6077de..0000000 --- a/js/copy-code.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Adds copy-to-clipboard functionality for code blocks - * - * @author Karsten Kosmala - */ -(function($) { - 'use strict'; - - /** - * Create and insert copy button for a code element - */ - var createCopyButton = function($codeElement) { - var $button = $('