tools/figma-inspector/README.md
A Figma plugin that displays Slint code snippets in Figma's Dev mode inspector. When you select a design element, the plugin shows the equivalent Slint markup instead of CSS properties.
| Figma Node Type | Slint Element |
|---|---|
| Frame, Rectangle, Group | Rectangle { } |
| Component, Instance | Rectangle { } |
| Text | Text { } |
| Vector | Path { } |
Layout: x, y, width, height
Appearance:
background / fill (solid colors, linear and radial gradients)opacityborder-radius (uniform or per-corner)border-width, border-colorText:
text, colorfont-family, font-size, font-weighthorizontal-alignmentPath: commands (extracted from SVG), stroke, stroke-width
When enabled, the plugin references Figma variables as Slint property paths:
// Without variables
background: #3b82f6;
// With variables enabled
background: Colors.current.primary;
Install directly from Figma Community or search for "Figma To Slint" in the Figma plugin browser.
Plugins → Development → Import Plugin From Manifest...manifest.json from the extracted folderpnpm install # Install dependencies (first time only)
pnpm build # Build the plugin
Import the plugin in Figma: right-click → Plugins → Development → Import Plugin From Manifest... → select dist/manifest.json
pnpm dev
Enable hot reload in Figma: Plugins → Development → Hot Reload Plugin
Changes are automatically recompiled and reloaded.
Unit tests use Vitest with exported Figma JSON fixtures.
pnpm test # Run tests in watch mode
Generate a Figma access token:
Settings → Security → Generate new tokenGet the file ID from the Figma URL:
https://www.figma.com/design/njC6jSUbrYpqLRJ2dyV6NT/...
└─────────────────────┘
File ID
Download the file as JSON:
curl -H 'X-Figma-Token: <TOKEN>' \
'https://api.figma.com/v1/files/<FILE_ID>' \
-o tests/figma_output.json