skills/hubeiqiao/skills/apple-bento-grid

apple-bento-grid

Installation
SKILL.md

Apple Bento Grid

Overview

Generate self-contained HTML files that render Apple-inspired bento card grids. Each output is a single HTML file with inline CSS — no dependencies except Google Fonts. Cards fill a tight CSS grid with zero visible row gaps, ready for Playwright screenshot export at 2x resolution.

Workflow

  1. Read the design system: Read design-system.md completely before generating any bento grid. It contains all design tokens, card components, layout templates, and the critical zero-gap grid technique.
  2. Gather the user's content — what stats, milestones, categories, and quotes to showcase
  3. Choose a layout — pick from the 3 layout templates based on card count and orientation
  4. Compose cards — select card types and fill with the user's content
  5. Generate the HTML — produce a single self-contained HTML file
  6. Screenshot (optional) — use the Playwright script to capture PNGs at 2x

Output Format

Always produce a single self-contained HTML file with:

  • <!DOCTYPE html> + <html lang="en">
  • Google Fonts <link> tags in <head>
  • All CSS in a single <style> block
  • All content in <body> — no JavaScript needed

Card Types Available

Card Use For Key Feature
Hero Taglines, headlines Gradient top-border, spans 2 rows
Stat Numbers + labels Color-coded accent per category
Category Grouped items (phases, teams, quarters) Color label + subtitle + pill tags
Bar Chart Growth / comparison over time Gradient bars, header badge
Badge Tool attribution, featured callout Icon pill + stat number
Quote Mission statement, testimonial Dark bg, white text, green <em>
Highlight Hero number (3x, 10x, 100%) Full-gradient background

Layout Templates

Template Columns Width Aspect Ratio Best For
A: Horizontal 4-col 1200px 52/25 12-16 cards, slides
B: Horizontal 3-col 1100px 52/22 8-10 cards, focused
C: Vertical 2-col 600px none (content) 8-14 cards, social

Critical: Zero-Gap Grid Rules

These 5 rules are mandatory for Apple-like appearance. See design-system.md Section 2 for details.

  1. NEVER set align-items: start — default stretch fills cells
  2. Use aspect-ratio on horizontal layouts to lock container shape
  3. Rows: 1fr for horizontal, auto for vertical
  4. Gap: 6px (not 8px)
  5. Every grid cell must be occupied — no empty cells

Screenshot Export

Use the Playwright script at scripts/screenshot.mjs to capture pixel-perfect PNGs.

cd scripts
npm install
npx playwright install chromium
node screenshot.mjs

Edit the pages array in screenshot.mjs to point to your HTML files. Each entry needs: file (HTML path), output (PNG path), viewportWidth (match grid width).

Customization Checklist

  1. Gather content — stats, categories, milestones, quotes
  2. Choose layout — 4-col, 3-col, or 2-col
  3. Name grid areas — readable names matching content
  4. Select card types — Hero, Stat, Category, Chart, Badge, Quote, Highlight
  5. Assign accent colors — one per category, max 3-4 accents
  6. Set dimensions — viewport width matches grid width
  7. Lock aspect ratio — horizontal only; omit for vertical
  8. Verify zero-gap — no align-items: start, all cells occupied, gap 6px
  9. Scale for orientation — vertical gets smaller fonts, padding, radius
  10. Screenshot — Playwright at 2x, viewport matches grid width

Reference Files

Weekly Installs
2
First Seen
Mar 29, 2026