Repository navigation
Add four new themes and the theme-base changes they need - #168
Merged
Merged
Conversation
`pnpm example:list-pdf` writes `packages/@vivliostyle/index.html`, which lists the PDFs left in each theme package with previews of their first pages. The pdf.js rendering moves from `capture-pdf.ts` to `pdf-render.ts` so that both scripts share it. Assisted-by: Claude Code:claude-opus-5-5
…n margin The `margin-block` of `figcaption` also added space on the outer side of the caption, on top of the figure's own margin, and left no space between images in the same figure. `--vs--figure-gap` sets the space between the items of the flex container instead. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWCYMcfddVwpY3dkusb
…listing numbering
With `:is()`, the selectors such as `figure:is(.fig, :has(> :is(img,
picture))) figcaption::before` took the specificity of the class, so a
theme rule like `.chart figcaption::before { content: none; }` lost to
them. `:where()` leaves only the `figure` type selector to count.
Assisted-by: Claude Code:claude-opus-5-5
Claude-Session: https://claude.ai/code/session_012bEdWCYMcfddVwpY3dkusb
`--vs-section--call-counter-content` and `--vs-section--marker-counter-content` hold only the number, so a theme can change the numbering, such as prefixing the chapter number, without rewriting the label. `--vs-section--label` replaces the `§` sign with `Section `, and with `節` placed after the number in Japanese, as section references read in each language. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWCYMcfddVwpY3dkusb
A two-column theme for English textbooks that typesets data-heavy pages with centered numbered headings, tables with colored headers, and line graphs. The default template is a chapter of a microeconomics textbook. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWBrzzgSRLKs9Bon8rr
…es without ` ` The HTML formatting of VFM treats an empty element such as `<a data-ref="fig"></a>` as if it were not there, and drops the whitespace right after it when whitespace also precedes it. A reference then runs into the following word, as in `Figure 7.1plots`, which the template worked around with ` `. Set `vfm.disableFormatHtml` in the configs so plain spaces survive, and drop the workaround. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWFJmP9qLYtufoN39U7
…rows and sections Themes set `break-inside: avoid` directly on list items, table rows and sections to keep an item, a row or a short section on one page. `--vs--li-break-inside`, `--vs--table-row-break-inside` and `--vs-section--h1-break-inside` to `--vs-section--h6-break-inside` let them do so through variables. The table row and section rules are matched with `:where()`, since `section:has(> h2:first-child)` outweighs a theme's `section.level2` and would reset its value to `auto` while the variable is unset. A table row only splits once `--vs--table-break-inside` is `auto`, as the table avoids breaks by default. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWCYMcfddVwpY3dkusb
… of contents `section:has(> h2:first-child)` outweighs a selector such as `section.level2`, so `break-before` and `break-after` written directly by a theme were reset to `auto` while the variables were unset. They now share the `:where()` rule of `break-inside`. The table of contents rules matched `:is(#toc, [role='doc-toc'])`, which counts as an ID and outweighed any selector a theme could write without one. `[id='toc']` matches the same element with the specificity of `[role='doc-toc']`. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWCYMcfddVwpY3dkusb
A single-column theme for English university textbooks, set entirely in monospace with hanging section numbers and numbered sidenotes in a band along the outer margin. The default template is a chapter of a programming textbook on parsing. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWFJmP9qLYtufoN39U7
…ripts The `vertical-align` of `.footnote-ref > sup` fell back to an empty value while `--vs--sup-vertical-align` was unset, so the browser's `vertical-align: super` came back on top of the `inset-block-start` shift of `sup`, and the call rose as high as the previous line. It now falls back to `baseline`. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWCYFAHRX9demS8AtEr
A single-column theme with wide margins for technical doujinshi. It sets interview pages with hanging indents under speaker names, and places pull quotes between thin rules and code blocks among the remarks. The default template is a Japanese book of conversations looking back on three incidents at a company. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWF5PDqCaupfhhF8So9
A single-column vertical theme for academic nonfiction, with section headings numbered in kanji numerals and horizontal graphs placed at the bottom of the page as page floats. Endnotes are supported. The default template is a chapter of a Japanese book on the modernization of weights and measures. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWF3piL8nQH9WSzkZ59
…al link footnotes The theorem label rules carried the conditions that choose its element, `.theorem > p:only-child::before` and `.theorem:not(:has(> p:only-child))::before`, at (0,2,2), so `.theorem::before` in a theme lost on every multi-paragraph theorem. The external link rules carried `:not(.footnote)` at (0,2,1), so a later rule on `a[href^='http']` lost in print. Both conditions now sit in `:where()`, which leaves where the label goes and which links are footnoted unchanged. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWD4BEh6qT2zmSdDZhg
…ism module
The prism module set `white-space`, `word-break`, `text-align`,
`overflow`, the background, the padding and the text color on
`pre[class*='language-']` and `code`. VFM gives every code block a
`language-*` class, so with the module loaded the `--vs--pre-*` and
`--vs--monospace-*` variables and a theme's `pre {}` had no effect on
code blocks, and the code inside them no longer inherited from `pre`.
The module now leaves the layout to the basic stylesheet and sets only
what Prism adds, with the specificity of `pre` and `code`. The
`--vs--pre-*` color, background and radius variables take precedence
over their Prism counterparts. `--vs-prism--block-code-padding` is a
`padding` shorthand and cannot fall back per axis, so its default takes
`--vs--pre-padding-block` and `--vs--pre-padding-inline` instead.
Assisted-by: Claude Code:claude-opus-5-5
Claude-Session: https://claude.ai/code/session_012bEdWD4BEh6qT2zmSdDZhg
spring-raining
force-pushed
the
feat/add-new-themes-1
branch
from
November 10, 2026 16:10
0240267 to
c572271
Compare
spring-raining
marked this pull request as ready for review
November 10, 2026 16:12
Member
|
だいたいよさそうですが、以下少し気になったところです: @vivliostyle/theme-centered-heading-line-graph
@vivliostyle/theme-vertical-numbered-heading-graph
@vivliostyle/theme-wide-margin-speaker-indent
|
…ble of contents The README says that chapter entries in the generated table of contents get chapter numbers, and the h1 marker ends with a full-width space so that the table of contents can copy it, but the rule that copies it was missing. The entries now take the text of the h1 `::before` with `target-text(attr(href), before)`. The introduction and the colophon also have a chapter counter value, so `target-counter()` would number them too, while their marker is not displayed and gives an empty string. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWD4BEh6qT2zmSdDZhg
…and the folio with the text The running head and the folio started at the edge of the page area, while the glyphs of the outermost lines sit half the leading inside their line, and the 16 lines leave 1.1mm empty on the left of the text area. On left pages the boxes stuck out 2.3mm to the left of the last line, and on right pages the folio stuck out 1.1mm to the right of the first line. The outer margin boxes now have an inside margin, as in `theme-bunko`, so that their edges line up with the glyphs. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWDkmWH5PeLeaHr7zgu
…ting a line A line could break before a note call, so that a line started with the note number, as in "2。". The call now begins with a WORD JOINER (U+2060) in `::before`, which prevents the break until `wrap-before` is supported. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWDkmWH5PeLeaHr7zgu
…ets from the type size and the page size The inside margins of the outer margin boxes were measured values for the default type size, leading and page size, so the running head and the folio no longer lined up with the text when a user changed any of them. They are now computed from `1rem`, `1rlh`, `100pvw` and the page margin variables: half the leading on both sides, plus on the left the part of the text area that whole lines leave over. Vivliostyle ignores `mod()` in this context, so the remainder is computed with its `floor()`. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWDkmWH5PeLeaHr7zgu
…panning heading The first block below a section heading kept its top margin in the first column only, since the other columns start at a column break, so the lists of the closing sections began lower in the first column than in the second. The block that follows a heading from h1 to h6 now has no top margin, nor has a subsection heading that follows at once, whose margin would otherwise pass up through its section. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWDsHB9mxbBoXg1wWYE
…ction with a subsection The example had no subsection heading right after a section heading, the case in which the margin of the subsection heading lowered only the first column. The price controls section now starts with "Price Ceilings" and continues with "Price Floors", and its opening paragraph is split between the two. Assisted-by: Claude Code:claude-opus-5-5 Claude-Session: https://claude.ai/code/session_012bEdWDsHB9mxbBoXg1wWYE
Member
Author
|
@MurakamiShinyu すべて修正しました!
こちらは他の複数段組みのレイアウトでも起こる問題のため本来であればbase themeで修正したい問題ですが、そのために |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds four new official themes, along with the
@vivliostyle/theme-basechanges that their layouts needed and a script to browse the built example PDFs.defaulttemplate.@vivliostyle/theme-centered-heading-line-graph: a two-column theme for English textbooks with centered numbered headings, tables with colored headers and line graphs. The configs setvfm.disableFormatHtmlso that the space after an empty reference survives.@vivliostyle/theme-mono-hanging-number-sidenote: a single-column theme for English university textbooks, set in monospace with hanging section numbers and numbered sidenotes in the outer margin.@vivliostyle/theme-wide-margin-speaker-indent: a single-column theme with wide margins for technical doujinshi, with hanging indents under speaker names, pull quotes between thin rules and code blocks among the remarks.@vivliostyle/theme-vertical-numbered-heading-graph: a single-column vertical theme for academic nonfiction, with section headings numbered in kanji numerals, horizontal graphs as page floats at the bottom of the page and endnotes.--vs--figure-gapspaces the items of afigurewithgapinstead of themargin-blockoffigcaption.--vs-section--labeland the number-only--vs-section--call-counter-contentand--vs-section--marker-counter-contentsplit the section reference into a label and a number. References now readSection 1.2(1.2節in Japanese) instead of§1.2.--vs--li-break-inside,--vs--table-row-break-insideand--vs-section--h1-break-insideto--vs-section--h6-break-insidecontrol page breaks inside list items, table rows and sections.break-before/break-afterand the table of contents rules have a lower specificity, so that a theme can override them with a class or attribute selector.pnpm example:list-pdfwritespackages/@vivliostyle/index.html, which lists the built example PDFs with previews of their first pages. The pdf.js rendering moves toscripts/pdf-render.ts, shared withcapture-pdf.ts.The release notes are in
.changeset/.Assisted-by: Claude Code:claude-opus-5-5
How the AI was used
example:list-pdfscript, the changesets and this description.🤖 Generated with Claude Code
https://claude.ai/code/session_012bEdWFtNhpQm8N2xisureo