Group header buttons and release 0.2.1
This commit is contained in:
parent
a58a49aeb4
commit
b9cddece19
5 changed files with 12 additions and 7 deletions
|
|
@ -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.0"
|
||||
__version__ = "0.2.1"
|
||||
|
|
|
|||
|
|
@ -48,14 +48,15 @@ button { color: inherit; }
|
|||
.app-shell { --desktop-sidebar-width: clamp(270px, 25vw, 400px); display: flex; width: 100%; height: 100%; flex-direction: column; overflow: hidden; background: var(--shell); }
|
||||
.desktop-header { position: relative; z-index: 20; display: grid; min-height: 76px; flex: 0 0 76px; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 18px; padding: 12px 20px; background: var(--shell); }
|
||||
.desktop-title { overflow: hidden; margin: 0; font-size: 1.55rem; font-weight: 450; line-height: 1.1; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.header-link { display: block; width: 100%; padding: 6px 12px; border: 1px solid transparent; border-radius: 20px; color: var(--text); background: transparent; text-decoration: none; line-height: 1.2; transition: background .16s ease, border-color .16s ease; }
|
||||
.header-link { display: block; width: 100%; padding: 6px 12px; border: 0; border-radius: 20px; color: var(--text); background: transparent; text-decoration: none; line-height: 1.2; transition: background .16s ease; }
|
||||
.header-link:hover { background: var(--control); }
|
||||
.header-link.active { color: var(--text); background: var(--active); }
|
||||
.header-link:not(.active):not(:hover) { border-color: var(--border); }
|
||||
|
||||
.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; }
|
||||
.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; }
|
||||
|
||||
.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; }
|
||||
|
|
@ -65,6 +66,7 @@ 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; }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "shared-docs-lib"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
description = "Build self-contained, Obsidian-like documentation sites from Python functions."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
|
|||
assert '".".repeat(dots)' in html
|
||||
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 "--tree-line: #2c2c2c" in html
|
||||
assert "height: 44px" in html
|
||||
assert "refresh-expanded" in html
|
||||
|
|
@ -123,7 +126,7 @@ def test_all_endpoints_and_self_contained_build(tmp_path):
|
|||
|
||||
|
||||
def test_build_writes_static_bundle(tmp_path):
|
||||
assert __version__ == "0.2.0"
|
||||
assert __version__ == "0.2.1"
|
||||
|
||||
@Page("1", "Static page")
|
||||
def static_page():
|
||||
|
|
|
|||
2
uv.lock
generated
2
uv.lock
generated
|
|
@ -452,7 +452,7 @@ wheels = [
|
|||
|
||||
[[package]]
|
||||
name = "shared-docs-lib"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "fastapi" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue