From c36968278a3d68812be9b195dfd699fbc7485d82 Mon Sep 17 00:00:00 2001 From: emyarod Date: Thu, 11 Feb 2021 13:13:48 -0600 Subject: [PATCH] fix(sharedStyles): rename layers to match updated format --- packages/sketch/src/tools/sharedStyles.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/sketch/src/tools/sharedStyles.js b/packages/sketch/src/tools/sharedStyles.js index ad9da6b48100..b72102348935 100644 --- a/packages/sketch/src/tools/sharedStyles.js +++ b/packages/sketch/src/tools/sharedStyles.js @@ -29,6 +29,21 @@ export function syncSharedStyle( : document.sharedTextStyles; const [sharedStyle] = Array.from(documentSharedStyles).filter( (sharedStyle) => { + /** + * TODO: remove the following block after next Sketch plugin release + * backwards compatibility to avoid breaking changes from #5664, #5744 + * we search for style names with the following format + * `color/teal/60` + * and reformat it to + * `color / teal / 60` + * this search and replace will not be needed after the plugin has been + * published with renamed style layers + */ + // start removal + if (sharedStyle.name.split('/').join(' / ') === name) { + sharedStyle.name = name; + } + // end removal return sharedStyle.name === name; } );