From 92229e79f1206106a9d9b9590d71451d6e4d71d9 Mon Sep 17 00:00:00 2001 From: Tarun Chauhan Date: Wed, 11 Jan 2023 17:40:13 +0530 Subject: [PATCH] style: show copy btn only on code block hover --- website/static/css/code-block-buttons.css | 10 +++++++++- website/static/overrides.css | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/website/static/css/code-block-buttons.css b/website/static/css/code-block-buttons.css index 1293143997a6..54567bed6664 100644 --- a/website/static/css/code-block-buttons.css +++ b/website/static/css/code-block-buttons.css @@ -5,7 +5,8 @@ pre { pre .btnIcon { position: absolute; - top: 4px; + top: -5px; + right: 16px; z-index: 2; cursor: pointer; border: 1px solid transparent; @@ -13,15 +14,22 @@ pre .btnIcon { background-color: transparent; height: 30px; transition: all 0.25s ease-out; + display: none; } pre .btnIcon:hover { text-decoration: none; + display: block; +} + +pre code[class*="language-"]:hover + .btnIcon { + display: block; } .btnIcon__body { align-items: center; display: flex; + color: #535b64; } .btnIcon svg { diff --git a/website/static/overrides.css b/website/static/overrides.css index 0945c648dc97..d3347ad1d63a 100644 --- a/website/static/overrides.css +++ b/website/static/overrides.css @@ -523,7 +523,7 @@ a { } .hljs { - padding: 1.5em; + padding: 16px; overflow: auto; font-size: 13.6px; line-height: 1.45;