From ebb648bb2dabeed18d82762bb529f6eb4e44ffd4 Mon Sep 17 00:00:00 2001 From: Gato Date: Fri, 19 Jun 2026 15:44:00 +0200 Subject: [PATCH] fix: isoler le style du code inline pour ne pas affecter les blocs pre MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .content code dans les thèmes ciblait aussi le dans
,
écrasant les couleurs syntect par héritage et ajoutant une bordure
indésirable. Changé en .content :not(pre) > code + reset explicite
dans style.css (border: none, color: inherit).

Co-Authored-By: Claude Sonnet 4.6 
---
 src-tauri/resources/themes/default.css          | 2 +-
 src-tauri/resources/themes/shell-indigo.css     | 2 +-
 src-tauri/src/infrastructure/comrak_renderer.rs | 1 +
 src/style.css                                   | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src-tauri/resources/themes/default.css b/src-tauri/resources/themes/default.css
index 8e8b2f9..4c221e1 100644
--- a/src-tauri/resources/themes/default.css
+++ b/src-tauri/resources/themes/default.css
@@ -92,7 +92,7 @@ body {
 /* ── Code ───────────────────────────────────── */
 
 /* Code inline (entre backticks simples) */
-.content code {
+.content :not(pre) > code {
   background: #f1f5f9;
   color: #4f46e5;
   border: 1px solid #e2e8f0;
diff --git a/src-tauri/resources/themes/shell-indigo.css b/src-tauri/resources/themes/shell-indigo.css
index e3b5740..e86e760 100644
--- a/src-tauri/resources/themes/shell-indigo.css
+++ b/src-tauri/resources/themes/shell-indigo.css
@@ -8,7 +8,7 @@ body { background: #f1f5f9; }
 .content h1, .content h2, .content h3, .content h4, .content h5, .content h6 { color: #0f172a; }
 .content p { color: #1e293b; }
 .content ul li, .content ol li { color: #1e293b; }
-.content code { background: #f1f5f9; color: #4f46e5; border: 1px solid #e2e8f0; }
+.content :not(pre) > code { background: #f1f5f9; color: #4f46e5; border: 1px solid #e2e8f0; }
 .content pre:not(.syntax-highlighting) { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; }
 .content .syntax-highlighting { border: 1px solid #1e293b; border-radius: 10px; }
 .content pre:not(.syntax-highlighting) code { background: none; color: #e2e8f0; }
diff --git a/src-tauri/src/infrastructure/comrak_renderer.rs b/src-tauri/src/infrastructure/comrak_renderer.rs
index 150a9cd..7e42d42 100644
--- a/src-tauri/src/infrastructure/comrak_renderer.rs
+++ b/src-tauri/src/infrastructure/comrak_renderer.rs
@@ -80,4 +80,5 @@ mod tests {
         let css = syntax_css_for_theme("nonexistent-theme-xyz");
         assert!(css.is_empty());
     }
+
 }
diff --git a/src/style.css b/src/style.css
index a212a91..eebc424 100644
--- a/src/style.css
+++ b/src/style.css
@@ -453,7 +453,7 @@ body {
 }
 .content pre { padding: 20px 24px; border-radius: 6px; overflow-x: auto; margin: 16px 0; }
 .content pre:not(.syntax-highlighting) { background: #f4f4f7; }
-.content pre code { background: none; padding: 0; font-weight: 400; font-size: 13px; }
+.content pre code { background: none; padding: 0; font-weight: 400; font-size: 13px; border: none; border-radius: 0; color: inherit; }
 
 .content blockquote {
   border-left: 3px solid rgba(34,34,34,0.25);