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 support for Asset tokens #1265

Closed
Tracked by #1267
rbosker opened this issue Sep 7, 2022 · 4 comments · Fixed by #1337
Closed
Tracked by #1267

Add support for Asset tokens #1265

rbosker opened this issue Sep 7, 2022 · 4 comments · Fixed by #1337
Assignees

Comments

@rbosker
Copy link
Collaborator

rbosker commented Sep 7, 2022

Description

Sometimes users want to reference an image to be replaced when switching between brands. As a first start, we should allow them to just point to a URL that we can then fetch.

Background

type: 'asset',
label: 'Assets',
appliedToken: 'asset',
value: The value will be a string pointing to a URL.
placeholder: Public URL of your asset

Applying

Applying this token would have an effect on the fills. When applying an asset token we need to fetch the image from the provided source and then apply that as an image fill. If both an asset and a color fill are present, the asset should win.
Related docs: https://www.figma.com/plugin-docs/working-with-images/

@jpzwarte
Copy link

So we have a slightly different use case: different icons per theme. We want to be able to have different icons in the design system component based on the theme. And use SVGs inside Figma for them (not every product uses FontAwesome).

@jpzwarte
Copy link

So in our case we would have a place in Figma where the SVG icons are defined. And then using asset tokens, we would "point" the Figma token to the icon "element" on that Figma page??? And Figma Tokens would perhaps serialise the icon inside the JSON?

@jpzwarte
Copy link

So we would also like to be able to use FontAwesome icons and custom icons in Figma. Some apps may be either FontAwesome, or all custom icons. And some may even use mostly FontAwesome, but have a few custom icons for specific ones.

@six7
Copy link
Collaborator

six7 commented Oct 24, 2022

This was shipped as part of V123 🎉

@six7 six7 closed this as completed Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants