/* ============================================================= Bludit ToC Plugin — toc.css Self-contained: no dependency on the host theme's CSS variables. Dark mode is handled via prefers-color-scheme. If the theme exposes --accent / --text-muted / --bg-primary, those are layered on top via @supports for a seamless integration. ============================================================= */ /* ---- Color tokens (light) ---- */ #bltoc-sidebar { --bltoc-text: #777; --bltoc-hover: #111; --bltoc-active: #0066cc; --bltoc-label: #999; --bltoc-bg: #fff; --bltoc-border: rgba(0,0,0,0.08); --bltoc-fab-bg: #0066cc; --bltoc-fab-color: #fff; } /* ---- Color tokens (dark) ---- */ @media (prefers-color-scheme: dark) { #bltoc-sidebar { --bltoc-text: #999; --bltoc-hover: #eee; --bltoc-active: #4d9fff; --bltoc-label: #666; --bltoc-bg: #1a1a1a; --bltoc-border: rgba(255,255,255,0.08); } } /* Let blowdit (or any theme) override via its own design tokens */ @supports (color: var(--accent)) { #bltoc-sidebar { --bltoc-active: var(--accent); } } @supports (color: var(--text-muted)) { #bltoc-sidebar { --bltoc-text: var(--text-muted); } } @supports (color: var(--bg-primary)) { #bltoc-sidebar { --bltoc-bg: var(--bg-primary); } } /* ============================================================ Desktop fixed sidebar Visible only at min-width set by the admin (default 1280px). JS adds .bltoc-ready when headings are found, making it appear. ============================================================ */ .bltoc-sidebar { display: none; /* hidden until JS confirms headings exist */ position: fixed; left: 1rem; top: 5rem; /* approx below a typical navbar; fine-tuned with navbarHeight in JS */ width: 210px; max-height: calc(100vh - 6rem); overflow-y: auto; overflow-x: hidden; z-index: 200; font-size: 0.8125rem; line-height: 1.5; scrollbar-width: thin; scrollbar-color: var(--bltoc-border) transparent; } /* JS adds data-bltoc-minwidth on ; sidebar shows only above that threshold. */ /* Actual media-query breakpoint is injected by JS via a