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 b95f2dc commit 7d3da2d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/sketch/src/tools/sharedStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ export function syncSharedStyle(
: document.sharedTextStyles;
const [sharedStyle] = Array.from(documentSharedStyles).filter(
(sharedStyle) => {
/**
* TODO: remove the following block after next Sketch plugin release
* 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 7d3da2d

Please sign in to comment.