Case study  /  Open source

Any web page into editable Figma layers.

Fit to Figma. A Figma plugin and CLI, open source under MIT. Not a screenshot: layers you can edit.

Role
Design and engineering, solo
Platform
Figma plugin and CLI
Stack
TypeScript, Figma Plugin API, Vitest
Status
Open source, MIT
github.com/Mykelking/Fit-to-Figma (opens in a new tab)
Fit to Figma site: every screen, in Figma, in one click, and what the plugin does.

The project

From the browser to Figma, as real layers.

For
Designers and developers who need a live page as editable Figma layers.
What it does
Run the CLI on a URL or a file, or drop HTML on the plugin. Frames, auto layout, text, fills, vectors and variables arrive as native Figma layers.
My part
Design and engineering, solo. Open source under MIT.
Timeline
Built from 22 September 2026.

The problem

Rebuilding a live page in Figma by hand.

Designers redraw pages that already exist in code, box by box, before they can change them. Screenshots are flat and out of date the day they are taken.

Before

  • Screenshots
  • Redraw by hand
  • Guessed spacing
  • Swapped fonts

After

  • Native frames
  • Auto layout
  • Real fonts
  • Figma variables

What I built

The browser's layout, mapped to Figma.

  • Flex and grid to auto layout
  • Fixed, fill and hug sizing
  • Fills and gradients
  • Images and inline SVG
  • Strokes and per-corner radius
  • Shadows and blurs
  • Text in the real fonts
  • CSS variables to Figma variables
  • Overflow to clip content
  • Drop a tree from the CLI
  • Drop or paste HTML
  • A second drop updates the frames
Fit to Figma site: every screen, in Figma, in one click, and what the plugin does.
Fit to Figma plugin: drop JSON trees, set the viewport and options, then build.
A page in, native layers out. The plugin window.

Results

  • 3ways in: CLI, HTML, URL
  • 20CSS rules mapped to Figma
  • MITopen source licence

What I learned

Use what the browser already knows.

Reading the boxes the browser drew, not the stylesheet, is what makes the result match the page.