Skip to content

Add stat blocks, columns, zoom, and editable built-in themes#78

Merged
Dev-Ray-Hunt merged 2 commits into
mainfrom
claude/youthful-bose
Apr 6, 2026
Merged

Add stat blocks, columns, zoom, and editable built-in themes#78
Dev-Ray-Hunt merged 2 commits into
mainfrom
claude/youthful-bose

Conversation

@Dev-Ray-Hunt

Copy link
Copy Markdown
Owner

Features

Preview Improvements

  • Stat blocks & columned layout: Implement native CSS column pagination for two-column themes (e.g., D&D Homebrew)
  • Zoom controls: Add fit-width, fit-page, and manual zoom modes with +/− buttons in the preview toolbar
  • Page breaks: Support explicit {.page-break} annotations and heading-sticking logic

D&D Homebrew Theme

  • Complete style system with two-column layout, stat block formatting, callouts (read-aloud, magic items, warnings)
  • Print-ready typography, colors, and spacing for D&D 5e documents
  • Support for stat-block-wide variant that spans full page width

CSS Editor

  • Edit built-in themes: New "Edit built-in themes" setting allows users to modify built-in CSS files directly
  • Read-only toggle removed for built-in themes when setting is enabled
  • Built-in theme changes persist in the plugin's built-in folder

Parser Enhancements

  • Handle void elements (hr, br, img) in block class parser
  • Properly apply class annotations to hr elements and callouts with page-break directives

Technical Changes

  • Columned pagination uses element cloning + balanced columns for accurate page splits
  • Non-columned pagination improved with forced break detection and heading-content grouping
  • Zoom state management with manual/auto modes and viewport resizing
  • Settings tab extended with Advanced section for theme editing control

Brandon Hunt and others added 2 commits April 2, 2026 09:39
Populate dnd-homebrew.css with full D&D sourcebook styling: parchment
background, serif fonts, two-column layout, maroon headings, styled
callouts (stat-block, read-aloud, magic-item), gradient HR dividers,
image layout classes, and block class annotations.

Add overflow-detection pagination to the preview for columned themes.
The browser's native column engine handles layout while JS detects
when content overflows a page-sized container, replacing the clip-based
approach that was incompatible with CSS columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-ins (#47)

- Style stat block callouts with D&D 2024 look (rounded corners, shadow, hidden title bar)
- Add stat-block-wide callout type with full-width 2-column layout
- Support {.page-break} on <hr> elements via void element handling in block class parser
- Add page break support to both preview (normalization pre-pass) and PDF pipelines
- Add zoom controls to preview (fit-width, fit-page, manual ±)
- Make built-in themes optionally editable via Advanced settings toggle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dev-Ray-Hunt
Dev-Ray-Hunt merged commit cb84de1 into main Apr 6, 2026
1 check failed
@Dev-Ray-Hunt
Dev-Ray-Hunt deleted the claude/youthful-bose branch April 6, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant