Edit color styles in the team library

Hey folks, hope you’re safe and doing well!

I am trying out a plugin to play around with the color styles that we have defined in our team library. For a particular use case, I want to change the name of one of the color styles that have been defined in the team library.

By going through the documentation, I got hang of one thing that you need to make async calls to get properties from the team library and need to pass a key which will eventually return a promise.

I have been successful so far, but I was trying to change the name of one style defined in my team library, it gave me the following error -

Uncaught Error: in set_name: Cannot write to internal and read-only node. Are you trying to modify a remote style or component?
at PaintStyle.set_name [as name] (Figma_app.58ba78766e09a350b3eac9a7702f2658.min.js.br:802)
at :1:8

Can anyone help me understand what am I doing wrong or the right way to do it.
Ps. I am not very well versed with JS :slight_smile:

Plugins can’t modify external styles and components. You need to run the plugin in the library file in order to modify it.

Oh okay. Any way to convert the external styles and components to local?

Do you want to move them or duplicate? Moving isn’t possible. To copy the style, simply import it and read all properties, then assign them to the new local style.

1 Like

Yeah, copying it and assigning it to a new local style works! Thanks for this @Gleb