From 3e1a11d67bbbc706bf7e8bdd696adbb223545a15 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:19:08 -0400 Subject: [PATCH] Fix duplicate copy buttons in sphinxawesome and shibuya themes sphinx-copybutton styles its button as `button.copybtn`, so the `.copybtn` hide rule lost on specificity and both copy buttons rendered. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- yardang/shibuya.css | 5 +++-- yardang/sphinxawesome_theme.css | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/yardang/shibuya.css b/yardang/shibuya.css index 7b6fcb1a..b1662c60 100644 --- a/yardang/shibuya.css +++ b/yardang/shibuya.css @@ -8,7 +8,8 @@ a.reference > img { max-width: unset; } -/* Shibuya ships its own copy button; hide the sphinx-copybutton duplicate */ -.copybtn { +/* Shibuya ships its own copy button; hide the sphinx-copybutton duplicate. + Must match copybutton.css's `button.copybtn` specificity to win. */ +button.copybtn { display: none; } diff --git a/yardang/sphinxawesome_theme.css b/yardang/sphinxawesome_theme.css index e3659221..17ba81ba 100644 --- a/yardang/sphinxawesome_theme.css +++ b/yardang/sphinxawesome_theme.css @@ -27,8 +27,9 @@ a.reference > img { background-color: rgba(255, 255, 255, 0.08) !important; } -/* Hide duplicate copybtn */ -.copybtn { +/* Hide the sphinx-copybutton duplicate; the theme ships its own button.copy. + Must match copybutton.css's `button.copybtn` specificity to win. */ +button.copybtn { display: none; }