Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liammartens/figma-node-selector
https://github.com/liammartens/figma-node-selector
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/liammartens/figma-node-selector
- Owner: LiamMartens
- Created: 2023-09-10T01:40:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-10T02:26:42.000Z (about 1 year ago)
- Last Synced: 2024-10-18T16:12:43.737Z (18 days ago)
- Language: TypeScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# figma-selector
This library can be used to select Figma nodes in the plugin API using a CSS selector-like syntax.## Usage
```js
import { select } from 'figma-node-selector';const results = select('Frame[name="frame-name"]', figma.currentPage);
```## More examples
```js
// selects the direct children of figma.currentPage, whose type is ELLIPSE and whose name contains "foo"
const results = select('> Ellipse[name*="foo"]', figma.currentPage);// selects any direct frame, which is in itself a direct child frame of the currentpage whose ID is "100:100"
const results = select('> Frame > Frame[id="100:100"]', figma.currentPage);// selects all direct children of the currentpage
const results = select('> *', figma.currentPage);// selects all the nodes (basically findAll)
const results = select('*', figma.currentPage);
```