Skip to content

Commit

Permalink
css
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulian233 committed Dec 21, 2024
1 parent 42c59d5 commit 5635060
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
6 changes: 0 additions & 6 deletions python_docs_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,3 @@ <h3>{{ _('Navigation') }}</h3>
{% trans sphinx_version=sphinx_version|e %}Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
</div>
{% endblock %}

{% block content %}
<div class="content-wrapper">
{{ super() }}
</div>
{% endblock %}
4 changes: 3 additions & 1 deletion python_docs_theme/static/pydoctheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ div.sphinxsidebar {
line-height: 130%;
font-size: smaller;
resize: horizontal;
min-width: 200px;
max-width: 400px;
}

div.sphinxsidebar h3,
Expand All @@ -158,7 +160,7 @@ div.sphinxsidebar h4 {
}

div.sphinxsidebarwrapper {
width: 100%;
width: 217px;
box-sizing: border-box;
height: 100%;
overflow-x: hidden;
Expand Down
23 changes: 0 additions & 23 deletions python_docs_theme/static/sidebar.js_t
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,6 @@ const initialiseSidebar = () => {
else if (sidebar_state === "expanded") {
expand_sidebar()
}

// Add event listeners to make the sidebar resizable by dragging the edge
let isResizing = false;
let lastDownX = 0;

sidebar.addEventListener('mousedown', (e) => {
isResizing = true;
lastDownX = e.clientX;
});

document.addEventListener('mousemove', (e) => {
if (!isResizing) return;

const offsetRight = document.body.offsetWidth - (e.clientX - document.body.offsetLeft);
const newWidth = Math.min(Math.max(200, offsetRight), 400);

sidebar.style.width = `${newWidth}px`;
bodyWrapper.style.marginLeft = `${newWidth + 10}px`;
});

document.addEventListener('mouseup', () => {
isResizing = false;
});
}

if (document.readyState !== "loading") {
Expand Down

0 comments on commit 5635060

Please sign in to comment.