|
|
2 mēneši atpakaļ | |
|---|---|---|
| .. | ||
| cases | 2 mēneši atpakaļ | |
| README.md | 2 mēneši atpakaļ | |
| skeleton.html | 2 mēneši atpakaļ | |
Distilled from reference examples m19 (MiniMax brand guide). Playwright HTML+CSS, exactly 2 pages, A4 portrait, sans-serif + multi-block grid.
Playwright HTML+CSS to PDF. Does NOT use the token pipeline.
Why: brand guides have very high visual density (color blocks, logos,
type specimens, gradients). HTML+CSS gives pixel-precise color
fidelity, inline SVG embedding, and @page A4 hard pagination. The
token pipeline cannot express the strict 2-page split.
Architecture: a single brand-guide.html (CSS embedded inside <style>)
assets/fonts/ -> Playwright sync -> PDF.Exactly two A4 portrait pages (210 x 297 mm), 15 mm margins.
Grid: 12 columns + 6 mm gutter; 8 mm gap between blocks. The page-2
footer uses margin-top: auto to pin to the bottom.
Palette (every hex is a CSS variable, override at will):
#181E25 (body text / wordmark)#F7F8FA (page background / cards)<!-- BRAND_PRIMARY --> (accent 1)<!-- BRAND_SECONDARY --> (accent 2)#5A6470 (secondary text / timestamps)#E2E5EA (hairline dividers)Typography (verified pairing — leave the CJK fallback alone):
Outfit, system-ui, sans-serif (H1 / H2 / numbers / labels)Poppins, system-ui, sans-serif (body / captions)@page { size: A4 portrait; margin: 15mm; }
.page { page-break-after: always; height: calc(297mm - 30mm); }
.page:last-of-type { page-break-after: auto; }
.page[data-page="2"] .footer { margin-top: auto; } /* pin bottom */
See skeleton.html (~180 lines self-contained, CSS
variables drive the palette, the logo is left as an inline SVG slot).
Case exemplar: for a complete website-to-brand-guide workflow using the current MiniMax site, real logo asset, portable data-URI source, render command, and verification gates, read cases/minimax-web-brand-guide/README.md. Editable source: cases/minimax-web-brand-guide/source.html.
Important: case HTML is a reference exemplar, not a deliverable shortcut. For any user-requested website brand guide, independently explore the live website first (HTML, linked CSS, visible copy, logo/image assets, product/navigation structure, and screenshots when useful), then author a fresh/meaningfully adapted guide. Do not directly copy the case source.html or ship a lightly patched case output; use it only for layout patterns, pagination math, and verification examples.
Quick start:
cp templates/brand-guide-2page/skeleton.html /tmp/brand/page.html
# Edit the :root CSS variables --primary / --secondary.
# Edit <!-- BRAND_NAME --> / <!-- BRAND_LOGO_SVG --> / <!-- BRAND_TAGLINE -->.
bash scripts/make.sh render --in /tmp/brand/page.html --out /tmp/brand/out.pdf --format A4 --wait 1200
# Strict 2 pages: pdfinfo /tmp/brand/out.pdf | grep Pages must report 2.
@font-face from local
files (do not depend on a CDN — it breaks offline / under VPN
switching). Keep system-ui only as the very last fallback.<svg>...</svg> or
data:image/svg+xml;base64,... is the only stable form. file://
paths can intermittently fail in headless Chromium — prefer inline.@page { size: A4 portrait }; never hardcode
pixels. Content area = 297mm - 30mm = 267mm. The last section must
fit, otherwise pin the footer with margin-top: auto..page needs page-break-after: always.
Verify with pdfinfo out.pdf | grep Pages (must equal 2). More or
fewer pages means a section did not fit cleanly.-webkit-print-color-adjust: exact; print-color-adjust: exact;,
otherwise Chromium screen-optimises the colors and the printed swatches
drift.Required placeholders:
<!-- BRAND_NAME --> company / product name (1-20 characters)--primary: <!-- BRAND_PRIMARY --> hex color (CSS variable)--secondary: <!-- BRAND_SECONDARY --> hex color<!-- BRAND_LOGO_SVG --> inline SVG (200-400 characters)<!-- BRAND_TAGLINE --> slogan (3-10 words)Optional:
Structural invariants (changing these breaks the layout):
@page rules: A4 portrait, 15 mm margins, page-break-after on .page.Diversify every run. The §4 baseline (Outfit + Poppins, charcoal +
surface) is wired up so the layout renders the moment you fill the
placeholders — it is not the default brand. The user's
--primary / --secondary plus their domain (consumer / B2B / fintech
/ creative agency) should drive the typography, palette intensity, and
voice-pillar tone. Two brand guides for two different companies should
not look like reskins of each other.