Repository navigation
Writ 0.5.0 — Alternative Preview Themes + Custom CSS
The headline 0.5.0 release. Two issues that together let users dress the preview pane to taste — four curated themes for common reading styles, plus a custom-CSS escape hatch for everyone whose taste falls outside the curated set.
Closes #19 — Alternative preview themes
New Preview theme picker in Settings. Four bundled themes, each with light and dark variants (follows the system):
- GitHub (default) — the current look (San Francisco body, JetBrains-Mono code, blue links, GitHub-flavored typography)
- Serif (academic) — Iowan Old Style / Charter / Georgia body, justified text, generous leading, centered title block, drop-cap on the first paragraph after a doc-header. For long-form writing that wants to look like a paper.
- Mono (typewriter) — SF Mono throughout (body and headings), dashed dividers, tighter line height. Man-page / printout aesthetic for technical docs.
- Sans modern — Inter / SF Pro body, airy spacing, ornamental `* * *` thematic break. Softer chrome than GitHub for prose-heavy writing.
Theme changes apply live — no document reload, no flicker — via a JS bridge call (`window.Writ.setPreviewTheme(name)`) that swaps the active stylesheet's href. HTML and PDF exports bundle the active theme so the exported file matches the live preview.
The structural rules (code blocks, alerts, math/mermaid containers, front-matter card, document header) stay consistent across themes — they live in the base `theme.css`, and each theme is just a small CSS overlay defining typography and palette.
Closes #6 — Custom CSS for preview
Below the theme picker: Custom preview CSS row with a Choose… button. Point Writ at any `.css` file and its contents are inlined on top of the active theme. Press Clear to remove. The choice persists across launches via a security-scoped bookmark, so the custom CSS survives sandbox restarts.
The custom CSS is loaded as an inline `<style id="writ-custom-style">` element (Swift reads the file via the bookmark, JS sets the style.textContent). Inlining instead of ``-ing avoids the cross-origin file:// load issues sandboxed WKWebViews trip over. Exports include the contents inline too.
The picker handles both the new file case and the clear case via a single button that flips between Choose… and Clear depending on the current state.
Heads up
Hot-reload on external edits (FSEvents-driven) didn't make this release — currently you re-pick the file to pick up edits made elsewhere. Small follow-up tracked for 0.5.1 if there's demand.
Install
Open `Writ-0.5.0.dmg`, drag Writ to Applications. Notarized + stapled.
What's next
The 0.5.0 milestone is closed. Outstanding items belong to 1.0.0 (#11 workspace/project) or are unmilestoned (small QoL like alt-fonts bundling). Open to direction on the 0.6.x line.