Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exportAsync output to params #46

Open
t4y3 opened this issue Mar 4, 2024 · 1 comment
Open

Add exportAsync output to params #46

t4y3 opened this issue Mar 4, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@t4y3
Copy link

t4y3 commented Mar 4, 2024

With the support of figma.children, snippets are now easier to use. Thank you!
We believe that SVG strings and fimga.children will make it even more convenient.
Are there any plans to add SVG strings to params?


For example.

This button consists of an icon component and a text node.

image

This is what you want to display as a snippet in the button component

<Button>
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
    <path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z" clip-rule="evenodd" />
  </svg>
  <span>favorite</span>
</Button>

I think we can achieve this by registering a snippet like this in each template

Button Text Icon
TemplateForButton TemplateForText TemplateForVector
@jake-figma jake-figma added the enhancement New feature or request label Mar 11, 2024
@jake-figma jake-figma self-assigned this Mar 11, 2024
@jake-figma
Copy link
Collaborator

this is great feedback and i have had this floating around in the back of my head for awhile now. i want to avoid generating svg for every single node if it isnt being used. this is a similar problem to children, i only want to parse children if children are referenced in the template and the child has templates on it.

I have plans to add some logic to optimize this (parsing the templates up front) and i think this would be a great enhancement as a part of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants