Skip to content

Commit

Permalink
fix(sharedStyles): rename layers to match updated format
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Feb 11, 2021
1 parent 85c6862 commit c369682
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/sketch/src/tools/sharedStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
);
Expand Down

0 comments on commit c369682

Please sign in to comment.