When to use this brief: Text-heavy documents that need design flair but content flows naturally across pages — guides, handbooks, catalogs, introductions, collections, illustrated manuals. The content is the star; design supports readability.
How it differs from creative.md: creative.md (Blueprint Mode) treats each page as a self-contained fixed-size visual canvas. This brief lets content flow continuously, with Chromium's @page auto-paginating at page boundaries.
→ MUST READ: typesetting/overflow.md for Playwright/HTML-specific overflow patterns.
You write raw HTML/CSS directly (no JSON Blueprint, no design_engine.py). The document is one continuous HTML body, and the browser's print engine splits it into pages automatically.
⚠️ Iron rule: All HTML→PDF conversions MUST use html2pdf-next.js — do NOT write custom Python Playwright scripts. It automatically handles @page injection, overflow detection, font waiting, Mermaid/KaTeX rendering, PDF metadata, etc.
node "$PDF_SKILL_DIR/scripts/html2pdf-next.js" input.html --output output.pdf --width 720px --height 1020px
.page divs for content sections. Use a single <div class="main-content"> with padding for all body content.break-before: page between content sections. This is the #1 cause of blank space — when the previous section doesn't fill a page, the remainder becomes a void. Use margin-top for visual chapter separation instead.break-inside: avoid on individual cards, items, and guide entries to prevent them from being split across pages.break-after: avoid on chapter headers (tag + title + divider group) to keep them attached to the first content block below.Fixed-height containers ONLY for cover and ending pages that must occupy a full page:
/* Cover: fixed height, standalone page */
.cover {
width: 720px;
height: 1020px;
box-sizing: border-box;
break-after: page;
overflow: hidden; /* OK here — clips decorative elements on cover only */
/* ⚠️ Use justify-content: center (NOT flex-end) to avoid top-heavy blank */
/* Add decorative elements (circles, lines) + bottom edition label for visual balance */
}
/* Ending: fixed height, standalone page */
.ending {
width: 720px;
height: 1020px;
box-sizing: border-box;
break-before: page;
overflow: hidden;
}
/* Content: flows naturally, NO fixed height */
.main-content {
padding: 60px 65px 40px 65px;
/* NO height property */
/* NO overflow: hidden */
}
| Mistake | Why it breaks | Fix |
|---|---|---|
.content { height: 1020px; } |
Content that exceeds the height gets clipped or overflows | Remove fixed height |
Multiple <div class="content"> each with padding: 60px |
Double padding (60+60=120px) between sections creates voids | One container, chapters separated by margin-top |
break-before: page on chapter headers |
Previous chapter doesn't fill the page → blank space before new chapter | Use margin-top: 36px instead |
overflow: hidden on content container |
Clips content at page boundaries | Only use on fixed-height cover/ending |
justify-content: flex-end on cover |
Title sinks to bottom, 60%+ blank above | Use center + decorative anchors for balance |
| Chapter with < 3 paragraphs of content | Leaves half a page blank before next chapter | Write enough content to fill at least 50% of a page |
margin-top: 50px+ on chapters |
Compounds with break-inside: avoid, creates large voids |
Keep chapter margin-top ≤ 30px |
@page {
size: 720px 1020px; /* Concrete px values — CSS variables NOT supported in @page */
margin: 0;
}
:root {
--c-bg: #0d0d0d;
--c-text: #e8e6e3;
--c-accent: #ff4757;
}
html, body {
margin: 0;
padding: 0;
width: 720px;
background: var(--c-bg);
color: var(--c-text);
font-family: 'Noto Sans SC', sans-serif;
}
@media screen {
html {
height: auto;
display: flex;
justify-content: center;
background: #222;
}
body {
transform-origin: top center;
margin: 20px auto;
}
}
⚠️ @page rules do NOT resolve CSS variables (var(--x) is silently ignored, falls back to A4). Always use concrete px values in @page.
<body>
<!-- Cover: fixed height, occupies one full page -->
<div class="cover">
<div class="tag">CATEGORY</div>
<div class="title">Document Title</div>
<div class="subtitle">Description text</div>
</div>
<!-- All body content in ONE continuous container -->
<div class="main-content">
<!-- Chapter 1 -->
<div class="section-tag">Chapter 1</div>
<div class="section-title">Title</div>
<div class="divider"></div>
<div class="body-text">Paragraph content...</div>
<div class="body-text">More paragraphs...</div>
<!-- Chapter 2: separated by margin-top, NOT break-before -->
<div class="chapter-header">
<div class="section-tag">Chapter 2</div>
<div class="section-title">Title</div>
<div class="divider"></div>
</div>
<!-- Cards / items with break-inside: avoid -->
<div class="card">Card content...</div>
<div class="card">Card content...</div>
</div>
<!-- Ending: fixed height, occupies one full page -->
<div class="ending">
<div class="big-text">Closing text</div>
</div>
</body>
Key CSS for chapter headers and cards:
.chapter-header {
break-after: avoid; /* Keep header with first content block */
break-inside: avoid;
margin-top: 28px; /* ≤ 30px! Larger values compound with break-inside: avoid → blank pages */
}
.card {
break-inside: avoid; /* Don't split a single card across pages */
margin-bottom: 14px; /* ≤ 16px! Every px of margin is lost space if card is pushed to next page */
}
Set html, body { background } to the document's dominant/darkest color. This prevents sub-pixel gap artifacts between content and page boundaries.
body { background: <that color> }body { background: <darkest color> } (dark body is invisible under white content pages)body { background: <lightest content bg> } (e.g. #f8fafc)The following rules apply identically to both Creative Flow and Creative Blueprint pipelines:
Never use Japanese kana (の, が, は), rare symbols, or Private Use Area characters. They corrupt to U+FFFD (�) during LLM→file write→read transit. Replace with plain Chinese equivalents: の→之/的/缔.
When using writing-mode: vertical-rl:
writing-mode: vertical-rl;
text-orientation: upright;
white-space: nowrap;
letter-spacing: 12px;
For CJK content, always load Google Fonts via <link> tag in <head> (NOT @import):
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&family=Noto+Serif+SC:wght@400;700;900&display=swap" rel="stylesheet">
After Playwright renders the PDF, extract text and scan for ? or \ufffd. If found, fix encoding-corrupted characters in the source HTML.
Before calling html2pdf-next.js, run the validator:
"$(command -v zcode-python || command -v python3)" "$PDF_SKILL_DIR/scripts/poster_validate.py" check-html <file>.html
--fix --output <file>.html for auto-repair.break-before: page between content sectionsbreak-inside: avoid on all cards/items/guide entriesbreak-after: avoid to stay with first content block<div class="main-content"> wraps all body content@page { margin: 0 } with concrete px size valueshtml, body { margin: 0; padding: 0 }justify-content: center (not flex-end) — flex-end pushes content to the bottom and leaves 60%+ blank at top, making the page feel emptymargin-top ≤ 30px. Larger values (50px+) compound with break-inside: avoid on cards, pushing content to the next page and leaving voids on the current page.margin ≤ 16px. Every pixel of vertical margin inside a break-inside: avoid block is space that cannot be reclaimed if the block is pushed to the next page.html2pdf-next.js (not screenshot)pdf.py meta.brandpdf_qa.py --no-tables