Skip to main content
Jun 16, 2023 8:51 AM UTC
Solved

How can we use external style library like and figma

I want to use “figma-plugin-ds” library in my ui.html file I have tried to include it by link stylesheet like “build your first figma plugin” video, but is not working. Are there any other ways to do so?

Also, I want to use svg images and other images like jpg, png,etc from our assets folder without writing style in the same file.

Can you please give an example code or something like that which can help me too much?

@Gleb Can you please help with this?

This topic has been closed for replies.
Gleb
GlebSolution
Power Member
Jun 22, 2023 11:31 AM UTC

You don’t need to host it somewhere else

7 replies

Gleb
Power Member
Jun 20, 2023 6:53 AM UTC
Jun 20, 2023 12:24 PM UTC

@Gleb But using bundler can we use any image from assets folder to in our ui.html file whether it is svg OR jpd OR png?

Gleb
Power Member
Jun 20, 2023 1:36 PM UTC

SVG: you can inline them as regular text using bundlers
Raster images: you can turn small ones into Base64 (I think you can use a bundler for that too) but for large ones you’ll need to host them somewhere as your plugin will get huge pretty quick otherwise and the max size of all files in a plugin is 15MB.

Jun 22, 2023 9:54 AM UTC

@Gleb If I am using the JSX with the plugin then do i need to host the plugin some where else or just no need to do anything for publish?

Can we publish it as we doing normally plugin with ui.html file?

Gleb
Power Member
Jun 22, 2023 11:07 AM UTC

This page should explain it all: Libraries and Bundling | Plugin API

Jun 22, 2023 11:10 AM UTC

@Gleb

No i have create plugin and using jsx and it working in local, and plugin working in figma desktop app.

But my question is when i want to publish plugin in community then I can publish that plugin with react from figma desktop app as we publishing the normal figma plugin?

Or we need to host this plugins anywhere else to publish?

Gleb
GlebSolution
Power Member
Jun 22, 2023 11:31 AM UTC

You don’t need to host it somewhere else