Lieflat Cards
Create image-ready HTML/CSS cards and render them to PNG. This skill currently ships one style: Rain.
Workflow
- Settle purpose, audience, page count, and aspect ratio. Default to 3:4 (600×800) when unspecified.
- Read the style guide before writing markup:
styles/rain/SKILL.md. It carries the palette, type scale, and slot contracts, and they are not optional. - Pick one accent for the whole set if the subject calls for one — press red for official documents, cold blue for technical writing. An accent swaps colour variables only; it never moves the layout. See the accents table in the style guide.
- Split the content into pages first, one idea per page, then pick the block that fits each page's shape. Do not reuse the cover layout for every page.
- Copy a template from
styles/rain/templates/and adapt the content. Keep its:root,accents.csslink, chrome, and script verbatim — and fix the link's relative href for wherever you put the file. - Render and read the audit:
python3 scripts/render.py <file.html>. Fix everything it reports. - Look at the PNGs before handing them over. Check overlap, alignment across pages, and page numbers.
- Return the files, naming the template and dimensions used.
Non-negotiables
- Write text into the slot that fits it. A serif display slot holds a value, not a sentence. See the slot contracts table in the style guide.
- Declare every colour as a variable in
:root. A hardcoded colour further down is unreachable by accents and silently breaks recolouring. - Cut copy to fit the type scale rather than shrinking type below the floor.
- Keep margins and column positions identical across a set.
- Never resolve an overflow by clipping the text.
Rendering
scripts/render.py needs Google Chrome or Chromium and nothing else — no pip install. It writes one PNG per .scene/.card element at 2× by default, and reports content that spills past a card edge or gets clipped.
bashpython3 scripts/render.py examples/skill-intro.html python3 scripts/render.py examples/skill-intro.html --check python3 scripts/render.py path/to/cards.html --scale 3 --out dist/
Assets and templates
- Rain style guide:
styles/rain/SKILL.md - Rain template:
styles/rain/templates/cards-rain-3x4.html— one file, one demo card per layout block - Rain accents:
styles/rain/accents.css— colour variants for a subject, one<body>class - Worked example:
examples/skill-intro.html— a nine-page set, one layout per page - Accent examples:
examples/accents/— the same three pages in each accent, layout untouched. Render one to see it; only the contact sheet ships as PNG. - Case studies:
examples/less-ai-tone/,examples/writing-dna/— onecards.htmlper set. Render it to see the pages; the repo ships contact sheets only.
There is no per-accent template, by design: an accent changes colour variables only, so the markup is identical across all of them. The template already links accents.css — put one class on <body> and the whole set retunes. examples/accents/ shows all four side by side.
Use the system-font fallbacks the templates declare. Do not bundle proprietary fonts.


