mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
813 stars 73 forks source link

Ignore frames that start with _ #90

Closed Selino closed 3 years ago

Selino commented 3 years ago

It's sometimes difficult to integrate Figmagic into an existing UIKit with an aesthetic theme. For example: Let's say that I want to put a small description on the "Design Tokens / Colors" frame to call out the Brand colors.

Screen Shot 2021-02-17 at 11 07 44 AM

Figmagic seems to pick up the text layer and export it as a color to the tokens/colors.ts file.

What if we could name layers as _[whatever](prefixing an underscore to the frame/group/component name) and have Figmagic ignore that frame/group/component? Would this allow me to add all sorts of styling, notes, etc and have Figmagic work as expected?

My expectation is that an ignore condition that looks for the a designated string (like _ ) could be added to the loop that parses the /figmagic/Figma.json file. My concern with this approach that it would invite adding to the size of the /figmagic/Figma.json file. 😕 There'd be a ton of "ignored" nodes that would not be there otherwise.

If this ignore condition could happen as the /figmagic/Figma.json s being read/written… 🤷🏽‍♂️

mikaelvesavuori commented 3 years ago

Hey! I was confused a bit since this "should have been there", but was reminded that this should work for Elements, not for frames under Design Tokens.

I'll give it a look, should be a very simple fix.

mikaelvesavuori commented 3 years ago

Starting in 4.0.11, you can skip both pages and frames/layers with a leading underscore.

There was also a previous (undocumented) support to ignore layers simply called ignore.

Closing for now.