StealThis .dev

Cookbook — Printable Recipe Card

A compact, editorial recipe card built to print beautifully on real index stock. It pairs a serif title, a tiny meta row for time and servings, a warm gradient thumbnail, and a condensed two-column layout that splits ingredients from method. A size toggle switches between three-by-five, four-by-six, and full-page formats, while a dedicated print stylesheet strips the chrome to clean black-on-white that fits a single page. Recipe content is fictional and for layout demonstration only.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Printable Recipe Card

A self-contained recipe card that looks like a real index card and prints like one too. The face carries a serif kicker and title, a warm CSS-gradient thumbnail standing in for food photography, and a tiny meta row summarizing prep, cook, servings, and difficulty. Below it, a two-column body keeps the ingredient list and numbered method side by side, collapsing to a single column on narrow screens.

Two interactions drive it. A segmented size toggle swaps the card between 3×5, 4×6, and full-page widths, updating the live hint text and aria-pressed state as you go. The Print button opens the browser print dialog after a brief toast, and a dedicated @media print block hides the toolbar, flattens everything to crisp black-on-white, keeps the card from breaking across pages, and trims to a single sheet.

Everything is vanilla HTML, CSS, and JavaScript — no frameworks, images, or libraries. Landmarks, a toolbar role, focus-visible outlines, and an aria-live status region keep it keyboard-friendly and screen-reader aware.

Illustrative UI only — recipes & nutrition data are fictional, not dietary advice.