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

How to obtain all textStyles in teamLibrary? #187

Open
Dang-xiaorui opened this issue Feb 21, 2025 · 4 comments
Open

How to obtain all textStyles in teamLibrary? #187

Dang-xiaorui opened this issue Feb 21, 2025 · 4 comments

Comments

@Dang-xiaorui
Copy link

There is a node in the current file that uses local textStyle. I want to replace it with textStyle from teamLibrary.
At present, I can obtain all textStyles locally based on getLocalTextStylesSync(). So how can I obtain all textStyles and their detail information in teamLibrary?

@akbarbmirza
Copy link
Collaborator

Hi @Dang-xiaorui - I don't believe this is currently possible with the Plugin API. I've shared the feedback with the team. Please feel free to share additional context about your specific use-case so that I can help provide that to the team for prioritization

@Dang-xiaorui
Copy link
Author

For typography, figma has the concept of Text Styles. I am currently developing a figma plugin that can replace the Text Styles of text nodes. For example, there is a text node that uses a local Text Style called "Small Text". I want to replace it with Text Style from teamLibrary, also known as "Small Text". Therefore, I need to retrieve all Text Styles from teamLibrary and find the Text Style named "Small Text" from it. So how can I obtain all textStyles and their detail information in teamLibrary?

Image

@akbarbmirza
Copy link
Collaborator

Thanks for sharing, @Dang-xiaorui. While this info isn't available via the Plugin API, you could make a REST API call to the GET team styles endpoint along with the importStyleByKeyAsync method to get that information.

@Dang-xiaorui
Copy link
Author

Thanks for responding.But how do I get the team ID of all team libraries?

Image

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

No branches or pull requests

2 participants