Skip to main content
Solved

Refactoring style library help


Graham_Paterson

I’m looking for some advice on refactoring our design system. Currently we have all our library styles in one file, all our library components in another file, and all our individual team files.

I want to refactor the styles into separate library files. To do this I can simply duplicate the current style library, remove the elements I don’t need, publish, and use swap library to achieve the migration.

My question is: Do I do the swap library migration in the components file first and update the ordinary files and then swap the remaining style layers? Or does it matter

Here’s a diagram of what I’m trying to achieve and what I’m looking for is the order of operations eg:

  1. Swap Library in Component Library
  2. Publish components
  3. Update instances in non-library files
  4. Swap library in non-library files

Best answer by AlicePackard

I believe you can cut and paste styles to move them between libraries (just the same as moving components)! Here’s the documentation. It sounds like the connection between the styles and components using those styles is preserved after you first hit publish on your new Styles library.

View original
This topic has been closed for replies.

AlicePackard

I believe you can cut and paste styles to move them between libraries (just the same as moving components)! Here’s the documentation. It sounds like the connection between the styles and components using those styles is preserved after you first hit publish on your new Styles library.


Graham_Paterson

Oh amazing, I didn’t know they’d added that!


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