diff --git a/figmaExtractor/figmaExtractor.js b/figmaExtractor/figmaExtractor.js index 7ec84d68..13260b4d 100644 --- a/figmaExtractor/figmaExtractor.js +++ b/figmaExtractor/figmaExtractor.js @@ -26,6 +26,7 @@ const config = { fontSize: 'fontSize' } }, + frameIgnorePattern: '***ignore***', output: { folder: 'properties' } diff --git a/figmaExtractor/figmaFrames.js b/figmaExtractor/figmaFrames.js index 6f0f55fa..8a23b492 100644 --- a/figmaExtractor/figmaFrames.js +++ b/figmaExtractor/figmaFrames.js @@ -1,3 +1,5 @@ +const shouldIgnoreFrame = (frame, config) => frame.name.indexOf(config.frameIgnorePattern) !== -1; + // Get frames from 1st page of the Figma file module.exports = (figmaData, config) => { @@ -31,11 +33,14 @@ module.exports = (figmaData, config) => { } const figmaFrames = children.filter((frame) => frame.type === config.figma.childTypes.frame); + const onlyNotIgnoredFrames = figmaFrames.filter((frame) => !shouldIgnoreFrame(frame, config)); - if (figmaFrames.length < 1) { + if (onlyNotIgnoredFrames.length < 1) { throw new Error('ERROR: 1st page of the Figma file does not have any frames'); } - return figmaFrames; + console.log(onlyNotIgnoredFrames); + + return onlyNotIgnoredFrames; }