diff --git a/docslib/__init__.py b/docslib/__init__.py index be4636b..f423191 100644 --- a/docslib/__init__.py +++ b/docslib/__init__.py @@ -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.3.0" +__version__ = "0.3.1" diff --git a/docslib/templates/client.css b/docslib/templates/client.css index d3a761d..1e5abc2 100644 --- a/docslib/templates/client.css +++ b/docslib/templates/client.css @@ -53,13 +53,13 @@ button { color: inherit; } .header-link.active { color: var(--text); background: var(--active); } .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 var(--border); border-radius: 16px; background: var(--surface); } +.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; background: var(--shell); } +.sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 0; 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; } +.desktop-sidebar > .page-tree { flex: 1; padding: 24px 2px 70px; mask-image: linear-gradient(transparent 0px, #000 24px, #000 calc(100% - 100px), transparent); scrollbar-width: none; } .tree-group { margin: 2px 0; } .tree-children { margin-left: 17px; padding-left: 10px; border-left: 1px solid var(--tree-line); } .tree-link { display: flex; width: 100%; min-height: 32px; align-items: baseline; gap: 5px; padding: 4px 10px; border: 0; border-radius: 18px; color: var(--text); background: transparent; cursor: pointer; text-align: left; transition: background .15s ease, color .15s ease; } @@ -154,7 +154,7 @@ button { color: inherit; } body.mobile-search-open .mobile-search-view { display: flex; } .mobile-menu-view { padding: 52px 28px calc(150px + env(safe-area-inset-bottom)); } .mobile-site-title { margin: 0 0 34px; font-size: clamp(2.4rem, 11vw, 4rem); font-weight: 400; line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; } - .mobile-header-buttons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 38px; } + .mobile-header-buttons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 38px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); } .mobile-header-buttons .header-link { padding: 12px 18px; border-radius: 28px; font-size: 1.05rem; } .mobile-page-tree { overflow: visible; padding-bottom: 24px; } .mobile-page-tree .tree-link { min-height: 46px; padding: 9px 14px; border-radius: 24px; font-size: 1.05rem; } diff --git a/pyproject.toml b/pyproject.toml index ca68f66..30b6233 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "shared-docs-lib" -version = "0.3.0" +version = "0.3.1" description = "Build self-contained, Obsidian-like documentation sites from Python functions." readme = "README.md" requires-python = ">=3.10" diff --git a/tests/test_server.py b/tests/test_server.py index f865157..b959f3e 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -90,7 +90,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path): assert "min-height: calc(100dvh - 240px)" not in html assert "overflow-y: auto" in html assert "flex: 1 1 auto; flex-direction: column" in html - assert "padding: 0 18px 22px" in html + assert "padding: 0 18px; background: var(--shell)" in html assert "--desktop-sidebar-width: clamp(270px, 25vw, 400px)" in html assert "--selection-bg: #111111" in html assert "--selection-bg: #f0f0f0" in html @@ -114,7 +114,9 @@ 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 var(--border); border-radius: 16px; background: var(--surface); }" in html + assert ".sidebar-header-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-bottom: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }" in html + assert ".desktop-sidebar > .page-tree { flex: 1; padding: 24px 2px 70px; mask-image: linear-gradient(transparent 0px, #000 24px, #000 calc(100% - 100px), transparent); scrollbar-width: none; }" in manifest["client"]["css"]["system"] + assert ".mobile-header-buttons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 38px; border: 1px solid var(--border); border-radius: 24px; 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 @@ -142,7 +144,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path): def test_build_writes_static_bundle(tmp_path): - assert __version__ == "0.3.0" + assert __version__ == "0.3.1" @Page("1", "Static page") def static_page(): diff --git a/uv.lock b/uv.lock index 78dfd43..52c8563 100644 --- a/uv.lock +++ b/uv.lock @@ -452,7 +452,7 @@ wheels = [ [[package]] name = "shared-docs-lib" -version = "0.3.0" +version = "0.3.1" source = { editable = "." } dependencies = [ { name = "fastapi" },