html-shot

Solid

Use when a design has to become image assets through a real browser — an og:image or social preview card, an HTML/CSS or SVG design exported as PNG/JPEG/WebP, a screenshot of a page or of one element in it, or a favicon / app-icon set (.ico, .icns, apple-touch, PWA) for a site, Electron or Tauri app. Also use when a card's copy is CJK, emoji or mixed-script and bundling a font is not an option, or when an og image, favicon or logo raster needs regenerating after a design change.

Web & Frontend 0 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
0
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# html-shot — a design in, the image assets out Render an HTML file, a URL, or an SVG into a **pixel-perfect** static image. The engine is **Playwright** (mature headless Chromium): any CSS renders faithfully and **CJK text and emoji come from system fonts with nothing to bundle**. A local file is served over a throwaway `127.0.0.1` server, so Chromium resolves every reference itself — relative paths, site-absolute `/xxx`, `@import`, `srcset`, fonts named inside a stylesheet — and a card renders correctly with the project's dev server down. The browser does the rendering; this skill takes care of everything around it, so you never have to leave CSS: **what to shoot** (the whole body, one element, the full page), **how sharp** (supersampling, `--dpr`), and **what ships** (format, palette size, and for an icon set, the per-platform files). Two entry points, one engine: | | | |---|---| | `render.mjs` | one design → **one image** (og card, badge, element, page, SVG) | | `icons.mjs` | one design → **a favicon or app-icon set** (`.ico`/`.icns`/apple-touch/PWA) | ## When to use - Generating or refreshing an **og:image / social preview card** (1200×630) for a site or repo. - Turning a **design written in HTML/CSS** — badge, banner, diagram, certificate — into a PNG. - **Screenshotting a page or one element** of it, from a URL or a local file. - **Rasterising an SVG** — a logo or app-icon master at an exact size, with transparency — when the mark leans on filters that only a b...

Details

Author
rockbenben
Repository
rockbenben/aishort-skills
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category