From e3479a02c52ab0ee99f0b89e8bfa05d2eb90ff83 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 26 Aug 2025 09:40:03 -0400 Subject: [PATCH] test --- static/custom-tufte.css | 7 +++++++ templates/base.html | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/static/custom-tufte.css b/static/custom-tufte.css index 902508f..8020b92 100644 --- a/static/custom-tufte.css +++ b/static/custom-tufte.css @@ -304,6 +304,8 @@ header, footer, nav { border-radius: 0.5rem; overflow-x: auto; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); + width: 85% !important; /* Override any parent width constraints */ + max-width: none !important; } .tufte pre::before { @@ -324,6 +326,11 @@ header, footer, nav { font-size: 0.95rem; line-height: 1.6; text-shadow: 0 0 2px rgba(208, 200, 236, 0.2); + width: auto; /* Override Tufte's 52.5% width constraint */ + margin-left: 0; /* Override Tufte's margin */ + display: block; + white-space: pre-wrap; /* Allow wrapping if needed */ + word-break: break-word; /* Break long words if necessary */ } /* Tables */ diff --git a/templates/base.html b/templates/base.html index 35362b2..67b1b16 100644 --- a/templates/base.html +++ b/templates/base.html @@ -136,6 +136,30 @@ } } + /* Code blocks - extend wider but respect content margin */ + section > pre, + .post-content > pre, + .tufte pre, + pre { + width: calc(87.5vw - 2rem) !important; + max-width: 1200px !important; + margin-left: 0 !important; + margin-right: auto !important; + position: relative; + box-sizing: border-box; + } + + /* Responsive adjustments for code blocks */ + @media (max-width: 768px) { + section > pre, + .post-content > pre, + .tufte pre, + pre { + width: calc(100vw - 2rem) !important; + margin-left: -1rem !important; + } + } + /* Breadcrumb styling */ .breadcrumbs { font-size: 0.875rem; @@ -472,6 +496,15 @@ page-break-inside: avoid; } + /* Override width constraints for code blocks */ + section > pre, + .post-content > pre, + pre { + width: 85% !important; + max-width: none !important; + margin-left: 0 !important; + } + /* Tables */ table { border-collapse: collapse;