Make sidebar actions theme-aware and release 0.2.2

This commit is contained in:
Server 2026-08-10 14:22:42 +00:00
parent b9cddece19
commit 3de82a7ef0
5 changed files with 11 additions and 10 deletions

View file

@ -5,4 +5,4 @@ from .server import build, create_app, run
from .ui import HeaderButton
__all__ = ["Component", "HeaderButton", "Page", "build", "create_app", "run"]
__version__ = "0.2.1"
__version__ = "0.2.2"

View file

@ -54,9 +54,9 @@ button { color: inherit; }
.desktop-main { display: flex; min-width: 0; min-height: 0; flex: 1; overflow: hidden; }
.desktop-sidebar { display: flex; width: var(--desktop-sidebar-width); min-width: 0; height: 100%; flex: 0 0 var(--desktop-sidebar-width); flex-direction: column; overflow: hidden; padding: 0 18px 22px; background: var(--shell); }
.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid #222; border-radius: 16px; background: #111; }
.sidebar-header-buttons .header-link { color: #f4f4f4; }
.sidebar-header-buttons .header-link:hover { background: #222; }
.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.sidebar-header-buttons .header-link { color: var(--text); }
.sidebar-header-buttons .header-link:hover { background: var(--control); }
.page-tree { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.desktop-sidebar > .page-tree { flex: 1; padding: 0 2px 24px; }
@ -66,7 +66,6 @@ button { color: inherit; }
.tree-link:hover { background: var(--control); }
.tree-link.active { background: var(--active); }
.sidebar-header-buttons .header-link.active, .desktop-sidebar .tree-link.active, .mobile-menu-view .header-link.active, .mobile-menu-view .tree-link.active { color: var(--selection-text); background: var(--selection-bg); }
.sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; }
.desktop-sidebar .tree-link.active .tree-number, .mobile-menu-view .tree-link.active .tree-number { color: var(--selection-number); }
.tree-number { flex: 0 0 auto; color: var(--muted); }
.tree-title { min-width: 0; overflow-wrap: anywhere; }

View file

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "shared-docs-lib"
version = "0.2.1"
version = "0.2.2"
description = "Build self-contained, Obsidian-like documentation sites from Python functions."
readme = "README.md"
requires-python = ">=3.10"

View file

@ -100,8 +100,10 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
assert "setTimeout(placeholderTick, 5000)" in html
assert '.sidebar-header-buttons .header-link:not(.active):first-child' not in html
assert "border: 1px solid transparent" not in html
assert ".sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid #222; border-radius: 16px; background: #111; }" in html
assert ".sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; }" in html
assert ".sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }" in html
assert ".sidebar-header-buttons .header-link { color: var(--text); }" in html
assert ".sidebar-header-buttons .header-link:hover { background: var(--control); }" in html
assert ".sidebar-header-buttons .header-link.active { color: #050505; background: #f0f0f0; }" not in html
assert "--tree-line: #2c2c2c" in html
assert "height: 44px" in html
assert "refresh-expanded" in html
@ -126,7 +128,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
def test_build_writes_static_bundle(tmp_path):
assert __version__ == "0.2.1"
assert __version__ == "0.2.2"
@Page("1", "Static page")
def static_page():

2
uv.lock generated
View file

@ -452,7 +452,7 @@ wheels = [
[[package]]
name = "shared-docs-lib"
version = "0.2.1"
version = "0.2.2"
source = { editable = "." }
dependencies = [
{ name = "fastapi" },