From 0a2c552c0d950442230db5ce640a4ee5c4d363dc Mon Sep 17 00:00:00 2001
From: Wulian233 <1055917385@qq.com>
Date: Sat, 21 Dec 2024 09:07:26 +0800
Subject: [PATCH] css
---
python_docs_theme/layout.html | 1 -
python_docs_theme/static/pydoctheme.css | 4 +++-
python_docs_theme/static/sidebar-resizer.js | 23 ---------------------
3 files changed, 3 insertions(+), 25 deletions(-)
delete mode 100644 python_docs_theme/static/sidebar-resizer.js
diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html
index 9d92c19..9762b06 100644
--- a/python_docs_theme/layout.html
+++ b/python_docs_theme/layout.html
@@ -78,7 +78,6 @@
{{ _('Navigation') }}
-
{%- endif -%}
{%- endif -%}
{{ super() }}
diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css
index c8911df..1cd6601 100644
--- a/python_docs_theme/static/pydoctheme.css
+++ b/python_docs_theme/static/pydoctheme.css
@@ -150,6 +150,8 @@ div.sphinxsidebar {
line-height: 130%;
font-size: smaller;
width: 300px;
+ min-width: 200px;
+ max-width: 500px;
resize: horizontal;
overflow: auto;
}
@@ -160,7 +162,7 @@ div.sphinxsidebar h4 {
}
div.sphinxsidebarwrapper {
- width: 100%;
+ width: 300px;
box-sizing: border-box;
height: 100%;
overflow-x: hidden;
diff --git a/python_docs_theme/static/sidebar-resizer.js b/python_docs_theme/static/sidebar-resizer.js
deleted file mode 100644
index aef6772..0000000
--- a/python_docs_theme/static/sidebar-resizer.js
+++ /dev/null
@@ -1,23 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const sidebar = document.querySelector('.sphinxsidebar');
- const resizer = document.createElement('div');
- resizer.className = 'sidebar-resizer';
- sidebar.appendChild(resizer);
-
- resizer.addEventListener('mousedown', function(e) {
- document.addEventListener('mousemove', resizeSidebar);
- document.addEventListener('mouseup', stopResize);
- });
-
- function resizeSidebar(e) {
- const newWidth = e.clientX - sidebar.getBoundingClientRect().left;
- if (newWidth > 150 && newWidth < window.innerWidth - 100) {
- sidebar.style.width = newWidth + 'px';
- }
- }
-
- function stopResize() {
- document.removeEventListener('mousemove', resizeSidebar);
- document.removeEventListener('mouseup', stopResize);
- }
-});