From 486a216f532628de8e0e52ffcabfe09863de9f23 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Wed, 25 Nov 2026 09:21:42 +0900 Subject: [PATCH] Fix the code block copy button overlapping a right-floating TOC div.pre-wrapper did not shrink beside a floating TOC while the
inside it did, so the copy button was placed over the TOC, and the
wrapper covered the TOC links and made them unclickable.

Make the wrapper a flow-root so that it shrinks like the 
. Its
vertical margins are moved from the 
 to the wrapper because they
no longer collapse through it.

Co-Authored-By: Claude Opus 5.5 
---
 app/assets/stylesheets/application.css | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 1a006291b..bca001ecd 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -2000,6 +2000,11 @@ div.wiki li>ul, div.wiki li>ol {margin-block-end: 0;}
 
 div.wiki div.pre-wrapper {
   position: relative;
+  display: flow-root; /* Do not overlap a floating TOC */
+  margin-block: 1em;
+}
+div.wiki div.pre-wrapper > pre {
+  margin-block: 0;
 }
 
 /* Hide Mermaid code blocks until they are rendered so that their source does not flash.
-- 
2.55.0