generated from secundant/product-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfigma.config.cjs
47 lines (45 loc) · 1.38 KB
/
figma.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const { formatExportFileName } = require('@neodx/figma');
const { toCase } = require('@neodx/std');
/**
* @type {import('@neodx/figma').Configuration}
*/
module.exports = {
export: {
fileId:
'https://www.figma.com/file/qjGIOVF6243bClGjQid2Y5/Int-UI-Icons-(Community)?type=design&node-id=955-20814',
output: 'assets/icons',
getExportFileName({ format, node }, root) {
const componentsSet = root.registry.byId[node.parentId];
const frame = root.registry.byId[componentsSet.parentId];
const frameName = toCase(frame.source.name, 'ca-se');
const parentName = toCase(componentsSet.source.name.replace(/^[^/]*\//, '').trim(), 'ca-se');
return formatExportFileName(`${frameName}/${parentName}.${format}`);
},
collect: {
target: [
{
type: 'CANVAS',
filter: 'Icons'
},
{
type: 'SECTION',
filter: 'General'
},
{
type: 'FRAME',
filter: ['General', 'Tool Windows']
},
{
type: 'COMPONENT_SET',
// Ignoring hidden components and 20x20 components
filter: node => node.source.visible !== false && !node.source.name.includes('20x20')
},
{
type: 'COMPONENT',
// Ignoring "Dark" theme, I think it can be covered by colors in CSS
filter: 'Light'
}
]
}
}
};