How can i import Styles from a remote lobrary into the plugin interface?

I am having problems importing styles from a remote library. I can’t get them to display in a div inside the plugin interface.
I had no problem with the variables but now I can’t import them correctly. Because I imagine that they work in a different way but I can’t find the documentation.
Thank you very much in advance.

What’s the problem, exactly? Get the style value, send it to the UI, convert that value to the format you need, and apply it to your div.

Yes, I cant get the values of the styles to apply it on the div in the plugin interface. ( the plugin is running on a file with out styles and it has only styles from a remote library)

Use the getStyleByIdAsync(id) method to get the desired style data (or import styles using importStyleByKeyAsync(key), or use the REST API).

Thanks @tank666 !!
Could you show me an example functional code to have all the remote style import link complete ?

Here you go:

const importedStyle = await importStyleByKeyAsync("abcde")

(replace abcde with your actual style key)

1 Like

I dont have a defined style key beause wll depend on the libraries that will be linked to the file. So for an universal case how should be that part of the key ?

So get style keys from remote libraries using REST API or by opening each library file and using local styles getting methods using Plugin API.

2 Likes