News for hackers. Stuff that matters.
Re:Making Figma better for developers with Dev Mode by ryanSrich on Wednesday June 21, 2023 @12:56PM (#36421112)
Seems interesting, and admittedly I might have missed this, but grabbing icons as individual SVGs is probably what takes me the longest when going from design to code. I have to click on each asset, name it properly, and then export it. Over, and over again. All from different layers, and pages.

If there was some sort of asset export that obeyed some spec on how to size and file name that’d save hours and hours of work.

Outside of that, I’m probably not ever going to use generated code enough for it to be a game changer. Most of the time you’re having to fit some design into an existing design system, and so I don’t really see the use case for code export at scale.

Re:Making Figma better for developers with Dev Mode by uxamanda on Wednesday June 21, 2023 @01:26PM (#36421574)
Right Click the icon > Copy/Paste as > Copy as SVG

We use that and just paste it into the codebase.

I've also used a bulk export plugin that autonames things. Would have to lookup the plugin name if you're interested.

Re:Making Figma better for developers with Dev Mode by Destiner on Wednesday June 21, 2023 @03:38PM (#36423285)
Or even better, cmd + /, type “svg”, press enter, done
Re:Making Figma better for developers with Dev Mode by uxamanda on Wednesday June 21, 2023 @06:25PM (#36425536)
Excellent! Thanks for the tip. I always forget that quick menu is there.
Re:Making Figma better for developers with Dev Mode by uxamanda on Thursday June 22, 2023 @04:07PM (#36438081)
I've used this menu about 5 times since yesterday, thanks again :)
Re:Making Figma better for developers with Dev Mode by toddmorey on Wednesday June 21, 2023 @03:47PM (#36423402)
Hero!
Re:Making Figma better for developers with Dev Mode by JusticeJuice on Wednesday June 21, 2023 @01:05PM (#36421255)
There is 100% that. Any frame can have an 'export' set on it, where you specificy the format (svg, png ..), suffix, pixel density etc. The name will be set by the name of the frame, and '/' creates nested folders. Then on any page can go file->export to export all assets at once.

But if you're using some icon library that a designer has imported into figma like remix-icon, just import from the library directly in code. Importing and rexporting the svg would likely change it slightly.

Re:Making Figma better for developers with Dev Mode by pininja on Wednesday June 21, 2023 @01:13PM (#36421395)
Maybe the vscode plug-in can autocomplete an SVG? That’d be helpful.. setting up every export takes a lot of time.
Re:Making Figma better for developers with Dev Mode by emilsjolander on Wednesday June 21, 2023 @01:42PM (#36421796)
Kinda! It will auto-detect icons in a design, highlight them at the top level, and allow you to import it into your VS Code workspace :)
Re:Making Figma better for developers with Dev Mode by kijin on Wednesday June 21, 2023 @01:28PM (#36421601)
I would also love to be able to select an arbitrary set of components and export them as a single SVG.

Often, the way the designer has grouped them together is not ideal for code, but I don't want to ungroup and group them all over again just so I can grab an SVG.

Re:Making Figma better for developers with Dev Mode by pelagic_sky on Wednesday June 21, 2023 @03:39PM (#36423304)
As a designer, all my icons are symbols and you can find the symbol artboard on another page with all the icons sized consistently with consistent naming conventions. You can select all and export as you please. Nothing drives me crazier than icons that are not properly formatted in both size and name.
Re:Making Figma better for developers with Dev Mode by chuckn0risk on Thursday June 22, 2023 @09:10AM (#36431613)
This is one of the reason we built Specify (specifyapp.com) which is a Design API that helps you sync design tokens and assets from Figma to any platforms.

For instance, let's say you're a React developer. Designers set their layers as exportable in SVG, and Specify can automatically export the SVG string, optimize it with SVGO, set the end filename, and generate a JSX component for React - automatically. Here's a short video that should help you understand the whole process (https://youtu.be/Z7fX0v3KFmY?t=353).

You basically just have to configure Specify once, and every time designers update icons in Figma you'll get automated pull requests with icons transformed exactly how you want.