Skip to main content
Solved

Edit color styles in the team library


Ronak_Mokashi

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 🙂

Best answer by Gleb

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.

View original

4 replies

Gleb
  • Power Member
  • 4708 replies
  • May 10, 2021

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


Ronak_Mokashi

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


Gleb
  • Power Member
  • 4708 replies
  • Answer
  • May 11, 2021

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.


Ronak_Mokashi

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings