Skip to content
Overview
Github.com

Features & Behavior

What it is

Void isn't a static theme β€” it's an interactive documentation app that happens to build as plain HTML. This section documents every behavior: keyboard shortcuts, overlays, navigation, persistence, offline support, and how the theme degrades gracefully when JavaScript is unavailable.

How it works

All features are driven by void.js (β‰ˆ5,500 lines), the theme's single-file JavaScript runtime. Every behavior is registered through an init*() function and called once at boot, then re-run after each SPA swap. Configuration is injected into a <script id="__config"> block at build time, and all feature states are persisted in localStorage under the void- prefix.

Features

  • Search β€” full-screen modal, / shortcut, suggestions, context snippets, highlighting, copy-link per result.
  • SPA navigation & scroll restore β€” prefetch-on-hover, client-side page swaps, scroll position memory, resume-to-last-page.

Productivity overlays

  • Reading mode β€” Alt+Shift+R distraction-free reading view that hides chrome and widens the article.
  • Action cluster β€” Alt+Shift+A floating action button that expands into quick-access shortcuts.
  • Focus timer β€” Alt+Shift+T Pomodoro-style countdown with TOC widget and reading chip.
  • Notes panel β€” Ctrl+Shift+N sticky notes with export, TTL, and cross-page persistence.
  • Keyboard reference β€” ? modal listing every binding, built dynamically from config.

Chrome behavior

  • Reading progress β€” progress bar at the top of the article.
  • Back-to-top β€” floating button that appears after scrolling.
  • TOC scrollspy β€” active-heading highlight in the "On this page" rail.

Offline & PWA

Persistence & external data

  • Persistence β€” every localStorage key the theme reads and writes.
  • Repo popover β€” Ctrl+Shift+G GitHub project card with 1-hour cache.

Graceful degradation

The table below shows what still works when JavaScript is disabled, when the device is offline, when prefers-reduced-motion: reduce is active, or when the browser lacks backdrop-filter support.

Feature No JS Offline (previously visited) Reduced motion No backdrop-filter
Search βœ— β€” no worker, no modal βœ— β€” search index not cached by SW β€” β€”
SPA navigation βœ— β€” full page reloads βœ“ β€” browser cache serves pages β€” β€”
Prefetch βœ— β€” no hover prefetch βœ“ β€” pages may be in browser cache β€” β€”
Reading mode βœ— β€” no JS toggle βœ“ β€” CSS-only hiding when persisted β€” β€”
Action cluster βœ— β€” no JS rendering βœ“ β€” rendered by server on first load β€” β€”
Focus timer βœ— β€” no JS countdown βœ— β€” timer state in localStorage β€” β€”
Notes panel βœ— β€” no JS overlay βœ“ β€” panel rendered on first load β€” β€”
Keyboard shortcuts βœ— β€” no key handling βœ“ β€” help modal rendered on first load β€” β€”
Reading progress βœ— β€” no scroll handler βœ“ β€” bar rendered, stays at 0% β€” β€”
Back-to-top βœ— β€” no scroll handler βœ“ β€” button stays hidden β€” β€”
TOC scrollspy βœ— β€” no scroll handler βœ“ β€” no active highlight β€” β€”
Glass morphism β€” β€” β€” βœ“ β€” falls back to flat semi-transparent fill
Animations (page, toast, stagger) β€” β€” βœ“ β€” CSS prefers-reduced-motion: reduce disables transitions and keyframes β€”
Palette toggle βœ“ β€” server-rendered scheme; no runtime toggle βœ“ β€” scheme stored in localStorage β€” β€”
Tabs βœ“ β€” <input type="radio"> fallback renders all panels βœ“ β€” β€”
Task lists βœ“ β€” native checkboxes still function βœ“ β€” state in localStorage β€” β€”
Admonitions (collapsible) βœ“ β€” native <details> toggles work βœ“ β€” β€”
Lightbox βœ— β€” no JS overlay βœ“ β€” β€”
Toast βœ— β€” no JS notification βœ“ β€” toast element hidden β€” β€”
Repo popover βœ— β€” no JS fetch βœ— β€” API data not cached by SW β€” β€”
Service worker β€” βœ“ β€” assets served from void-static-v4 / void-cdn-v4 caches β€” β€”
PWA install β€” βœ“ β€” manifest + SW already registered β€” β€”
Cookie consent βœ“ β€” banner rendered server-side βœ“ β€” state in localStorage β€” β€”

Legend: βœ“ = fully functional; βœ— = not functional; β€” = not applicable (feature doesn't depend on that condition).

Configuration

Features are toggled under theme.void.components and theme.void.*:

theme:
  void:
    components:
      search:
        show: true
      notes:
        show: true
      keyboard_help:
        show: true
      prefetch:
        show: true
        external: false
        exclude: []
      repo_popover:
        show: true
      toast:
        show: true

Under the hood

  • void.js boots via initTheme() β†’ initSearch() β†’ initSPANavigation() β†’ initPrefetch() β†’ initScrollBehavior() β†’ initBackToTop() β†’ initTocTracking() β†’ and the remaining init*() functions. Each is idempotent and re-runs after SPA swaps via reinitPageScoped().
  • Configuration lives in window.__config (parsed from the #__config <script> tag); the plugin injects theme.void.* as a flat JSON object at build time.
  • All persistence uses localStorage under the void- prefix (e.g. void-color-scheme, void-notes, void-scroll-pos).

Accessibility notes

  • Every overlay (search, notes, help, timer settings) traps focus and can be closed with Esc.
  • Keyboard shortcuts are configurable and can be remapped or disabled individually under theme.void.keyboard.shortcuts.
  • Reading mode and the focus timer honor prefers-reduced-motion and can be disabled per-feature via config.
  • The action cluster renders with aria-label on each button and role="group" on the menu.