$npx -y skills add kostja94/marketing-skills --skill masonryWhen the user wants to design, optimize, or audit masonry (Pinterest-style) layouts for content display. Also use when the user mentions "masonry layout," "masonry grid," "Pinterest layout," "waterfall layout," "brick layout," "varying height grid," "gallery layout," or "masonry
| 1 | # Components: Masonry Layout |
| 2 | |
| 3 | Guides masonry layout design for content with varying heights. Masonry stacks items in columns without distinct rows; items fill gaps like a brick wall. Best for image galleries, portfolios, and discovery-focused platforms. |
| 4 | |
| 5 | **When invoking**: On **first use**, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On **subsequent use** or when the user asks to skip, go directly to the main output. |
| 6 | |
| 7 | ## When to Use Masonry |
| 8 | |
| 9 | | Use masonry when | Use grid when | |
| 10 | |------------------|---------------| |
| 11 | | **Varying heights** | Equal-height items | |
| 12 | | Image-heavy; varied aspect ratios | Products, templates (consistent) | |
| 13 | | Gallery, portfolio, showcase | Card grid | |
| 14 | | Discovery, browsing; visual-first | Structured browsing | |
| 15 | |
| 16 | See **grid** for equal-height grid; **card** for card structure. |
| 17 | |
| 18 | ## Masonry vs Grid vs Bento vs Carousel |
| 19 | |
| 20 | | Layout | Structure | Best for | |
| 21 | |--------|-----------|----------| |
| 22 | | **Grid** | Equal rows and columns; uniform items | Products, templates, features | |
| 23 | | **Masonry** | Columns; items stack without rows; gaps filled | Pinterest, Behance; varied content | |
| 24 | | **Bento** | Intentional sections; predefined sizes | Homepage, dashboard; Apple-style | |
| 25 | | **Carousel** | Slides; one/few visible; swipe/click | Testimonials, logos, featured items; see **carousel** | |
| 26 | |
| 27 | ## Masonry Structure |
| 28 | |
| 29 | | Element | Purpose | |
| 30 | |---------|---------| |
| 31 | | **Columns** | 2–4 columns; fluid or fixed | |
| 32 | | **Items** | Varying heights; natural aspect ratio | |
| 33 | | **Gap** | Consistent horizontal and vertical spacing | |
| 34 | | **Order** | Top-to-bottom fill within columns | |
| 35 | |
| 36 | ## Implementation |
| 37 | |
| 38 | - **CSS columns**: `column-count`; simple, no JS; but items flow top-to-bottom then next column |
| 39 | - **Masonry.js / libraries**: True masonry (left-to-right fill); may need JS |
| 40 | - **CSS Grid + `grid-auto-flow: dense`**: Approximate; no JS; see **grid** for dense grid |
| 41 | |
| 42 | **Note**: Pure masonry can create accessibility challenges (screen reader order); ensure logical DOM order. |
| 43 | |
| 44 | ## SEO Considerations |
| 45 | |
| 46 | **Masonry + infinite scroll = content not crawlable.** Masonry galleries often use infinite scroll or lazy load; crawlers cannot emulate scroll or "Load more" clicks, so content beyond the initial view is not discoverable. |
| 47 | |
| 48 | | If you use | Then | |
| 49 | |------------|------| |
| 50 | | **Infinite scroll** | Provide paginated component pages with full URLs; implement pushState; see **site-crawlability** for search-friendly infinite scroll | |
| 51 | | **Lazy load** | Ensure content exists in HTML or is reachable via crawlable links | |
| 52 | | **Pagination** | Prefer for SEO-critical content; crawlers can follow next/prev links | |
| 53 | |
| 54 | **Reference**: [Google – Infinite scroll search-friendly recommendations](https://developers.google.com/search/blog/2014/02/infinite-scroll-search-friendly) |
| 55 | |
| 56 | ## Best Practices |
| 57 | |
| 58 | | Principle | Practice | |
| 59 | |-----------|----------| |
| 60 | | **Visual-first** | Thumbnails; minimal text | |
| 61 | | **Aspect ratio** | Preserve original; avoid forced cropping | |
| 62 | | **Lazy load** | Many images; load on scroll | |
| 63 | | **Performance** | Masonry can be heavy; consider grid for simpler cases | |
| 64 | |
| 65 | ## Use Cases |
| 66 | |
| 67 | | Use case | Format | Page Skill | |
| 68 | |----------|--------|------------| |
| 69 | | **Showcase / Gallery** | User work; varied sizes | **showcase-page-generator** | |
| 70 | | **Portfolio** | Projects; mixed media | — | |
| 71 | | **Pinterest-style** | Pins; discovery | — | |
| 72 | | **Image-heavy blog** | Blog with varied images | **blog-page-generator** | |
| 73 | |
| 74 | ## Related Skills |
| 75 | |
| 76 | - **site-crawlability**: Infinite scroll SEO; paginated component pages; search-friendly implementation |
| 77 | - **grid**: Equal-height grid; when masonry is overkill |
| 78 | - **carousel**: Carousel for slides/rotation; when masonry is overkill |
| 79 | - **card**: Card structure; masonry often uses cards |
| 80 | - **showcase-page-generator**: Gallery masonry |
| 81 | - **image-optimization**: Lazy load, aspect ratio, LCP |