Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergcen/html-to-figma
Convert DOM node to Figma node
https://github.com/sergcen/html-to-figma
Last synced: 4 months ago
JSON representation
Convert DOM node to Figma node
- Host: GitHub
- URL: https://github.com/sergcen/html-to-figma
- Owner: sergcen
- Created: 2021-07-21T12:38:31.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-18T09:41:46.000Z (about 3 years ago)
- Last Synced: 2024-10-31T12:39:37.810Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 2.66 MB
- Stars: 56
- Watchers: 2
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# html-figma
**WORK IN PROGRESS**

Converts DOM nodes to Figma nodes.
Inspired by [figma-html](https://github.com/BuilderIO/figma-html).
*DEMO*: https://www.figma.com/community/plugin/1005496056687344906/html-to-figma-DEV-plugin
Example: `/dev-plugin`
```npm i html-figma```
## USAGE
### Browser
```js
import { htmlTofigma } from 'html-figma/browser';const element = document.getElementById('#element-to-export');
const layersMeta = await htmlTofigma(element);
```### Figma
```js
import { addLayersToFrame } from 'html-figma/figma';const rootNode = figma.currentPage;
await addLayersToFrame(layersMeta, rootNode);
```